bump version to 4.1-3
[pve-firewall.git] / src / Makefile
1 DESTDIR=
2 PREFIX= /usr
3 BINDIR=${DESTDIR}/${PREFIX}/bin
4 SBINDIR=${DESTDIR}/${PREFIX}/sbin
5 MANDIR=${DESTDIR}/${PREFIX}/share/man
6 DOCDIR=${DESTDIR}/${PREFIX}/share/doc/pve-firewall
7 MAN1DIR=${MANDIR}/man1/
8 MAN8DIR=${MANDIR}/man8/
9 BASHCOMPLDIR=${DESTDIR}/${PREFIX}/share/bash-completion/completions
10 ZSHCOMPLDIR=${DESTDIR}/${PREFIX}/share/zsh/vendor-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 pve-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
25 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
26 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
27 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
28
29 pvefw-logger: pvefw-logger.c
30         gcc -Wall -Werror pvefw-logger.c -o pvefw-logger -std=gnu99 \
31         $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
32         $(shell pkg-config libnetfilter_log libnetfilter_conntrack glib-2.0 --libs --cflags)
33
34 .PHONY: install
35 install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.zsh-completion pvefw-logger
36         make -C PVE install
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
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
46
47 .PHONY: clean
48 clean:  
49         make -C PVE clean
50         make cleanup-docgen
51         rm -rf pvefw-logger 
52         find . -name '*~' -exec rm {} ';'
53
54
55 .PHONY: distclean
56 distclean: clean