tools/bison: update to version 2.4.3
[openwrt.git] / package / iproute2 / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=iproute2
11 PKG_VERSION:=2.6.35
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://devresources.linux-foundation.org/dev/iproute2/download/
16 PKG_MD5SUM:=b0f281b3124bf04669e18f5fe16d4934
17 PKG_BUILD_PARALLEL:=1
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/iproute2/Default
24 SECTION:=net
25 CATEGORY:=Network
26 URL:=http://linux-net.osdl.org/index.php/Iproute2
27 endef
28
29 define Package/ip
30 $(call Package/iproute2/Default)
31 TITLE:=Routing control utility
32 endef
33
34 define Package/ip/conffiles
35 /etc/iproute2/rt_tables
36 endef
37
38 define Package/tc
39 $(call Package/iproute2/Default)
40 TITLE:=Traffic control utility
41 DEPENDS:=+kmod-sched
42 endef
43
44 define Package/genl
45 $(call Package/iproute2/Default)
46 TITLE:=General netlink utility frontend
47 endef
48
49 define Build/Configure
50 $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
51 $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
52 $(PKG_BUILD_DIR)/Makefile
53 $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
54 $(PKG_BUILD_DIR)/Makefile
55 # For now disable compiling of the misc directory because it seems to fail
56 rm -rf $(PKG_BUILD_DIR)/misc
57 $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
58 echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
59 > $(PKG_BUILD_DIR)/include/SNAPSHOT.h
60 endef
61
62 MAKE_FLAGS += \
63 EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
64 KERNEL_INCLUDE="$(LINUX_DIR)/include" \
65 FPIC="$(FPIC)"
66
67 define Build/Compile
68 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/netem \
69 HOSTCC="$(HOSTCC)" EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
70 CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall \
71 -I../include -DRESOLVE_HOSTNAMES"
72 $(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) all
73 $(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/tc $(MAKE_FLAGS) tc
74 $(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/ip $(MAKE_FLAGS) ip
75 endef
76
77 define Build/InstallDev
78 $(INSTALL_DIR) $(1)/usr/include
79 $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
82 endef
83
84 define Package/ip/install
85 $(INSTALL_DIR) $(1)/usr/sbin
86 $(INSTALL_DIR) $(1)/etc/iproute2
87 $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
88 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
89 endef
90
91 define Package/tc/install
92 $(INSTALL_DIR) $(1)/usr/sbin
93 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
94 endef
95
96 define Package/genl/install
97 $(INSTALL_DIR) $(1)/usr/sbin
98 $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
99 endef
100
101 $(eval $(call BuildPackage,ip))
102 $(eval $(call BuildPackage,tc))
103 $(eval $(call BuildPackage,genl))
This page took 0.047434 seconds and 5 git commands to generate.