fix Razor macro
[pve-firewall.git] / src / Makefile
CommitLineData
bb272dd3 1
8f119284
DM
2export PREFIX=/usr
3export BINDIR=${PREFIX}/bin
4export SBINDIR=${PREFIX}/sbin
5export MANDIR=${PREFIX}/share/man
a0f1d07b 6export DOCDIR=${PREFIX}/share/doc/pve-firewall
8f119284 7export MAN1DIR=${MANDIR}/man1/
9b89c14f 8export MAN8DIR=${MANDIR}/man8/
8f119284 9export PERLDIR=${PREFIX}/share/perl5
9b89c14f 10export BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions
2b9ac863 11export ZSHCOMPLDIR=${PREFIX}/share/zsh/vendor-completions
bb272dd3 12
edb4aff5
DM
13export NOVIEW=1
14include /usr/share/pve-doc-generator/pve-doc-generator.mk
16adff04 15
edb4aff5 16all: pve-firewall.8 pvefw-logger
9b89c14f
DM
17
18pve-firewall.bash-completion: PVE/Service/pve_firewall.pm
19 perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_bash_completions();" >$@.tmp
20 mv $@.tmp $@
ba0b3a0a 21
2b9ac863
CE
22pve-firewall.zsh-completion: PVE/Service/pve_firewall.pm
23 perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_zsh_completions();" >$@.tmp
24 mv $@.tmp $@
25
ba0b3a0a
DM
26CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
27CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
28LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
29
30pvefw-logger: pvefw-logger.c
e134b263 31 gcc -Wall -Werror pvefw-logger.c -o pvefw-logger -std=gnu99 \
ba0b3a0a 32 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
fdf943fe 33 $(shell pkg-config libnetfilter_log libnetfilter_conntrack glib-2.0 --libs --cflags)
bb272dd3
DM
34
35.PHONY: install
2b9ac863 36install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.zsh-completion pvefw-logger
8f119284 37 make -C PVE install
bb272dd3 38 install -d -m 0755 ${DESTDIR}/${SBINDIR}
e2beb7aa 39 install -m 0755 pve-firewall ${DESTDIR}/${SBINDIR}
05018f6e 40 install -m 0755 pvefw-logger ${DESTDIR}/${SBINDIR}
9b89c14f
DM
41 install -d ${DESTDIR}/${MAN8DIR}
42 install -m 0644 pve-firewall.8 ${DESTDIR}/${MAN8DIR}
9b89c14f 43 install -m 0644 -D pve-firewall.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/pve-firewall
2b9ac863 44 install -m 0644 -D pve-firewall.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_pve-firewall
0b14268a
DM
45 install -d -m 0755 ${DESTDIR}/usr/lib/sysctl.d/
46 install -m 0644 pve-firewall-sysctl.conf ${DESTDIR}/usr/lib/sysctl.d/pve-firewall.conf
bb272dd3
DM
47
48.PHONY: clean
49clean:
8f119284 50 make -C PVE clean
edb4aff5
DM
51 make cleanup-docgen
52 rm -rf pvefw-logger
9b89c14f
DM
53 find . -name '*~' -exec rm {} ';'
54
bb272dd3
DM
55
56.PHONY: distclean
57distclean: clean
58