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