add pptp client
[openwrt.git] / package / iproute2 / Makefile
1 #############################################################
2 #
3 # iproute2
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 $(IPKG_STATE_DIR)/info/ip.list: $(PKG_IP)
57 $(IPKG) install $(PKG_IP)
58
59 $(PKG_TC): $(PKG_BUILD_DIR)/tc/tc $(PACKAGE_DIR)
60 $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_TC_DIR) tc.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
61 mkdir -p $(PKG_TC_DIR)/usr/sbin
62 cp $< $(PKG_TC_DIR)/usr/sbin/
63 $(STRIP) $(PKG_TC_DIR)/usr/sbin/*
64 $(IPKG_BUILD) $(PKG_TC_DIR) $(PACKAGE_DIR)
65
66 $(IPKG_STATE_DIR)/info/tc.list: $(PKG_TC)
67 $(IPKG) install $(PKG_TC)
68
69 $(PACKAGE_DIR):
70 mkdir -p $(PACKAGE_DIR)
71
72 TARGETS:=
73 ifneq ($(BR2_PACKAGE_IPROUTE2_IP),)
74 TARGETS += $(PKG_IP)
75 endif
76 ifneq ($(BR2_PACKAGE_IPROUTE2_TC),)
77 TARGETS += $(PKG_TC)
78 endif
79
80 ifeq ($(BR2_PACKAGE_IPROUTE2_IP),y)
81 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ip.list
82 endif
83 ifeq ($(BR2_PACKAGE_IPROUTE2_TC),y)
84 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/tc.list
85 endif
86
87 source: $(DL_DIR)/$(PKG_SOURCE)
88 prepare: $(PKG_BUILD_DIR)/.patched
89 compile: $(TARGETS)
90 install: $(INSTALL_TARGETS)
91
92 clean:
93 rm -rf $(PKG_BUILD_DIR)
94 rm -f $(PKG_IP) $(PKG_TC)
This page took 0.046229 seconds and 5 git commands to generate.