use gnu11 instead of gnu99 (newer)
[pve-firewall.git] / src / Makefile
1
2 PREFIX=/usr
3 BINDIR=${PREFIX}/bin
4 SBINDIR=${PREFIX}/sbin
5 MANDIR=${PREFIX}/share/man
6 DOCDIR=${PREFIX}/share/doc
7 MAN1DIR=${MANDIR}/man1/
8 PERLDIR=${PREFIX}/share/perl5
9
10 LIB_SOURCES=                    \
11         Firewall.pm
12
13 all: pvefw-logger
14
15 CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
16 CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
17 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
18
19 pvefw-logger: pvefw-logger.c
20         gcc -Wall -Werror pvefw-logger.c -o pvefw-logger -std=gnu11 \
21         $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
22         $(shell pkg-config libnetfilter_log glib-2.0 gthread-2.0 --libs --cflags)
23
24 .PHONY: install
25 install: pvefw pvefw-logger
26         install -d -m 0755 ${DESTDIR}/${SBINDIR}
27         install -m 0755 pvefw ${DESTDIR}/${SBINDIR}
28         install -m 0755 --strip pvefw-logger ${DESTDIR}/${SBINDIR}
29         install -d -m 0755 ${DESTDIR}${PERLDIR}/PVE
30         for i in ${LIB_SOURCES}; do install -D -m 0644 PVE/$$i ${DESTDIR}${PERLDIR}/PVE/$$i; done
31
32
33 .PHONY: clean
34 clean:  
35         rm -rf *~ pvefw-logger
36
37 .PHONY: distclean
38 distclean: clean
39