-
Notifications
You must be signed in to change notification settings - Fork 30
/
Makefile.in
169 lines (144 loc) · 5.31 KB
/
Makefile.in
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
all: apps man
APPS = src/fdns src/nxdomain src/dnsc
MANPAGES = fdns.1 nxdomain.1 dnsc.1
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@
datarootdir=@datarootdir@
mandir=@mandir@
sysconfdir=@sysconfdir@
VERSION=@PACKAGE_VERSION@
NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
DOCDIR=@docdir@
HAVE_APPARMOR=@HAVE_APPARMOR@
SYSTEMD_DIR=@SYSTEMD_DIR@
.PHONY: apps $(APPS)
apps: $(APPS)
$(APPS): $(LIBS)
$(MAKE) -C $@
$(MANPAGES): $(wildcard src/man/*.txt)
./mkman.sh $(VERSION) src/man/$(basename $@).txt $@
man: $(MANPAGES)
clean:
rm -f gcov-file gcov-file-new gcov-file-old
for dir in $(APPS); do \
$(MAKE) -C $$dir clean; \
done
rm -f $(MANPAGES) $(MANPAGES:%=%.gz)
cd test/compile; ./compile.sh --clean; cd ../..
distclean: clean
for dir in $(APPS); do \
$(MAKE) -C $$dir distclean; \
done
rm -fr Makefile autom4te.cache config.log config.status config.h src/common.mk
realinstall:
# fdns executable
install -m 0755 -d $(DESTDIR)/$(bindir)
install -c -m 0755 src/fdns/fdns $(DESTDIR)/$(bindir)/.
install -c -m 0755 src/nxdomain/nxdomain $(DESTDIR)/$(bindir)/.
install -c -m 0755 src/dnsc/dnsc $(DESTDIR)/$(bindir)/.
# documents
install -m 0755 -d $(DESTDIR)/$(DOCDIR)
install -c -m 0644 COPYING $(DESTDIR)/$(DOCDIR)/.
install -c -m 0644 README $(DESTDIR)/$(DOCDIR)/.
install -c -m 0644 RELNOTES $(DESTDIR)/$(DOCDIR)/.
install -c -m 0644 etc/blocklists/README.md $(DESTDIR)/$(DOCDIR)/README-blocklists
# etc files
install -m 0755 -d $(DESTDIR)$(sysconfdir)/fdns
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/resolver.seccomp
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/servers
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.adblocker
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.trackers
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.coinblocker
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.phishing
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.tld-blacklist
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.malware
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/list.dyndns
install -m 0644 -t $(DESTDIR)$(sysconfdir)/fdns etc/blocklists/whitelist
# install server customization file
sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/fdns/servers.local ]; then install -c -m 0644 etc/servers.local $(DESTDIR)/$(sysconfdir)/fdns/servers.local; fi;"
# install user hosts customization file
sh -c "if [ ! -f $(DESTDIR)/$(sysconfdir)/fdns/hosts ]; then install -c -m 0644 etc/hosts $(DESTDIR)/$(sysconfdir)/fdns/hosts; fi;"
# systemd service unit
install -Dm0644 etc/fdns.service $(DESTDIR)$(SYSTEMD_DIR)/fdns.service
# man pages
echo "**********************************"
echo $(MANPAGES)
echo "**********************************"
install -m 0755 -d $(DESTDIR)/$(mandir)/man1
for man in $(MANPAGES); do \
rm -f $$man.gz; \
gzip -9n $$man; \
case "$$man" in \
*.1) install -c -m 0644 $$man.gz $(DESTDIR)/$(mandir)/man1/; ;; \
esac; \
done
rm -f $(MANPAGES) $(MANPAGES:%=%.gz)
# bash completion
install -m 0755 -d $(DESTDIR)/$(datarootdir)/bash-completion/completions
install -c -m 0644 src/bash_completion/fdns.bash_completion $(DESTDIR)/$(datarootdir)/bash-completion/completions/fdns
ifeq ($(HAVE_APPARMOR),-DHAVE_APPARMOR)
# apparmor profile
sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d; fi;"
sh -c "if [ ! -d $(DESTDIR)/$(sysconfdir)/apparmor.d/local ]; then install -d -m 755 $(DESTDIR)/$(sysconfdir)/apparmor.d/local; fi;"
install -c -m 0644 etc/apparmor/usr.bin.fdns $(DESTDIR)/$(sysconfdir)/apparmor.d/.
install -c -m 0644 etc/apparmor/fdns-local $(DESTDIR)/$(sysconfdir)/apparmor.d/local/usr.bin.fdns
endif
install: all
$(MAKE) realinstall
install-strip: all
strip src/fdns/fdns
strip src/nxdomain/nxdomain
strip src/dnsc/dnsc
$(MAKE) realinstall
uninstall:
rm -f $(DESTDIR)/$(bindir)/fdns
rm -f $(DESTDIR)/$(bindir)/nxdomain
rm -fr $(DESTDIR)/$(datarootdir)/doc/fdns
for man in $(MANPAGES); do \
rm -f $(DESTDIR)/$(mandir)/man1/$$man*; \
done
rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/fdns
DISTFILES = "src etc platform test configure configure.ac Makefile.in install.sh mkasc.sh mkman.sh mkdeb.sh COPYING README RELNOTES"
dist:
mv config.status config.status.old
make distclean
mv config.status.old config.status
rm -fr $(NAME)-$(VERSION) $(NAME)-$(VERSION).tar.xz
mkdir $(NAME)-$(VERSION)
cp -a "$(DISTFILES)" $(NAME)-$(VERSION)
rm -rf $(NAME)-$(VERSION)/src/tools
tar -cJvf $(NAME)-$(VERSION).tar.xz $(NAME)-$(VERSION)
rm -fr $(NAME)-$(VERSION)
asc:; ./mkasc.sh $(VERSION)
deb: dist
./mkdeb.sh $(NAME) $(VERSION)
cppcheck: clean
cppcheck --force .
filtercheck:; ./filtercheck.sh
scan-build: clean
NO_EXTRA_CFLAGS="yes" scan-build make
test-fdns:
cd test/fdns;su -c ./test.sh | grep TESTING
test: test-fdns
echo "TEST COMPLETE"
test-compile: dist
cd test/compile; ./compile.sh $(NAME)-$(VERSION)
gcov:
su -c ./gcov.sh
.PHONY: codespell
codespell:
@printf 'Running %s...\n' $@
@codespell --ignore-regex 'UE|als|chage|creat|doas|ether|isplay|readby|[Ss]hotcut' \
-S *.gz,*.o,*.so \
-S COPYING,m4 \
-S ./contrib/syscalls.sh \
-S ./etc \
-S ./.git \
-S ./test \
.
.PHONY: print-env
print-env:
./ci/printenv.sh