bump version to 4.2-4
[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 25CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
59992ae7 26CFLAGS+=$(shell pkg-config libnetfilter_log libnetfilter_conntrack glib-2.0 --libs --cflags)
ba0b3a0a
DM
27LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
28
29pvefw-logger: pvefw-logger.c
59992ae7 30 gcc -Wall -Werror pvefw-logger.c -o pvefw-logger -std=gnu99 $(CFLAGS) $(LDFLAGS)
bb272dd3
DM
31
32.PHONY: install
2b9ac863 33install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.zsh-completion pvefw-logger
8f119284 34 make -C PVE install
43be6155
TL
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
0b14268a
DM
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
bb272dd3
DM
44
45.PHONY: clean
46clean:
8f119284 47 make -C PVE clean
edb4aff5
DM
48 make cleanup-docgen
49 rm -rf pvefw-logger
9b89c14f
DM
50 find . -name '*~' -exec rm {} ';'
51
bb272dd3
DM
52
53.PHONY: distclean
54distclean: clean