get rid of $Id$ - it has never helped us and it has broken too many patches ;)
[openwrt/staging/yousong.git] / 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=busybox
11 PKG_VERSION:=1.11.3
12 PKG_RELEASE:=5
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:=4355ad8bb57ce3b39ad827566c1a6da3
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 TITLE:=Core utilities for embedded Linux
34 URL:=http://busybox.net/
35 MENU:=1
36 endef
37
38 define Package/busybox/description
39 The Swiss Army Knife of embedded Linux.
40 It slices, it dices, it makes Julian Fries.
41 endef
42
43 define Package/busybox/config
44 menu "Configuration"
45 depends on PACKAGE_busybox
46 source "$(SOURCE)/target-config.in"
47 source "$(SOURCE)/config/Config.in"
48 endmenu
49 endef
50
51 define Build/Configure
52 rm -f $(PKG_BUILD_DIR)/.configured*
53 grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
54 yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
55 CC="$(TARGET_CC)" \
56 CROSS_COMPILE="$(TARGET_CROSS)" \
57 KBUILD_HAVE_NLS=no \
58 ARCH="$(ARCH)" \
59 oldconfig
60 endef
61
62 define 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 all
70 rm -rf $(PKG_INSTALL_DIR)
71 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 CC="$(TARGET_CC)" \
74 CROSS_COMPILE="$(TARGET_CROSS)" \
75 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
76 ARCH="$(ARCH)" \
77 IPKG_ARCH="$(ARCH)" \
78 CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
79 install
80 endef
81
82 define 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
89 endef
90
91 $(eval $(call BuildPackage,busybox))