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