Annotation of embedaddon/miniupnpd/netfilter/Makefile, revision 1.1.1.2

1.1.1.2 ! misho       1: # $Id: Makefile,v 1.3 2011/03/02 16:04:23 nanard Exp $
        !             2: CFLAGS?=-Wall -g -DDEBUG
        !             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
        !            29: TEST := $(shell test -f /usr/include/iptables/internal.h && grep -q "\#define IPTABLES_VERSION" /usr/include/iptables/internal.h && echo 1)
        !            30: ifeq ($(TEST), 1)
        !            31: CFLAGS := $(CFLAGS) -DIPTABLES_143
        !            32: LIBS = -liptc
        !            33: TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1)
        !            34: ifeq ($(TEST_LIB), 1)
        !            35: LIBS = -liptc /usr/lib$(ARCH)/libiptc.a
        !            36: endif
        !            37: endif 
        !            38: endif
1.1       misho      39: 
                     40: all:   iptcrdr.o testiptcrdr
                     41: 
                     42: clean:
                     43:        $(RM) *.o testiptcrdr
                     44: 
1.1.1.2 ! misho      45: testiptcrdr:   testiptcrdr.o iptcrdr.o upnpglobalvars.o $(LIBS)
1.1       misho      46: 
                     47: iptcrdr.o:     iptcrdr.c iptcrdr.h
                     48: 
1.1.1.2 ! misho      49: upnpglobalvars.o:      ../upnpglobalvars.c ../upnpglobalvars.h
        !            50:        $(CC) -c -o $@ $<
        !            51: 
        !            52: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>