R.I.P. devfs
[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.1
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:=5728403bce309cdabcffa414e2e64052
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         source "$(SOURCE)/target-config.in"
45         menu "Configuration"
46                 depends on PACKAGE_busybox
47                 source "$(SOURCE)/config/Config.in"
48         endmenu
49 endef
50
51 define Build/Configure
52         $(SCRIPT_DIR)/gen_busybox_config.pl $(TOPDIR)/.config > $(PKG_BUILD_DIR)/.config
53         yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
54                 CC="$(TARGET_CC)" \
55                 CROSS_COMPILE="$(TARGET_CROSS)" \
56                 ARCH="$(ARCH)" \
57                 oldconfig
58 endef
59
60 define Build/Compile
61         $(MAKE) -C $(PKG_BUILD_DIR) \
62                 CC="$(TARGET_CC)" \
63                 CROSS_COMPILE="$(TARGET_CROSS)" \
64                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
65                 ARCH="$(ARCH)" \
66                 IPKG_ARCH="$(ARCH)" \
67                 all
68 endef
69
70 define Package/busybox/install
71         $(MAKE) -C $(PKG_BUILD_DIR) \
72                 CC="$(TARGET_CC)" \
73                 CROSS_COMPILE="$(TARGET_CROSS)" \
74                 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
75                 ARCH="$(ARCH)" \
76                 IPKG_ARCH="$(ARCH)" \
77                 CONFIG_PREFIX="$(1)" \
78                 install
79         $(INSTALL_DIR) $(1)/etc/init.d
80         for tmp in $(init-y); do \
81                 $(INSTALL_BIN) ./files/$$$$tmp $(1)/etc/init.d/$$$$tmp; \
82         done
83         -rm -rf $(1)/lib64
84 endef
85
86 $(eval $(call BuildPackage,busybox))