Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 1 | # This is completely unsupported. |
| 2 | # Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate |
| 3 | # the changes back |
| 4 | srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) |
| 5 | objtree := $(CURDIR) |
| 6 | src := $(srctree) |
| 7 | obj := $(objtree) |
| 8 | |
| 9 | default: busybox |
| 10 | include .config |
| 11 | ifdef CONFIG_FEATURE_COMPRESS_USAGE |
| 12 | usage_stuff = include/usage_compressed.h |
| 13 | endif |
| 14 | |
| 15 | # pull in the config stuff |
| 16 | lib-all-y := applets/applets.o applets/busybox.o |
| 17 | lib-y:= |
| 18 | include procps/Kbuild |
| 19 | lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y))) |
| 20 | lib-y:= |
| 21 | include networking/Kbuild |
| 22 | lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y))) |
| 23 | lib-y:= |
| 24 | include networking/udhcp/Kbuild |
| 25 | lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y))) |
| 26 | lib-y:= |
| 27 | include networking/libiproute/Kbuild |
| 28 | lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y))) |
| 29 | lib-y:= |
| 30 | include loginutils/Kbuild |
| 31 | lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y))) |
| 32 | lib-y:= |
| 33 | include archival/Kbuild |
| 34 | lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y))) |
| 35 | lib-y:= |
| 36 | include archival/libunarchive/Kbuild |
| 37 | lib-all-y += $(patsubst %,archival/libunarchive/%,$(sort $(lib-y))) |
| 38 | lib-y:= |
| 39 | include applets/Kbuild |
| 40 | lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y))) |
| 41 | lib-y:= |
| 42 | include e2fsprogs/Kbuild |
| 43 | lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y))) |
| 44 | lib-y:= |
| 45 | #include e2fsprogs/old_e2fsprogs/Kbuild |
| 46 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y))) |
| 47 | #lib-y:= |
| 48 | #include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild |
| 49 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y))) |
| 50 | #lib-y:= |
| 51 | #include e2fsprogs/old_e2fsprogs/blkid/Kbuild |
| 52 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y))) |
| 53 | #lib-y:= |
| 54 | #include e2fsprogs/old_e2fsprogs/uuid/Kbuild |
| 55 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y))) |
| 56 | #lib-y:= |
| 57 | #include e2fsprogs/old_e2fsprogs/e2p/Kbuild |
| 58 | #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y))) |
| 59 | #lib-y:= |
| 60 | include debianutils/Kbuild |
| 61 | lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y))) |
| 62 | lib-y:= |
| 63 | include runit/Kbuild |
| 64 | lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y))) |
| 65 | lib-y:= |
| 66 | include modutils/Kbuild |
| 67 | lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y))) |
| 68 | lib-y:= |
| 69 | include miscutils/Kbuild |
| 70 | lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y))) |
| 71 | lib-y:= |
| 72 | include coreutils/libcoreutils/Kbuild |
| 73 | lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y))) |
| 74 | lib-y:= |
| 75 | include coreutils/Kbuild |
| 76 | lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y))) |
| 77 | lib-y:= |
| 78 | include sysklogd/Kbuild |
| 79 | lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y))) |
| 80 | lib-y:= |
| 81 | include shell/Kbuild |
| 82 | lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y))) |
| 83 | lib-y:= |
| 84 | include console-tools/Kbuild |
| 85 | lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y))) |
| 86 | lib-y:= |
| 87 | include findutils/Kbuild |
| 88 | lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y))) |
| 89 | lib-y:= |
| 90 | include util-linux/Kbuild |
| 91 | lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y))) |
| 92 | lib-y:= |
| 93 | include init/Kbuild |
| 94 | lib-all-y += $(patsubst %,init/%,$(sort $(lib-y))) |
| 95 | lib-y:= |
| 96 | include libpwdgrp/Kbuild |
| 97 | lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y))) |
| 98 | lib-y:= |
| 99 | include editors/Kbuild |
| 100 | lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y))) |
| 101 | lib-y:= |
| 102 | include scripts/Kbuild |
| 103 | lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y))) |
| 104 | lib-y:= |
| 105 | include libbb/Kbuild |
| 106 | lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y))) |
| 107 | lib-y:= |
| 108 | |
Bernhard Reutner-Fischer | 493691a | 2007-02-02 16:11:24 +0000 | [diff] [blame^] | 109 | include Makefile.flags |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 110 | ifndef BB_VER |
| 111 | BB_VER:="" |
| 112 | endif |
Bernhard Reutner-Fischer | 493691a | 2007-02-02 16:11:24 +0000 | [diff] [blame^] | 113 | |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 114 | CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q |
| 115 | |
| 116 | HOSTCC = gcc |
| 117 | CC = gcc |
| 118 | |
| 119 | busybox: $(usage_stuff) |
| 120 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_EXTRA) --combine -fwhole-program \ |
Bernhard Reutner-Fischer | 493691a | 2007-02-02 16:11:24 +0000 | [diff] [blame^] | 121 | -funit-at-a-time -Wno-error -std=gnu99 \ |
Bernhard Reutner-Fischer | b5bb40f | 2007-01-23 01:29:04 +0000 | [diff] [blame] | 122 | -o $(@)_unstripped $(lib-all-y:.o=.c) \ |
| 123 | -Wl,--start-group -lcrypt -lm -Wl,--end-group |
| 124 | cp $(@)_unstripped $@ |
| 125 | -strip -s -R .note -R .comment -R .version $@ |
| 126 | |
| 127 | applets/usage: |
| 128 | $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c |
| 129 | include/usage_compressed.h: $(srctree)/include/usage.h applets/usage |
| 130 | $(srctree)/applets/usage_compressed include/usage_compressed.h applets |
| 131 | |