2 # Copyright (C) 2006-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=http
://www.busybox.net
/downloads \
17 http
://distfiles.gentoo.org
/distfiles
/
18 PKG_MD5SUM
:=337d1a15ab1cb1d4ed423168b1eb7d7e
20 PKG_BUILD_DEPENDS
:=BUSYBOX_USE_LIBRPC
:librpc
23 PKG_LICENSE
:=GPLv2 BSD-4c
24 PKG_LICENSE_FILES
:=LICENSE archival
/libarchive
/bz
/LICENSE
26 include $(INCLUDE_DIR
)/package.mk
29 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell $(SH_FUNC
) grep
'^CONFIG_BUSYBOX_' $(TOPDIR
)/.config | md5s
)
32 ifneq ($(findstring c
,$(OPENWRT_VERBOSE
)),)
33 BB_MAKE_VERBOSE
:= V
=1
38 define Package
/busybox
41 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
42 TITLE
:=Core utilities for embedded Linux
43 URL
:=http
://busybox.net
/
44 DEPENDS
:=+BUSYBOX_USE_LIBRPC
:librpc
48 define Package
/busybox
/description
49 The Swiss Army Knife of embedded Linux.
50 It slices
, it dices
, it makes Julian Fries.
53 define Package
/busybox
/config
54 source
"$(SOURCE)/Config.in"
57 BUSYBOX_SYM
=$(if
$(CONFIG_BUSYBOX_CUSTOM
),CONFIG
,DEFAULT
)
59 define Build
/Configure
60 rm -f
$(PKG_BUILD_DIR
)/.configured
*
61 grep
'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR
)/.config | sed
-e
"s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR
)/.config
62 yes
'n' |
$(MAKE
) -C
$(PKG_BUILD_DIR
) \
64 CROSS_COMPILE
="$(TARGET_CROSS)" \
71 ifdef CONFIG_GCC_VERSION_LLVM
72 TARGET_CFLAGS
+= -fnested-functions
76 ifdef CONFIG_BUSYBOX_USE_LIBRPC
77 TARGET_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include
78 export LDFLAGS
=$(TARGET_LDFLAGS
)
83 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
85 CROSS_COMPILE
="$(TARGET_CROSS)" \
87 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" \
93 rm -rf
$(PKG_INSTALL_DIR
)
94 $(FIND
) $(PKG_BUILD_DIR
) -lname
"*busybox" -exec
rm \
{\
} \
;
95 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
97 CROSS_COMPILE
="$(TARGET_CROSS)" \
98 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" \
100 CONFIG_PREFIX
="$(PKG_INSTALL_DIR)" \
106 define Package
/busybox
/install
107 $(INSTALL_DIR
) $(1)/etc
/init.d
108 $(CP
) $(PKG_INSTALL_DIR
)/* $(1)/
109 $(INSTALL_BIN
) .
/files
/cron
$(1)/etc
/init.d
/cron
110 $(INSTALL_BIN
) .
/files
/telnet
$(1)/etc
/init.d
/telnet
111 $(INSTALL_BIN
) .
/files
/sysntpd
$(1)/etc
/init.d
/sysntpd
115 $(eval
$(call BuildPackage
,busybox
))