Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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:=busybox
  9. PKG_VERSION:=1.17.3
  10. PKG_RELEASE:=2
  11. PKG_FLAGS:=essential
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=http://www.busybox.net/downloads \
  14. http://distfiles.gentoo.org/distfiles/
  15. PKG_MD5SUM:=a2ce1a951571da8c6e0eaf75b1acef60
  16. PKG_BUILD_PARALLEL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. ifeq ($(DUMP),)
  19. STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
  20. endif
  21. init-y :=
  22. init-$(CONFIG_BUSYBOX_CONFIG_HTTPD) += httpd
  23. init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
  24. init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
  25. define Package/busybox
  26. SECTION:=base
  27. CATEGORY:=Base system
  28. MAINTAINER:=Nicolas Thill <[email protected]>
  29. TITLE:=Core utilities for embedded Linux
  30. URL:=http://busybox.net/
  31. MENU:=1
  32. endef
  33. define Package/busybox/description
  34. The Swiss Army Knife of embedded Linux.
  35. It slices, it dices, it makes Julian Fries.
  36. endef
  37. define Package/busybox/config
  38. source "$(SOURCE)/Config.in"
  39. endef
  40. define Build/Configure
  41. rm -f $(PKG_BUILD_DIR)/.configured*
  42. grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
  43. yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
  44. CC="$(TARGET_CC)" \
  45. CROSS_COMPILE="$(TARGET_CROSS)" \
  46. KBUILD_HAVE_NLS=no \
  47. ARCH="$(ARCH)" \
  48. oldconfig
  49. endef
  50. ifdef CONFIG_GCC_VERSION_LLVM
  51. TARGET_CFLAGS += -fnested-functions
  52. endif
  53. ifdef CONFIG_GCC_VERSION_4_5_0
  54. TARGET_CFLAGS += -fno-tree-pta
  55. endif
  56. define Build/Compile
  57. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  58. CC="$(TARGET_CC)" \
  59. CROSS_COMPILE="$(TARGET_CROSS)" \
  60. KBUILD_HAVE_NLS=no \
  61. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  62. ARCH="$(ARCH)" \
  63. SKIP_STRIP=y \
  64. all
  65. rm -rf $(PKG_INSTALL_DIR)
  66. $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
  67. $(MAKE) -C $(PKG_BUILD_DIR) \
  68. CC="$(TARGET_CC)" \
  69. CROSS_COMPILE="$(TARGET_CROSS)" \
  70. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  71. ARCH="$(ARCH)" \
  72. CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
  73. install
  74. endef
  75. define Package/busybox/install
  76. $(INSTALL_DIR) $(1)/etc/init.d
  77. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  78. for tmp in $(init-y); do \
  79. $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
  80. done
  81. -rm -rf $(1)/lib64
  82. endef
  83. $(eval $(call BuildPackage,busybox))