Annotation of embedaddon/miniupnpd/netfilter/Makefile, revision 1.1.1.3
1.1.1.3 ! misho 1: # $Id: Makefile,v 1.6 2012/04/26 13:50:48 nanard Exp $
! 2: CFLAGS?=-Wall -g -D_GNU_SOURCE -DDEBUG -Wstrict-prototypes -Wdeclaration-after-statement -ansi
1.1.1.2 misho 3: CC = gcc
4:
5: #LIBS = -liptc
6: LIBS = -lip4tc
7:
8: ARCH := $(shell uname -m | grep -q "x86_64" && echo 64)
9: ifdef IPTABLESPATH
10: CFLAGS := $(CFLAGS) -I$(IPTABLESPATH)/include/
11: LDFLAGS := $(LDFLAFGS) -L$(IPTABLESPATH)/libiptc/
12: # get iptables version and set IPTABLES_143 macro if needed
13: IPTABLESVERSION := $(shell grep "\#define VERSION" $(IPTABLESPATH)/config.h | tr -d \" |cut -d" " -f3 )
14: IPTABLESVERSION1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 )
15: IPTABLESVERSION2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 )
16: IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
17: # test if iptables version >= 1.4.3
18: TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 )
19: ifeq ($(TEST), 1)
20: CFLAGS := $(CFLAGS) -DIPTABLES_143
21: # the following sucks, but works
22: LIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
23: #LIBS = $(IPTABLESPATH)/libiptc/.libs/libiptc.a
24: else
25: LIBS = $(IPTABLESPATH)/libiptc/libiptc.a
26: endif
27: else
28: # check for system-wide iptables files. Test if iptables version >= 1.4.3
1.1.1.3 ! misho 29: #TEST := $(shell test -f /usr/include/iptables/internal.h && grep -q "\#define IPTABLES_VERSION" /usr/include/iptables/internal.h && echo 1)
! 30: TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1)
1.1.1.2 misho 31: ifeq ($(TEST), 1)
32: CFLAGS := $(CFLAGS) -DIPTABLES_143
33: LIBS = -liptc
34: TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1)
35: ifeq ($(TEST_LIB), 1)
36: LIBS = -liptc /usr/lib$(ARCH)/libiptc.a
37: endif
1.1.1.3 ! misho 38: endif
1.1.1.2 misho 39: endif
1.1 misho 40:
1.1.1.3 ! misho 41: all: iptcrdr.o testiptcrdr iptpinhole.o testiptpinhole
1.1 misho 42:
43: clean:
1.1.1.3 ! misho 44: $(RM) *.o testiptcrdr testiptpinhole
1.1 misho 45:
1.1.1.2 misho 46: testiptcrdr: testiptcrdr.o iptcrdr.o upnpglobalvars.o $(LIBS)
1.1 misho 47:
1.1.1.3 ! misho 48: testiptpinhole: testiptpinhole.o iptpinhole.o upnpglobalvars.o $(LIBS)
! 49:
1.1 misho 50: iptcrdr.o: iptcrdr.c iptcrdr.h
51:
1.1.1.3 ! misho 52: iptpinhole.o: iptpinhole.c iptpinhole.h
! 53:
1.1.1.2 misho 54: upnpglobalvars.o: ../upnpglobalvars.c ../upnpglobalvars.h
55: $(CC) -c -o $@ $<
56:
57:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>