Makefile 2.2 KB

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