Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. rm -rf $(PKG_INSTALL_DIR)
  61. $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
  62. $(MAKE) -C $(PKG_BUILD_DIR) \
  63. CC="$(TARGET_CC)" \
  64. CROSS_COMPILE="$(TARGET_CROSS)" \
  65. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  66. ARCH="$(ARCH)" \
  67. IPKG_ARCH="$(ARCH)" \
  68. CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
  69. install
  70. endef
  71. define Package/busybox/install
  72. $(INSTALL_DIR) $(1)/etc/init.d
  73. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  74. for tmp in $(init-y); do \
  75. $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
  76. done
  77. -rm -rf $(1)/lib64
  78. endef
  79. $(eval $(call BuildPackage,busybox))