Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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.20-070313
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=http://developer.osdl.org/dev/iproute2/download/
  14. PKG_MD5SUM:=7bc5883aadf740761fa2dd70b661e8cc
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/iproute-$(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_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  52. endef
  53. define Package/tc/install
  54. $(INSTALL_DIR) $(1)/usr/sbin
  55. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  56. endef
  57. define Package/genl/install
  58. $(INSTALL_DIR) $(1)/usr/sbin
  59. $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
  60. endef
  61. $(eval $(call BuildPackage,ip))
  62. $(eval $(call BuildPackage,tc))
  63. $(eval $(call BuildPackage,genl))
  64. $(eval $(call RequireCommand,bison, \
  65. $(PKG_NAME) requires GNU bison. \
  66. ))