Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #
  2. # Copyright (C) 2006-2016 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.27.2
  10. PKG_RELEASE:=3
  11. PKG_FLAGS:=essential
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=https://www.busybox.net/downloads \
  14. http://sources.buildroot.net
  15. PKG_HASH:=9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df
  16. PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_CHECK_FORMAT_SECURITY:=0
  19. PKG_INSTALL:=1
  20. PKG_LICENSE:=GPL-2.0
  21. PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
  22. PKG_CPE_ID:=cpe:/a:busybox:busybox
  23. include $(INCLUDE_DIR)/package.mk
  24. ifeq ($(DUMP),)
  25. STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | mkhash md5)
  26. endif
  27. BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT)
  28. BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2))
  29. define Package/busybox
  30. SECTION:=base
  31. CATEGORY:=Base system
  32. MAINTAINER:=Felix Fietkau <[email protected]>
  33. TITLE:=Core utilities for embedded Linux
  34. URL:=http://busybox.net/
  35. DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter
  36. MENU:=1
  37. PROVIDES:=ip
  38. ALTERNATIVES:=\
  39. $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \
  40. $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \
  41. $(call BUSYBOX_IF_ENABLED,WATCH, 100:/bin/watch:/bin/busybox) \
  42. $(call BUSYBOX_IF_ENABLED,IP, 100:/sbin/ip:/bin/busybox) \
  43. $(call BUSYBOX_IF_ENABLED,FREE, 100:/usr/bin/free:/bin/busybox) \
  44. $(call BUSYBOX_IF_ENABLED,PGREP, 100:/usr/bin/pgrep:/bin/busybox) \
  45. $(call BUSYBOX_IF_ENABLED,PKILL, 100:/usr/bin/pkill:/bin/busybox) \
  46. $(call BUSYBOX_IF_ENABLED,PMAP, 100:/usr/bin/pmap:/bin/busybox) \
  47. $(call BUSYBOX_IF_ENABLED,PWDX, 100:/usr/bin/pwdx:/bin/busybox) \
  48. $(call BUSYBOX_IF_ENABLED,TOP, 100:/usr/bin/top:/bin/busybox) \
  49. $(call BUSYBOX_IF_ENABLED,UPTIME, 100:/usr/bin/uptime:/bin/busybox) \
  50. endef
  51. define Package/busybox/description
  52. The Swiss Army Knife of embedded Linux.
  53. It slices, it dices, it makes Julian Fries.
  54. endef
  55. define Package/busybox/config
  56. source "$(SOURCE)/Config.in"
  57. endef
  58. # don't create a version string containing the actual timestamp
  59. export KCONFIG_NOTIMESTAMP=1
  60. LDLIBS:=m crypt
  61. LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread)
  62. ifdef CONFIG_BUSYBOX_USE_LIBRPC
  63. LDLIBS += rpc
  64. endif
  65. ifeq ($(CONFIG_USE_GLIBC),y)
  66. LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP_OPENWRT,resolv)
  67. endif
  68. MAKE_VARS :=
  69. MAKE_FLAGS += \
  70. EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  71. EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  72. LDLIBS="$(LDLIBS)" \
  73. SKIP_STRIP=y
  74. ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
  75. MAKE_FLAGS += V=1
  76. endif
  77. MAKE_INSTALL_FLAGS += CONFIG_PREFIX="$(PKG_INSTALL_DIR)"
  78. define Build/Configure
  79. grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config
  80. yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) oldconfig
  81. endef
  82. define Package/busybox/install
  83. $(INSTALL_DIR) $(1)/etc/init.d
  84. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  85. ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_CROND),)
  86. $(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
  87. endif
  88. ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_NTPD),)
  89. $(INSTALL_BIN) ./files/sysntpd $(1)/etc/init.d/sysntpd
  90. $(INSTALL_BIN) ./files/ntpd-hotplug $(1)/usr/sbin/ntpd-hotplug
  91. endif
  92. -rm -rf $(1)/lib64
  93. endef
  94. $(eval $(call BuildPackage,busybox))