Root/package/busybox/Makefile

1#
2# Copyright (C) 2006-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=busybox
11PKG_VERSION:=1.15.3
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=http://www.busybox.net/downloads \
16        http://distfiles.gentoo.org/distfiles/
17PKG_MD5SUM:=6059ac9456de6fb18dc8ee4cd0ec9240
18
19include $(INCLUDE_DIR)/package.mk
20
21ifeq ($(DUMP),)
22  STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
23endif
24
25init-y :=
26init-$(CONFIG_BUSYBOX_CONFIG_HTTPD) += httpd
27init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
28init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
29
30define Package/busybox
31  SECTION:=base
32  CATEGORY:=Base system
33  TITLE:=Core utilities for embedded Linux
34  URL:=http://busybox.net/
35  MENU:=1
36endef
37
38define Package/busybox/description
39 The Swiss Army Knife of embedded Linux.
40 It slices, it dices, it makes Julian Fries.
41endef
42
43define Package/busybox/config
44    source "$(SOURCE)/Config.in"
45endef
46
47define Build/Configure
48    rm -f $(PKG_BUILD_DIR)/.configured*
49    grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
50    yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
51        CC="$(TARGET_CC)" \
52        CROSS_COMPILE="$(TARGET_CROSS)" \
53        KBUILD_HAVE_NLS=no \
54        ARCH="$(ARCH)" \
55        oldconfig
56endef
57
58ifdef CONFIG_GCC_VERSION_LLVM
59  TARGET_CFLAGS += -fnested-functions
60endif
61
62define Build/Compile
63    $(MAKE) -C $(PKG_BUILD_DIR) \
64        CC="$(TARGET_CC)" \
65        CROSS_COMPILE="$(TARGET_CROSS)" \
66        KBUILD_HAVE_NLS=no \
67        EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
68        ARCH="$(ARCH)" \
69        SKIP_STRIP=y \
70        all
71    rm -rf $(PKG_INSTALL_DIR)
72    $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
73    $(MAKE) -C $(PKG_BUILD_DIR) \
74        CC="$(TARGET_CC)" \
75        CROSS_COMPILE="$(TARGET_CROSS)" \
76        EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
77        ARCH="$(ARCH)" \
78        CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
79        install
80endef
81
82define Package/busybox/install
83    $(INSTALL_DIR) $(1)/etc/init.d
84    $(CP) $(PKG_INSTALL_DIR)/* $(1)/
85    for tmp in $(init-y); do \
86        $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
87    done
88    -rm -rf $(1)/lib64
89endef
90
91$(eval $(call BuildPackage,busybox))
92

Archive Download this file



interactive