Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=iproute2
  9. PKG_VERSION:=2.6.29-1
  10. PKG_RELEASE:=2
  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. DEPENDS:=+kmod-sched
  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,-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. MAKE_FLAGS += \
  45. EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
  46. KERNEL_INCLUDE="$(LINUX_DIR)/include" \
  47. FPIC="$(FPIC)" \
  48. all tc/tc ip/ip
  49. define Build/Compile
  50. $(_SINGLE)$(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" EXTRA_CCOPTS="$(TARGET_CFLAGS)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
  51. $(_SINGLE)$(Build/Compile/Default)
  52. endef
  53. define Build/InstallDev
  54. $(INSTALL_DIR) $(1)/usr/include
  55. $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
  56. $(INSTALL_DIR) $(1)/usr/lib
  57. $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
  58. endef
  59. define Package/ip/install
  60. $(INSTALL_DIR) $(1)/usr/sbin
  61. $(INSTALL_DIR) $(1)/etc/iproute2
  62. $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
  63. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  64. endef
  65. define Package/tc/install
  66. $(INSTALL_DIR) $(1)/usr/sbin
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  68. endef
  69. define Package/genl/install
  70. $(INSTALL_DIR) $(1)/usr/sbin
  71. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  72. endef
  73. $(eval $(call BuildPackage,ip))
  74. $(eval $(call BuildPackage,tc))
  75. $(eval $(call BuildPackage,genl))