-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
76 lines (60 loc) · 2.11 KB
/
Makefile
1
2
3
4
5
6
7
8
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
CPPFLAGS += -DVERSION=\"$(VERSION)\"
default: netip
all: netip fuzzy tester
netip: base16.o base32.o seal.o
netip: LDLIBS := -lsodium
base32.o: base32.h base32.c
$(CC) -c -o $@ base32.c
base16.o: base16.h base16.c
$(CC) -c -o $@ base16.c
acme: LDLIBS := -lsodium
acme: acme.c base32.o base16.o seal.o
assets: netip
@echo "Checking that VERSION was defined in the calling environment"
@test -n "$(VERSION)"
@echo "OK. VERSION=$(VERSION)"
docker run --rm --entrypoint='' huntprod/netip.cc:$(VERSION) \
cat /usr/bin/netip > netip-linux-64
mv netip netip-darwin-64
chmod 0755 netip-linux-64 \
netip-darwin-64
local:
docker build \
--build-arg BUILD_DATE="$(shell date -u --iso-8601)" \
--build-arg VCS_REF="$(shell git rev-parse --short HEAD)" \
. -t huntprod/netip.cc:latest
docker build -f Dockerfile.web \
--build-arg BUILD_DATE="$(shell date -u --iso-8601)" \
--build-arg VCS_REF="$(shell git rev-parse --short HEAD)" \
. -t huntprod/www.netip.cc:latest
release:
@echo "Checking that VERSION was defined in the calling environment"
@test -n "$(VERSION)"
@echo "OK. VERSION=$(VERSION)"
docker build \
--build-arg VERSION="$(VERSION)" \
--build-arg BUILD_DATE="$(shell date -u --iso-8601)" \
--build-arg VCS_REF="$(shell git rev-parse --short HEAD)" \
. -t huntprod/netip.cc:latest
docker tag huntprod/netip.cc:latest huntprod/netip.cc:$(VERSION)
docker push huntprod/netip.cc:latest
docker push huntprod/netip.cc:$(VERSION)
docker build -f Dockerfile.web \
--build-arg VERSION="$(VERSION)" \
--build-arg BUILD_DATE="$(shell date -u --iso-8601)" \
--build-arg VCS_REF="$(shell git rev-parse --short HEAD)" \
. -t huntprod/www.netip.cc:latest
docker tag huntprod/www.netip.cc:latest huntprod/www.netip.cc:$(VERSION)
docker push huntprod/www.netip.cc:latest
docker push huntprod/www.netip.cc:$(VERSION)
fuzzy: CFLAGS := -fPIE
fuzzy: LDLIBS := -lsodium
fuzzy: fuzzy.o base16.o base32.o seal.o
fuzzy.o: netip.c
afl-clang $(CFLAGS) -DFUZZ -c -o $@ $+
tester: tester.o
tester.o: netip.c
$(CC) $(CFLAGS) -DTESTER -c -o $@ $+
clean:
rm -f *.o
rm -f fuzzy netip