nbd's makefile/menuconfig rewrite
[openwrt.git] / package / iproute2 / Makefile
1 #############################################################
2 #
3 # ebtables
4 #
5 #############################################################
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=iproute2
9 PKG_VERSION:=2.6.9
10 PKG_RELEASE:=1
11 PKG_SOURCE_URL:=http://developer.osdl.org/dev/iproute2/download/
12 PKG_SOURCE:=$(PKG_NAME)-2.6.9-041019.tar.gz
13 PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-2.6.9
14 PKG_CAT:=zcat
15
16 PKG_IP:=$(PACKAGE_DIR)/ip_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 PKG_IP_DIR:=$(PKG_BUILD_DIR)/ipkg/ip
18
19 PKG_TC:=$(PACKAGE_DIR)/tc_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
20 PKG_TC_DIR:=$(PKG_BUILD_DIR)/ipkg/tc
21
22 $(DL_DIR)/$(PKG_SOURCE):
23 $(WGET) -P $(DL_DIR) $(PKG_SOURCE_URL)/$(PKG_SOURCE)
24
25 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE)
26 $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
27 $(PATCH) $(PKG_BUILD_DIR) ./patches
28 $(SED) "s:-O2:${TARGET_CFLAGS}:g" $(PKG_BUILD_DIR)/Makefile
29 touch $(PKG_BUILD_DIR)/.patched
30
31 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
32 $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
33 $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
34 $(PKG_BUILD_DIR)/Makefile
35 $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
36 $(PKG_BUILD_DIR)/Makefile
37 # For now disable compiling of the misc directory because it seems to fail
38 rm -rf $(PKG_BUILD_DIR)/misc
39 $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
40 touch $(PKG_BUILD_DIR)/.configured
41
42 $(PKG_BUILD_DIR)/tc/tc: $(PKG_BUILD_DIR)/.configured
43 $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include all tc/tc
44
45 $(PKG_BUILD_DIR)/ip/ip: $(PKG_BUILD_DIR)/.configured
46 $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include all ip/ip
47
48
49 $(PKG_IP): $(PKG_BUILD_DIR)/ip/ip $(PACKAGE_DIR)
50 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IP_DIR) ip.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
51 mkdir -p $(PKG_IP_DIR)/usr/sbin
52 cp $< $(PKG_IP_DIR)/usr/sbin/
53 $(STRIP) $(PKG_IP_DIR)/usr/sbin/*
54 $(IPKG_BUILD) $(PKG_IP_DIR) $(PACKAGE_DIR)
55
56 $(PKG_TC): $(PKG_BUILD_DIR)/tc/tc $(PACKAGE_DIR)
57 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_TC_DIR) tc.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
58 mkdir -p $(PKG_TC_DIR)/usr/sbin
59 cp $< $(PKG_TC_DIR)/usr/sbin/
60 $(STRIP) $(PKG_TC_DIR)/usr/sbin/*
61 $(IPKG_BUILD) $(PKG_TC_DIR) $(PACKAGE_DIR)
62
63 $(PACKAGE_DIR):
64 mkdir -p $(PACKAGE_DIR)
65
66 TARGETS:=
67 ifneq ($(BR2_PACKAGE_IPROUTE2_IP),)
68 TARGETS += $(PKG_IP)
69 endif
70 ifneq ($(BR2_PACKAGE_IPROUTE2_TC),)
71 TARGETS += $(PKG_TC)
72 endif
73
74 source: $(DL_DIR)/$(PKG_SOURCE)
75 prepare: $(PKG_BUILD_DIR)/.patched
76 compile: $(TARGETS)
77 install:
78 ifeq ($(BR2_PACKAGE_IPROUTE2_IP),y)
79 $(IPKG) install $(PKG_IP)
80 endif
81 ifeq ($(BR2_PACKAGE_IPROUTE2_TC),y)
82 $(IPKG) install $(PKG_TC)
83 endif
84
85
86 clean:
87 rm -rf $(PKG_BUILD_DIR)
This page took 0.042174 seconds and 5 git commands to generate.