Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.2
  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:=7360b7138b899ee7fc885791c740c3c3
  15. PKG_BUILD_PARALLEL:=1
  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. MAINTAINER:=Nicolas Thill <[email protected]>
  28. TITLE:=Core utilities for embedded Linux
  29. URL:=http://busybox.net/
  30. MENU:=1
  31. endef
  32. define Package/busybox/description
  33. The Swiss Army Knife of embedded Linux.
  34. It slices, it dices, it makes Julian Fries.
  35. endef
  36. define Package/busybox/config
  37. source "$(SOURCE)/Config.in"
  38. endef
  39. define Build/Configure
  40. rm -f $(PKG_BUILD_DIR)/.configured*
  41. grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
  42. yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
  43. CC="$(TARGET_CC)" \
  44. CROSS_COMPILE="$(TARGET_CROSS)" \
  45. KBUILD_HAVE_NLS=no \
  46. ARCH="$(ARCH)" \
  47. oldconfig
  48. endef
  49. ifdef CONFIG_GCC_VERSION_LLVM
  50. TARGET_CFLAGS += -fnested-functions
  51. endif
  52. ifdef CONFIG_GCC_VERSION_4_5_0
  53. TARGET_CFLAGS += -fno-tree-pta
  54. endif
  55. define Build/Compile
  56. $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  57. CC="$(TARGET_CC)" \
  58. CROSS_COMPILE="$(TARGET_CROSS)" \
  59. KBUILD_HAVE_NLS=no \
  60. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  61. ARCH="$(ARCH)" \
  62. SKIP_STRIP=y \
  63. all
  64. rm -rf $(PKG_INSTALL_DIR)
  65. $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
  66. $(MAKE) -C $(PKG_BUILD_DIR) \
  67. CC="$(TARGET_CC)" \
  68. CROSS_COMPILE="$(TARGET_CROSS)" \
  69. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  70. ARCH="$(ARCH)" \
  71. CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
  72. install
  73. endef
  74. define Package/busybox/install
  75. $(INSTALL_DIR) $(1)/etc/init.d
  76. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  77. for tmp in $(init-y); do \
  78. $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
  79. done
  80. -rm -rf $(1)/lib64
  81. endef
  82. $(eval $(call BuildPackage,busybox))