unlock linux partition in mount_root
[openwrt.git] / obsolete-buildroot / make / iptables.mk
1 #############################################################
2 #
3 # iptables
4 #
5 #############################################################
6 IPTABLES_SOURCE_URL=http://www.netfilter.org/files
7 IPTABLES_SOURCE=iptables-1.2.11.tar.bz2
8 IPTABLES_BUILD_DIR=$(BUILD_DIR)/iptables-1.2.11
9 IP6TABLES_IPK=$(BUILD_DIR)/ip6tables_1.2.11-1_mipsel.ipk
10 IP6TABLES_IPK_DIR:=$(BUILD_DIR)/ip6tables-1.2.11-ipk
11
12 $(DL_DIR)/$(IPTABLES_SOURCE):
13 $(WGET) -P $(DL_DIR) $(IPTABLES_SOURCE_URL)/$(IPTABLES_SOURCE)
14
15 $(IPTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(IPTABLES_SOURCE)
16 bzcat $(DL_DIR)/$(IPTABLES_SOURCE) | tar -C $(BUILD_DIR) -xvf -
17 touch $(IPTABLES_BUILD_DIR)/.unpacked
18
19 $(IPTABLES_BUILD_DIR)/.configured: $(IPTABLES_BUILD_DIR)/.unpacked
20 # Allow patches. Needed for openwrt for instance.
21 $(SOURCE_DIR)/patch-kernel.sh $(IPTABLES_BUILD_DIR) $(SOURCE_DIR) iptables-*.patch
22 #
23 $(SED) "s;\[ -f /usr/include/netinet/ip6.h \];grep -q '__UCLIBC_HAS_IPV6__ 1' \
24 $(BUILD_DIR)/uClibc-0.9.27/include/bits/uClibc_config.h;" $(IPTABLES_BUILD_DIR)/Makefile
25 touch $(IPTABLES_BUILD_DIR)/.configured
26
27 $(IPTABLES_BUILD_DIR)/iptables: $(IPTABLES_BUILD_DIR)/.configured
28 $(TARGET_CONFIGURE_OPTS) \
29 $(MAKE) -C $(IPTABLES_BUILD_DIR) \
30 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
31 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)"
32
33 $(TARGET_DIR)/sbin/iptables: $(IPTABLES_BUILD_DIR)/iptables
34 $(TARGET_CONFIGURE_OPTS) \
35 $(MAKE) -C $(IPTABLES_BUILD_DIR) \
36 KERNEL_DIR=$(LINUX_DIR) PREFIX=/usr \
37 CC=$(TARGET_CC) COPT_FLAGS="$(TARGET_CFLAGS)" \
38 DESTDIR=$(TARGET_DIR) install
39 $(STRIP) $(TARGET_DIR)/usr/sbin/iptables*
40 $(STRIP) $(TARGET_DIR)/usr/sbin/ip6tables*
41 $(STRIP) $(TARGET_DIR)/usr/lib/iptables/*.so
42 rm -rf $(TARGET_DIR)/usr/man
43
44 iptables: $(TARGET_DIR)/sbin/iptables
45
46 $(IP6TABLES_IPK):
47 mkdir -p $(IP6TABLES_IPK_DIR)/CONTROL
48 mkdir -p $(IP6TABLES_IPK_DIR)/usr/lib/iptables
49 mkdir -p $(IP6TABLES_IPK_DIR)/usr/sbin
50 install -m 644 $(OPENWRT_IPK_DIR)/ip6tables/ip6tables.control $(IP6TABLES_IPK_DIR)/CONTROL/control
51 install -m 755 $(IPTABLES_BUILD_DIR)/ip6tables $(IP6TABLES_IPK_DIR)/usr/sbin
52 install -m 755 $(IPTABLES_BUILD_DIR)/extensions/libip6t_*.so $(IP6TABLES_IPK_DIR)/usr/lib/iptables/
53 $(STRIP) $(IP6TABLES_IPK_DIR)/usr/sbin/ip6tables*
54 $(STRIP) $(IP6TABLES_IPK_DIR)/usr/lib/iptables/*.so
55 cd $(BUILD_DIR); $(STAGING_DIR)/bin/ipkg-build -c -o root -g root $(IP6TABLES_IPK_DIR)
56
57 ip6tables-ipk: iptables $(IP6TABLES_IPK)
58
59 iptables-source: $(DL_DIR)/$(IPTABLES_SOURCE)
60
61 iptables-clean:
62 $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(IPTABLES_BUILD_DIR) uninstall
63 -$(MAKE) -C $(IPTABLES_BUILD_DIR) clean
64
65 iptables-dirclean:
66 rm -rf $(IPTABLES_BUILD_DIR)
67
This page took 0.056894 seconds and 5 git commands to generate.