busybox: fix spurious rebuild issue
[openwrt.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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=busybox
12 PKG_VERSION:=1.11.3
13 PKG_RELEASE:=4
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:=4355ad8bb57ce3b39ad827566c1a6da3
19
20 include $(INCLUDE_DIR)/package.mk
21
22 ifeq ($(DUMP),)
23 STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | md5s)
24 endif
25
26 init-y :=
27 init-$(CONFIG_BUSYBOX_CONFIG_HTTPD) += httpd
28 init-$(CONFIG_BUSYBOX_CONFIG_CROND) += cron
29 init-$(CONFIG_BUSYBOX_CONFIG_TELNETD) += telnet
30
31 define Package/busybox
32 SECTION:=base
33 CATEGORY:=Base system
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 menu "Configuration"
46 depends on PACKAGE_busybox
47 source "$(SOURCE)/target-config.in"
48 source "$(SOURCE)/config/Config.in"
49 endmenu
50 endef
51
52 define Build/Configure
53 rm -f $(PKG_BUILD_DIR)/.configured*
54 grep 'CONFIG_BUSYBOX_' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_\\(.*\\),\\1\\2,g" > $(PKG_BUILD_DIR)/.config
55 yes '' | $(MAKE) -C $(PKG_BUILD_DIR) \
56 CC="$(TARGET_CC)" \
57 CROSS_COMPILE="$(TARGET_CROSS)" \
58 KBUILD_HAVE_NLS=no \
59 ARCH="$(ARCH)" \
60 oldconfig
61 endef
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 all
71 rm -rf $(PKG_INSTALL_DIR)
72 $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \;
73 $(MAKE) -C $(PKG_BUILD_DIR) \
74 CC="$(TARGET_CC)" \
75 CROSS_COMPILE="$(TARGET_CROSS)" \
76 EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
77 ARCH="$(ARCH)" \
78 IPKG_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.043631 seconds and 5 git commands to generate.