bump version to 4.2-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 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
26 CFLAGS+=$(shell pkg-config libnetfilter_log libnetfilter_conntrack glib-2.0 --libs --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 $(CFLAGS) $(LDFLAGS)
31
32 .PHONY: install
33 install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.zsh-completion pvefw-logger
34 make -C PVE install
35 install -d -m 0755 ${SBINDIR}
36 install -m 0755 pve-firewall ${SBINDIR}
37 install -m 0755 pvefw-logger ${SBINDIR}
38 install -d ${MAN8DIR}
39 install -m 0644 pve-firewall.8 ${MAN8DIR}
40 install -m 0644 -D pve-firewall.bash-completion ${BASHCOMPLDIR}/pve-firewall
41 install -m 0644 -D pve-firewall.zsh-completion ${ZSHCOMPLDIR}/_pve-firewall
42 install -d -m 0755 ${DESTDIR}/usr/lib/sysctl.d/
43 install -m 0644 pve-firewall-sysctl.conf ${DESTDIR}/usr/lib/sysctl.d/pve-firewall.conf
44
45 .PHONY: clean
46 clean:
47 make -C PVE clean
48 make cleanup-docgen
49 rm -rf pvefw-logger
50 find . -name '*~' -exec rm {} ';'
51
52
53 .PHONY: distclean
54 distclean: clean