Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.25
  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:=5737bade2f5e03fad0e2c81da91e551e
  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 Package/ip/install
  49. $(INSTALL_DIR) $(1)/usr/sbin
  50. $(INSTALL_DIR) $(1)/etc/iproute2
  51. $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
  52. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  53. endef
  54. define Package/tc/install
  55. $(INSTALL_DIR) $(1)/usr/sbin
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  57. endef
  58. define Package/genl/install
  59. $(INSTALL_DIR) $(1)/usr/sbin
  60. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  61. endef
  62. $(eval $(call BuildPackage,ip))
  63. $(eval $(call BuildPackage,tc))
  64. $(eval $(call BuildPackage,genl))
  65. $(eval $(call RequireCommand,bison, \
  66. $(PKG_NAME) requires GNU bison. \
  67. ))