-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (102 loc) · 3.69 KB
/
Makefile
File metadata and controls
125 lines (102 loc) · 3.69 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
export VERSION := 0.8
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/sbin
MANDIR ?= $(PREFIX)/share/man
build:
$(MAKE) -C src
$(MAKE) -C ns2dohd
$(MAKE) -C proxy
$(MAKE) -C tools
debug:
$(MAKE) -C src debug
$(MAKE) -C ns2dohd debug
$(MAKE) -C proxy debug
$(MAKE) -C tools debug
dmalloc:
$(MAKE) -C src dmalloc
asan:
$(MAKE) -C src asan
$(MAKE) -C ns2dohd asan
$(MAKE) -C proxy asan
$(MAKE) -C tools asan
clean:
$(MAKE) -C src clean
$(MAKE) -C ns2dohd clean
$(MAKE) -C proxy clean
$(MAKE) -C tools clean
$(MAKE) -C test clean
docker-build:
docker build -f devops/Dockerfile . -t dyne/dohd:${VERSION}
docker-build-alpine:
docker build -f devops/Dockerfile.alpine . -t dyne/dohd:${VERSION}
docker-run:
docker run -it -p 8053:8053 dyne/dohd:${VERSION} ${CMD}
# Run all unit tests
check:
$(MAKE) -C test check
# Run unit tests with ASAN (for leak detection)
check-asan: asan
$(MAKE) -C test check
# Run integration tests (requires running dohd instance)
check-integration:
$(MAKE) -C test integration
# Run valgrind leak detection test
check-valgrind:
$(MAKE) -C test valgrind
# Stress tests (auto-launch dohd, bombard until failure)
stress:
$(MAKE) -C test stress
stress-escalate:
$(MAKE) -C test stress-escalate
stress-flood:
$(MAKE) -C test stress-flood
stress-chaos:
$(MAKE) -C test stress-chaos
stress-all:
$(MAKE) -C test stress-all
stress-asan:
$(MAKE) -C test stress-asan
# requires https://github.com/DNS-OARC/flamethrower
# default upstream GENERATOR: -g randomlabel lblsize=10 lblcount=4 count=1000
check-flame: HOST ?= danielinux.net
check-flame: PORT ?= 8053
check-flame: CLIENTNUM ?= 3
check-flame: GENERATOR ?= -g file -f ./test/domains.txt
check-flame: METHOD ?= GET
check-flame:
flame -P doh -M ${METHOD} -p ${PORT} ${HOST} ${GENERATOR}
site:
npx docsify-cli serve ./docs
install: build
install -d $(DESTDIR)$(BINDIR)
install -m 0755 src/dohd $(DESTDIR)$(BINDIR)/dohd
install -m 0755 ns2dohd/ns2dohd $(DESTDIR)$(BINDIR)/ns2dohd
install -m 0755 proxy/dohproxyd $(DESTDIR)$(BINDIR)/dohproxyd
install -m 0755 tools/odoh-keygen $(DESTDIR)$(BINDIR)/odoh-keygen
install -d $(DESTDIR)$(MANDIR)/man8
install -m 0644 man/dohd.8 $(DESTDIR)$(MANDIR)/man8/dohd.8
install -m 0644 man/ns2dohd.8 $(DESTDIR)$(MANDIR)/man8/ns2dohd.8
install -m 0644 man/dohproxyd.8 $(DESTDIR)$(MANDIR)/man8/dohproxyd.8
install -d $(DESTDIR)$(MANDIR)/man1
install -m 0644 man/odoh-keygen.1 $(DESTDIR)$(MANDIR)/man1/odoh-keygen.1
install -d $(DESTDIR)$(PREFIX)/share/dohd/examples
install -m 0755 examples/odoh/deploy-target-example.sh $(DESTDIR)$(PREFIX)/share/dohd/examples/deploy-target-example.sh
install -m 0755 examples/odoh/deploy-proxy-example.sh $(DESTDIR)$(PREFIX)/share/dohd/examples/deploy-proxy-example.sh
install -m 0755 examples/odoh/selftest-proxy-target-curl.sh $(DESTDIR)$(PREFIX)/share/dohd/examples/selftest-proxy-target-curl.sh
install -m 0644 examples/odoh/dodh_targets $(DESTDIR)$(PREFIX)/share/dohd/examples/dodh_targets
uninstall:
rm -f $(DESTDIR)$(BINDIR)/dohd
rm -f $(DESTDIR)$(BINDIR)/ns2dohd
rm -f $(DESTDIR)$(BINDIR)/dohproxyd
rm -f $(DESTDIR)$(BINDIR)/odoh-keygen
rm -f $(DESTDIR)$(MANDIR)/man8/dohd.8
rm -f $(DESTDIR)$(MANDIR)/man8/ns2dohd.8
rm -f $(DESTDIR)$(MANDIR)/man8/dohproxyd.8
rm -f $(DESTDIR)$(MANDIR)/man1/odoh-keygen.1
rm -f $(DESTDIR)$(PREFIX)/share/dohd/examples/deploy-target-example.sh
rm -f $(DESTDIR)$(PREFIX)/share/dohd/examples/deploy-proxy-example.sh
rm -f $(DESTDIR)$(PREFIX)/share/dohd/examples/selftest-proxy-target-curl.sh
rm -f $(DESTDIR)$(PREFIX)/share/dohd/examples/dodh_targets
.PHONY: build debug dmalloc asan clean docker-build docker-build-alpine docker-run \
check check-asan check-integration check-valgrind check-flame site \
install uninstall