Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #
  2. # Copyright (C) 2006-2012 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.19.4
  10. PKG_RELEASE:=5
  11. PKG_FLAGS:=essential
  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:=9c0cae5a0379228e7b55e5b29528df8e
  16. PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_FEATURE_HAVE_RPC:librpc
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_LICENSE:=GPLv2 BSD-4c
  19. PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
  20. include $(INCLUDE_DIR)/package.mk
  21. ifeq ($(DUMP),)
  22. STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell $(SH_FUNC) grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
  23. endif
  24. ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
  25. BB_MAKE_VERBOSE := V=1
  26. else
  27. BB_MAKE_VERBOSE :=
  28. endif
  29. init-y :=
  30. init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
  31. init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
  32. define Package/busybox
  33. SECTION:=base
  34. CATEGORY:=Base system
  35. MAINTAINER:=Nicolas Thill <[email protected]>
  36. TITLE:=Core utilities for embedded Linux
  37. URL:=http://busybox.net/
  38. DEPENDS:=+BUSYBOX_CONFIG_FEATURE_HAVE_RPC:librpc
  39. MENU:=1
  40. endef
  41. define Package/busybox/description
  42. The Swiss Army Knife of embedded Linux.
  43. It slices, it dices, it makes Julian Fries.
  44. endef
  45. define Package/busybox/config
  46. source "$(SOURCE)/Config.in"
  47. endef
  48. define Build/Configure
  49. rm -f $(PKG_BUILD_DIR)/.configured*
  50. grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
  51. yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
  52. CC="$(TARGET_CC)" \
  53. CROSS_COMPILE="$(TARGET_CROSS)" \
  54. KBUILD_HAVE_NLS=no \
  55. ARCH="$(ARCH)" \
  56. $(BB_MAKE_VERBOSE) \
  57. oldconfig
  58. endef
  59. ifdef CONFIG_GCC_VERSION_LLVM
  60. TARGET_CFLAGS += -fnested-functions
  61. endif
  62. LDLIBS:=m crypt
  63. ifdef CONFIG_BUSYBOX_CONFIG_FEATURE_HAVE_RPC
  64. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  65. export LDFLAGS=$(TARGET_LDFLAGS)
  66. LDLIBS += rpc
  67. endif
  68. define Build/Compile
  69. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  70. CC="$(TARGET_CC)" \
  71. CROSS_COMPILE="$(TARGET_CROSS)" \
  72. KBUILD_HAVE_NLS=no \
  73. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  74. ARCH="$(ARCH)" \
  75. SKIP_STRIP=y \
  76. LDLIBS="$(LDLIBS)" \
  77. $(BB_MAKE_VERBOSE) \
  78. all
  79. rm -rf $(PKG_INSTALL_DIR)
  80. $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
  81. $(MAKE) -C $(PKG_BUILD_DIR) \
  82. CC="$(TARGET_CC)" \
  83. CROSS_COMPILE="$(TARGET_CROSS)" \
  84. EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
  85. ARCH="$(ARCH)" \
  86. CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
  87. LDLIBS="$(LDLIBS)" \
  88. $(BB_MAKE_VERBOSE) \
  89. install
  90. endef
  91. define Package/busybox/install
  92. $(INSTALL_DIR) $(1)/etc/init.d
  93. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  94. for tmp in $(init-y); do \
  95. $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
  96. done
  97. -rm -rf $(1)/lib64
  98. endef
  99. $(eval $(call BuildPackage,busybox))