4 # GNUMakefile to build the userland part of ipfw on Linux
6 # enable extra debugging information
7 # Do not set with = or := so we can inherit from the caller
8 $(warning Building userland ipfw for $(VER))
10 EXTRA_CFLAGS += -Wall -Werror
11 EXTRA_CFLAGS += -include ../glue.h
12 EXTRA_CFLAGS += -I ./include_e -I ./include
14 ifneq ($(VER),openwrt)
15 OSARCH := $(shell uname)
16 ifeq ($(OSARCH),Linux)
17 EXTRA_CFLAGS += -D__BSD_VISIBLE
19 HAVE_NAT := $(shell grep O_NAT /usr/include/netinet/ip_fw.h)
24 CFLAGS += $(EXTRA_CFLAGS)
25 # Location of OS headers and libraries. After our stuff.
27 CFLAGS += -I$(USRDIR)/include
28 LDFLAGS += -L$(USRDIR)/lib
30 OBJS = ipfw2.o dummynet.o main.o ipv6.o altq.o qsort_r.o
31 OBJS += expand_number.o humanize_number.o
34 EXTRA_CFLAGS += -DHAVE_NAT
42 $(CC) $(LDFLAGS) -o $@ $^
44 $(OBJS) : ipfw2.h ../glue.h include/netinet include_e
46 # support to create empty dirs and files in include_e/
47 # EDIRS is the list of directories, EFILES is the list of files.
51 EFILES = sys/sockio.h libutil.h
56 -@rm -rf $(M)/include_e opt_*
57 -@mkdir -p $(M)/include_e
58 -@(cd $(M)/include_e; mkdir -p $(EDIRS); touch $(EFILES) )
61 -@rm -rf include/netinet
62 -@mkdir -p include/netinet
63 -(cd include/netinet; \
64 for i in ip_fw.h ip_dummynet.h tcp.h; do \
65 ln -s ../../../dummynet2/include/netinet/$$i; done; )
69 -rm -rf include/netinet/