busybox: remove busybox menuconfig from top level menuconfig
[openwrt/svn-archive/archive.git] / package / utils / busybox / Makefile
1 #
2 # Copyright (C) 2006-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=busybox
11 PKG_VERSION:=1.19.4
12 PKG_RELEASE:=7
13 PKG_FLAGS:=essential
14
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
19
20 PKG_CONFIG_DEPENDS:=CONFIG_BUSYBOX_ENABLE_NFS_MOUNT
21 PKG_BUILD_PARALLEL:=1
22
23 PKG_LICENSE:=GPLv2 BSD-4c
24 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
25
26 include $(INCLUDE_DIR)/package.mk
27
28 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
29 BB_MAKE_VERBOSE := V=1
30 else
31 BB_MAKE_VERBOSE :=
32 endif
33
34 init-y :=
35 init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
36 init-$(CONFIG_BUSYBOX_CONFIG_NTPD) += sysntpd
37 init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
38
39 define Package/busybox
40 SECTION:=base
41 CATEGORY:=Base system
42 MAINTAINER:=Nicolas Thill <nico@openwrt.org>
43 TITLE:=Core utilities for embedded Linux
44 URL:=http://busybox.net/
45 DEPENDS:=+BUSYBOX_ENABLE_NFS_MOUNT:librpc
46 MENU:=1
47 endef
48
49 define Package/busybox/description
50 The Swiss Army Knife of embedded Linux.
51 It slices, it dices, it makes Julian Fries.
52 endef
53
54 define Package/busybox/config
55 source "$(SOURCE)/Config.in"
56 endef
57
58 CONFIG_TEMPLATE:=./config/default
59
60 LDLIBS:=m crypt
61 ifdef CONFIG_BUSYBOX_ENABLE_NFS_MOUNT
62 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
63 export LDFLAGS=$(TARGET_LDFLAGS)
64 LDLIBS += rpc
65 CONFIG_TEMPLATE:=+ $(CONFIG_TEMPLATE) ./config/nfsmount
66 endif
67
68 define Build/Configure
69 $(SCRIPT_DIR)/kconfig.pl $(CONFIG_TEMPLATE) > $(PKG_BUILD_DIR)/.config
70 yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \
71 CC="$(TARGET_CC)" \
72 CROSS_COMPILE="$(TARGET_CROSS)" \
73 KBUILD_HAVE_NLS=no \
74 ARCH="$(ARCH)" \
75 $(BB_MAKE_VERBOSE) \
76 oldconfig
77 endef
78
79 ifdef CONFIG_GCC_VERSION_LLVM
80 TARGET_CFLAGS += -fnested-functions
81 endif
82
83 define Build/Compile
84 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
85 CC="$(TARGET_CC)" \
86 CROSS_COMPILE="$(TARGET_CROSS)" \
87 KBUILD_HAVE_NLS=no \
88 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
89 ARCH="$(ARCH)" \
90 SKIP_STRIP=y \
91 LDLIBS="$(LDLIBS)" \
92 $(BB_MAKE_VERBOSE) \
93 all
94 rm -rf $(PKG_INSTALL_DIR)
95 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
96 $(MAKE) -C $(PKG_BUILD_DIR) \
97 CC="$(TARGET_CC)" \
98 CROSS_COMPILE="$(TARGET_CROSS)" \
99 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
100 ARCH="$(ARCH)" \
101 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
102 LDLIBS="$(LDLIBS)" \
103 $(BB_MAKE_VERBOSE) \
104 install
105 endef
106
107 define Package/busybox/install
108 $(INSTALL_DIR) $(1)/etc/init.d
109 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
110 for tmp in $(init-y); do \
111 $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
112 done
113 -rm -rf $(1)/lib64
114 endef
115
116 $(eval $(call BuildPackage,busybox))