Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.15-060110
  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:=04f57a6d366d36426d276178b600f5c5
  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 Build/Configure
  30. $(SED) "s:-O2:${TARGET_CFLAGS}:g" $(PKG_BUILD_DIR)/Makefile
  31. $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
  32. $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
  33. $(PKG_BUILD_DIR)/Makefile
  34. $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
  35. $(PKG_BUILD_DIR)/Makefile
  36. # For now disable compiling of the misc directory because it seems to fail
  37. rm -rf $(PKG_BUILD_DIR)/misc
  38. $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
  39. endef
  40. define Build/Compile
  41. $(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
  42. $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) KERNEL_INCLUDE=$(LINUX_DIR)/include all tc/tc ip/ip
  43. endef
  44. define Package/ip/install
  45. $(INSTALL_DIR) $(1)/usr/sbin
  46. $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
  47. endef
  48. define Package/tc/install
  49. $(INSTALL_DIR) $(1)/usr/sbin
  50. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
  51. endef
  52. $(eval $(call BuildPackage,ip))
  53. $(eval $(call BuildPackage,tc))
  54. $(eval $(call RequireCommand,bison, \
  55. $(PKG_NAME) requires GNU bison. \
  56. ))