98e8c5da9f373e771faf7d6b669ac764036ab33b
[openwrt.git] / openwrt / package / busybox / busybox.mk
1 # $Id$
2
3 ifeq ($(strip $(BR2_PACKAGE_BUSYBOX_SNAPSHOT)),y)
4 # Be aware that this changes daily....
5 BUSYBOX_DIR:=$(BUILD_DIR)/busybox
6 BUSYBOX_SOURCE:=busybox-snapshot.tar.bz2
7 BUSYBOX_SITE:=http://www.busybox.net/downloads/snapshots
8 else
9 BUSYBOX_VER:=1.00
10 BUSYBOX_MD5:=5c7ea9b5d3b3677dfcdcec38b281a756
11 BUSYBOX_DIR:=$(BUILD_DIR)/busybox-$(BUSYBOX_VER)
12 BUSYBOX_SOURCE:=busybox-$(BUSYBOX_VER).tar.bz2
13 BUSYBOX_SITE:=http://www.busybox.net/downloads
14 endif
15 BUSYBOX_UNZIP=bzcat
16
17 $(DL_DIR)/$(BUSYBOX_SOURCE):
18 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(BUSYBOX_SOURCE) $(BUSYBOX_MD5) $(BUSYBOX_SITE)
19
20 busybox-source: $(DL_DIR)/$(BUSYBOX_SOURCE) $(BUSYBOX_CONFIG)
21
22 $(BUSYBOX_DIR)/.unpacked: $(DL_DIR)/$(BUSYBOX_SOURCE)
23 $(BUSYBOX_UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
24 # Allow busybox patches.
25 $(PATCH) $(BUSYBOX_DIR) ./patches
26 touch $(BUSYBOX_DIR)/.unpacked
27
28 $(BUSYBOX_DIR)/.configured: $(BUSYBOX_DIR)/.unpacked
29 $(SCRIPT_DIR)/gen_busybox_config.pl $(TOPDIR)/.config > $(BUSYBOX_DIR)/.config
30 # cp $(BUSYBOX_CONFIG) $(BUSYBOX_DIR)/.config
31 # $(SED) "s,^CROSS.*,CROSS=$(TARGET_CROSS)\n\
32 # PREFIX=$(TARGET_DIR),;" $(BUSYBOX_DIR)/Rules.mak
33 #ifeq ($(BR2_LARGEFILE),y)
34 # $(SED) "s/^.*CONFIG_LFS.*/CONFIG_LFS=y/;" $(BUSYBOX_DIR)/.config
35 #else
36 # $(SED) "s/^.*CONFIG_LFS.*/CONFIG_LFS=n/;" $(BUSYBOX_DIR)/.config
37 # $(SED) "s/^.*FDISK_SUPPORT_LARGE_DISKS.*/FDISK_SUPPORT_LARGE_DISKS=n/;" $(BUSYBOX_DIR)/.config
38 #endif
39 $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" -C $(BUSYBOX_DIR) oldconfig
40 touch $(BUSYBOX_DIR)/.configured
41
42 $(BUSYBOX_DIR)/busybox: $(BUSYBOX_DIR)/.configured
43 $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
44 EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(BUSYBOX_DIR)
45
46 $(TARGET_DIR)/bin/busybox: $(BUSYBOX_DIR)/busybox
47 $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
48 EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(BUSYBOX_DIR) install
49 $(STRIP) $(TARGET_DIR)/bin/busybox
50 # Just in case
51 -chmod a+x $(TARGET_DIR)/usr/share/udhcpc/default.script
52
53 busybox: $(TARGET_DIR)/bin/busybox
54
55 busybox-clean:
56 rm -f $(TARGET_DIR)/bin/busybox
57 -$(MAKE) -C $(BUSYBOX_DIR) clean
58
59 busybox-dirclean:
60 rm -rf $(BUSYBOX_DIR)
This page took 0.040236 seconds and 3 git commands to generate.