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