Makefile 2.2 KB

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