util  Diff

Differences From Artifact [11c34eecc9]:

To Artifact [12884906c5]:


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
dbg-flags = $(if $(debug),-g -D_cfg_debug,)
cc-flags = -std=c2x $(pq-inc) $(wg-inc) $(dbg-flags)
ld-flags = $(pq-lib) $(dbg-flags)


# link rule 
.PHONY: wgsync
$B/wgsync: $B/wgsync.o $B/pqp.o $B/def.o $B/wireguard.o | $B/
	$(CC) $(ld-flags) $^ -o $@

# build rules 
$B/%.o: src/%.c | $B/
	$(CC) $(cc-flags) -c $< -o $@

$B/wireguard.o: $E/wglib/wireguard.c $E/wglib/wireguard.h | $B/
	$(CC) -std=c11 -c $< -o $@

# dep listings
$B/wgsync.o: $E/wglib/wireguard.h src/pqp.h src/def.h
$B/pqp.o: src/pqp.h src/def.h 
$B/def.o: src/def.h

# fetch rules
%/:
	mkdir -p $@

wg-lib-uri = https://git.zx2c4.com/wireguard-tools/plain/contrib/embeddable-wg-library
$E/wglib/%: | $E/wglib/
	curl $(wg-lib-uri)/$* >$@







|



|






|
|
|








9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
dbg-flags = $(if $(debug),-g -D_cfg_debug,)
cc-flags = -std=c2x $(pq-inc) $(wg-inc) $(dbg-flags)
ld-flags = $(pq-lib) $(dbg-flags)


# link rule 
.PHONY: wgsync
$B/wgsync: $B/wgsync.o $B/pqp.o $B/def.o $B/wglist.o $B/wireguard.o | $B/
	$(CC) $(ld-flags) $^ -o $@

# build rules 
$B/%.o: src/%.c src/def.h | $B/
	$(CC) $(cc-flags) -c $< -o $@

$B/wireguard.o: $E/wglib/wireguard.c $E/wglib/wireguard.h | $B/
	$(CC) -std=c11 -c $< -o $@

# dep listings
$B/wgsync.o: $E/wglib/wireguard.h src/pqp.h src/wglist.h src/list.h
$B/wglist.o: $E/wglib/wireguard.h src/wglist.h src/list.h
$B/pqp.o: src/pqp.h 

# fetch rules
%/:
	mkdir -p $@

wg-lib-uri = https://git.zx2c4.com/wireguard-tools/plain/contrib/embeddable-wg-library
$E/wglib/%: | $E/wglib/
	curl $(wg-lib-uri)/$* >$@