Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
  35. $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
  36. $(PKG_BUILD_DIR)/Makefile
  37. $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
  38. $(PKG_BUILD_DIR)/Makefile
  39. # For now disable compiling of the misc directory because it seems to fail
  40. rm -rf $(PKG_BUILD_DIR)/misc
  41. $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
  42. endef
  43. MAKE_FLAGS += \
  44. EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
  45. KERNEL_INCLUDE="$(LINUX_DIR)/include" \
  46. FPIC="$(FPIC)" \
  47. all tc/tc ip/ip
  48. define Build/Compile
  49. $(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" EXTRA_CCOPTS="$(TARGET_CFLAGS)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
  50. $(Build/Compile/Default)
  51. endef
  52. define Build/InstallDev
  53. $(INSTALL_DIR) $(1)/usr/include
  54. $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
  55. $(INSTALL_DIR) $(1)/usr/lib
  56. $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
  57. endef
  58. define Package/ip/install
  59. $(INSTALL_DIR) $(1)/usr/sbin
  60. $(INSTALL_DIR) $(1)/etc/iproute2
  61. $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
  62. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  63. endef
  64. define Package/tc/install
  65. $(INSTALL_DIR) $(1)/usr/sbin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  67. endef
  68. define Package/genl/install
  69. $(INSTALL_DIR) $(1)/usr/sbin
  70. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  71. endef
  72. $(eval $(call BuildPackage,ip))
  73. $(eval $(call BuildPackage,tc))
  74. $(eval $(call BuildPackage,genl))