Makefile 2.3 KB

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