blob: 2e10be342c2c251b87183b47a0e4e3870e90d7f3 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# Configure options.
2include $(COMMON_MK)
3
4CFLAGS += -O1
5
6PATH := $(PATH):${CROSS_ROOT}/usr/bin
7
8CONFOPTS = --prefix= --disable-shared --enable-static
9
10ifdef CONFIG_USER_IPTABLES_IPTABLES
11CONFOPTS += --enable-ipv4
12else
13CONFOPTS += --disable-ipv4
14endif
15
16ifdef CONFIG_USER_IPTABLES_IP6TABLES
17CONFOPTS += --enable-ipv6
18else
19CONFOPTS += --disable-ipv6
20endif
21
22ifdef CONFIG_IP_NF_QUEUE
23CONFOPTS += --enable-libipq
24endif
25
26
27all: build/build
28 $(MAKE) -C build am__configure_deps= am__aclocal_m4_deps=
29 $(MAKE) -C build install DESTDIR=`pwd`/install am__configure_deps= am__aclocal_m4_deps=
30
31build/build: makefile
32 @chmod u+x configure
33 @rm -rf build install
34 @mkdir build install
35 (cd build; sh ../configure CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(CONFIGURE_OPTS) $(CONFOPTS))
36 @touch build/build
37
38clean:
39 rm -rf build install
40
41romfs:
42 $(ROMFSINST) -e CONFIG_USER_IPTABLES_IPTABLES build/iptables-static /bin/iptables
43 $(ROMFSINST) -e CONFIG_USER_IPTABLES_IPTABLES -s iptables /bin/iptables-save
44 $(ROMFSINST) -e CONFIG_USER_IPTABLES_IPTABLES -s iptables /bin/iptables-restore
45 $(ROMFSINST) -e CONFIG_USER_IPTABLES_IP6TABLES build/ip6tables-static /bin/ip6tables
46 $(ROMFSINST) -e CONFIG_USER_IPTABLES_IP6TABLES -s ip6tables /bin/ip6tables-save
47 $(ROMFSINST) -e CONFIG_USER_IPTABLES_IP6TABLES -s ip6tables /bin/ip6tables-restore