]> git.proxmox.com Git - pve-firewall.git/blob - src/Makefile
use service class to generate pod and bash-completion files
[pve-firewall.git] / src / Makefile
1
2 export PREFIX=/usr
3 export BINDIR=${PREFIX}/bin
4 export SBINDIR=${PREFIX}/sbin
5 export MANDIR=${PREFIX}/share/man
6 export DOCDIR=${PREFIX}/share/doc/pve-firewall
7 export PODDIR=${DOCDIR}/pod
8 export MAN1DIR=${MANDIR}/man1/
9 export MAN8DIR=${MANDIR}/man8/
10 export PERLDIR=${PREFIX}/share/perl5
11 export BASHCOMPLDIR=${PREFIX}/share/bash-completion/completions
12
13 all: pve-firewall.8 pvefw-logger
14
15 %.8: %.8.pod
16 rm -f $@
17 cat $<|pod2man -n $* -s 8 -r ${VERSION} -c "Proxmox Documentation" >$@.tmp
18 mv $@.tmp $@
19
20 pve-firewall.8.pod: PVE/Service/pve_firewall.pm
21 perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_pod_manpage();" >$@.tmp
22 mv $@.tmp $@
23
24 pve-firewall.bash-completion: PVE/Service/pve_firewall.pm
25 perl -I. -T -e "use PVE::Service::pve_firewall; PVE::Service::pve_firewall->generate_bash_completions();" >$@.tmp
26 mv $@.tmp $@
27
28 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
29 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
30 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
31
32 pvefw-logger: pvefw-logger.c
33 gcc -Wall -Werror pvefw-logger.c -o pvefw-logger -std=gnu99 \
34 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
35 $(shell pkg-config libnetfilter_log glib-2.0 gthread-2.0 --libs --cflags)
36
37 .PHONY: install
38 install: pve-firewall pve-firewall.8 pve-firewall.bash-completion pve-firewall.8.pod pvefw-logger
39 make -C PVE install
40 install -d -m 0755 ${DESTDIR}/${SBINDIR}
41 install -m 0755 pve-firewall ${DESTDIR}/${SBINDIR}
42 install -m 0755 --strip pvefw-logger ${DESTDIR}/${SBINDIR}
43 install -d ${DESTDIR}/${MAN8DIR}
44 install -m 0644 pve-firewall.8 ${DESTDIR}/${MAN8DIR}
45 install -d ${DESTDIR}/${PODDIR}
46 install -m 0644 pve-firewall.8.pod ${DESTDIR}/${PODDIR}
47 install -m 0644 -D pve-firewall.bash-completion ${DESTDIR}/${BASHCOMPLDIR}/pve-firewall
48
49 .PHONY: clean
50 clean:
51 make -C PVE clean
52 rm -rf pvefw-logger
53 find . -name '*~' -exec rm {} ';'
54
55
56 .PHONY: distclean
57 distclean: clean
58