Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=iproute2
  9. PKG_VERSION:=2.6.29-1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://devresources.linux-foundation.org/dev/iproute2/download/
  13. PKG_MD5SUM:=c1bc258a6c345905e79935ac7a3cc582
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/iproute2/Default
  17. SECTION:=net
  18. CATEGORY:=Network
  19. URL:=http://linux-net.osdl.org/index.php/Iproute2
  20. endef
  21. define Package/ip
  22. $(call Package/iproute2/Default)
  23. TITLE:=Routing control utility
  24. endef
  25. define Package/tc
  26. $(call Package/iproute2/Default)
  27. TITLE:=Traffic control utility
  28. endef
  29. define Package/genl
  30. $(call Package/iproute2/Default)
  31. TITLE:=General netlink utility frontend
  32. endef
  33. define Build/Configure
  34. $(SED) "s:-O2:${TARGET_CFLAGS}:g" $(PKG_BUILD_DIR)/Makefile
  35. $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
  36. $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
  37. $(PKG_BUILD_DIR)/Makefile
  38. $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
  39. $(PKG_BUILD_DIR)/Makefile
  40. # For now disable compiling of the misc directory because it seems to fail
  41. rm -rf $(PKG_BUILD_DIR)/misc
  42. $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
  43. endef
  44. define Build/Compile
  45. $(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
  46. $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include all tc/tc ip/ip
  47. endef
  48. define Build/InstallDev
  49. $(INSTALL_DIR) $(1)/usr/include
  50. $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
  51. $(INSTALL_DIR) $(1)/usr/lib
  52. $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
  53. endef
  54. define Package/ip/install
  55. $(INSTALL_DIR) $(1)/usr/sbin
  56. $(INSTALL_DIR) $(1)/etc/iproute2
  57. $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
  58. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  59. endef
  60. define Package/tc/install
  61. $(INSTALL_DIR) $(1)/usr/sbin
  62. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  63. endef
  64. define Package/genl/install
  65. $(INSTALL_DIR) $(1)/usr/sbin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  67. endef
  68. $(eval $(call BuildPackage,ip))
  69. $(eval $(call BuildPackage,tc))
  70. $(eval $(call BuildPackage,genl))