Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #
  2. # Copyright (C) 2006 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # $Id$
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=iproute2
  10. PKG_VERSION:=2.6.25
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=http://devresources.linux-foundation.org/dev/iproute2/download/
  14. PKG_MD5SUM:=5737bade2f5e03fad0e2c81da91e551e
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/iproute2/Default
  18. SECTION:=net
  19. CATEGORY:=Network
  20. URL:=http://linux-net.osdl.org/index.php/Iproute2
  21. endef
  22. define Package/ip
  23. $(call Package/iproute2/Default)
  24. TITLE:=Routing control utility
  25. endef
  26. define Package/tc
  27. $(call Package/iproute2/Default)
  28. TITLE:=Traffic control utility
  29. endef
  30. define Package/genl
  31. $(call Package/iproute2/Default)
  32. TITLE:=General netlink utility frontend
  33. endef
  34. define Build/Configure
  35. $(SED) "s:-O2:${TARGET_CFLAGS}:g" $(PKG_BUILD_DIR)/Makefile
  36. $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
  37. $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
  38. $(PKG_BUILD_DIR)/Makefile
  39. $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
  40. $(PKG_BUILD_DIR)/Makefile
  41. # For now disable compiling of the misc directory because it seems to fail
  42. rm -rf $(PKG_BUILD_DIR)/misc
  43. $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
  44. endef
  45. define Build/Compile
  46. $(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
  47. $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include all tc/tc ip/ip
  48. endef
  49. define Package/ip/install
  50. $(INSTALL_DIR) $(1)/usr/sbin
  51. $(INSTALL_DIR) $(1)/etc/iproute2
  52. $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
  53. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  54. endef
  55. define Package/tc/install
  56. $(INSTALL_DIR) $(1)/usr/sbin
  57. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  58. endef
  59. define Package/genl/install
  60. $(INSTALL_DIR) $(1)/usr/sbin
  61. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  62. endef
  63. $(eval $(call BuildPackage,ip))
  64. $(eval $(call BuildPackage,tc))
  65. $(eval $(call BuildPackage,genl))
  66. $(eval $(call RequireCommand,bison, \
  67. $(PKG_NAME) requires GNU bison. \
  68. ))