2 # Copyright (C) 2006-2012 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
:=9c0cae5a0379228e7b55e5b29528df8e
20 PKG_BUILD_DEPENDS
:=BUSYBOX_USE_LIBRPC
:librpc
23 include $(INCLUDE_DIR
)/package.mk
26 STAMP_CONFIGURED
:=$(strip $(STAMP_CONFIGURED
))_
$(shell $(SH_FUNC
) grep
'^CONFIG_BUSYBOX_' $(TOPDIR
)/.config | md5s
)
30 init-
$(CONFIG_BUSYBOX_CONFIG_HTTPD
) += httpd
31 init-
$(CONFIG_BUSYBOX_CONFIG_CROND
) += cron
32 init-
$(CONFIG_BUSYBOX_CONFIG_TELNETD
) += telnet
34 define Package
/busybox
37 MAINTAINER
:=Nicolas Thill
<nico@openwrt.org
>
38 TITLE
:=Core utilities for embedded Linux
39 URL
:=http
://busybox.net
/
40 DEPENDS
:=+BUSYBOX_USE_LIBRPC
:librpc
44 define Package
/busybox
/description
45 The Swiss Army Knife of embedded Linux.
46 It slices
, it dices
, it makes Julian Fries.
49 define Package
/busybox
/config
50 source
"$(SOURCE)/Config.in"
53 define Build
/Configure
54 rm -f
$(PKG_BUILD_DIR
)/.configured
*
55 grep
'CONFIG_BUSYBOX_' $(TOPDIR
)/.config | sed
-e
"s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR
)/.config
56 yes
'' |
$(MAKE
) -C
$(PKG_BUILD_DIR
) \
58 CROSS_COMPILE
="$(TARGET_CROSS)" \
64 ifdef CONFIG_GCC_VERSION_LLVM
65 TARGET_CFLAGS
+= -fnested-functions
69 ifdef CONFIG_BUSYBOX_USE_LIBRPC
70 TARGET_CFLAGS
+= -I
$(STAGING_DIR
)/usr
/include
71 export LDFLAGS
=$(TARGET_LDFLAGS
)
76 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
78 CROSS_COMPILE
="$(TARGET_CROSS)" \
80 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" \
85 rm -rf
$(PKG_INSTALL_DIR
)
86 $(FIND
) $(PKG_BUILD_DIR
) -lname
"*busybox" -exec
rm \
{\
} \
;
87 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
89 CROSS_COMPILE
="$(TARGET_CROSS)" \
90 EXTRA_CFLAGS
="$(TARGET_CFLAGS)" \
92 CONFIG_PREFIX
="$(PKG_INSTALL_DIR)" \
97 define Package
/busybox
/install
98 $(INSTALL_DIR
) $(1)/etc
/init.d
99 $(CP
) $(PKG_INSTALL_DIR
)/* $(1)/
100 for tmp in
$(init-y
); do \
101 $(INSTALL_BIN
) .
/files
/$$$$tmp $(1)/etc
/init.d
/$$$$tmp; \
106 $(eval
$(call BuildPackage
,busybox
))