daemon: cleanup '+' character at begin of line
[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
bb272dd3 11
edb4aff5
DM
12export NOVIEW=1
13include /usr/share/pve-doc-generator/pve-doc-generator.mk
16adff04 14
edb4aff5 15all: pve-firewall.8 pvefw-logger
9b89c14f
DM
16
17pve-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 $@
ba0b3a0a
DM
20
21CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
22CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
23LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
24
25pvefw-logger: pvefw-logger.c
e134b263 26 gcc -Wall -Werror pvefw-logger.c -o pvefw-logger -std=gnu99 \
ba0b3a0a 27 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
fdf943fe 28 $(shell pkg-config libnetfilter_log libnetfilter_conntrack glib-2.0 --libs --cflags)
bb272dd3
DM
29
30.PHONY: install
edb4aff5 31install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pvefw-logger
8f119284 32 make -C PVE install
bb272dd3 33 install -d -m 0755 ${DESTDIR}/${SBINDIR}
e2beb7aa 34 install -m 0755 pve-firewall ${DESTDIR}/${SBINDIR}
05018f6e 35 install -m 0755 pvefw-logger ${DESTDIR}/${SBINDIR}
9b89c14f
DM
36 install -d ${DESTDIR}/${MAN8DIR}
37 install -m 0644 pve-firewall.8 ${DESTDIR}/${MAN8DIR}
9b89c14f 38 install -m 0644 -D pve-firewall.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/pve-firewall
0b14268a
DM
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
bb272dd3
DM
41
42.PHONY: clean
43clean:
8f119284 44 make -C PVE clean
edb4aff5
DM
45 make cleanup-docgen
46 rm -rf pvefw-logger
9b89c14f
DM
47 find . -name '*~' -exec rm {} ';'
48
bb272dd3
DM
49
50.PHONY: distclean
51distclean: clean
52