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