upgrade busybox to 1.4.0
[openwrt.git] / package / busybox / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=busybox
12 PKG_VERSION:=1.4.0
13 PKG_RELEASE:=1
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:=f24a3c1e08bc55ec44381d588e8bcced
19 PKG_CAT:=bzcat
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
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)/config/Config.in"
47         endmenu
48 endef
49
50 define Build/Configure
51         $(SCRIPT_DIR)/gen_busybox_config.pl $(TOPDIR)/.config > $(PKG_BUILD_DIR)/.config
52         yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
53                 CC="$(TARGET_CC)" \
54                 CROSS_COMPILE="$(TARGET_CROSS)" \
55                 ARCH="$(ARCH)" \
56                 oldconfig
57 endef
58
59 define Build/Compile
60         $(MAKE) -C $(PKG_BUILD_DIR) \
61                 CC="$(TARGET_CC)" \
62                 CROSS_COMPILE="$(TARGET_CROSS)" \
63                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
64                 ARCH="$(ARCH)" \
65                 IPKG_ARCH="$(ARCH)" \
66                 all
67 endef
68
69 define Package/busybox/install
70         $(MAKE) -C $(PKG_BUILD_DIR) \
71                 CC="$(TARGET_CC)" \
72                 CROSS_COMPILE="$(TARGET_CROSS)" \
73                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
74                 ARCH="$(ARCH)" \
75                 IPKG_ARCH="$(ARCH)" \
76                 CONFIG_PREFIX="$(1)" \
77                 install
78         $(INSTALL_DIR) $(1)/etc/init.d
79         for tmp in $(init-y); do \
80                 $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
81         done
82         -rm -rf $(1)/lib64
83 endef
84
85 $(eval $(call BuildPackage,busybox))