blob: dec5fde838bf6b42e6cad8d47a648b4bc287b18d [file] [log] [blame]
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +00001# This is completely unsupported.
2# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
3# the changes back
4srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
5objtree := $(CURDIR)
6src := $(srctree)
7obj := $(objtree)
8
9default: busybox
10include .config
11ifdef CONFIG_FEATURE_COMPRESS_USAGE
12usage_stuff = include/usage_compressed.h
13endif
14
15# pull in the config stuff
16lib-all-y := applets/applets.o applets/busybox.o
17lib-y:=
18include procps/Kbuild
19lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y)))
20lib-y:=
21include networking/Kbuild
22lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y)))
23lib-y:=
24include networking/udhcp/Kbuild
25lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y)))
26lib-y:=
27include networking/libiproute/Kbuild
28lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y)))
29lib-y:=
30include loginutils/Kbuild
31lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y)))
32lib-y:=
33include archival/Kbuild
34lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y)))
35lib-y:=
36include archival/libunarchive/Kbuild
37lib-all-y += $(patsubst %,archival/libunarchive/%,$(sort $(lib-y)))
38lib-y:=
39include applets/Kbuild
40lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y)))
41lib-y:=
42include e2fsprogs/Kbuild
43lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y)))
44lib-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:=
60include debianutils/Kbuild
61lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y)))
62lib-y:=
63include runit/Kbuild
64lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y)))
65lib-y:=
66include modutils/Kbuild
67lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y)))
68lib-y:=
69include miscutils/Kbuild
70lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y)))
71lib-y:=
72include coreutils/libcoreutils/Kbuild
73lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y)))
74lib-y:=
75include coreutils/Kbuild
76lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y)))
77lib-y:=
78include sysklogd/Kbuild
79lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y)))
80lib-y:=
81include shell/Kbuild
82lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y)))
83lib-y:=
84include console-tools/Kbuild
85lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y)))
86lib-y:=
87include findutils/Kbuild
88lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y)))
89lib-y:=
90include util-linux/Kbuild
91lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y)))
92lib-y:=
93include init/Kbuild
94lib-all-y += $(patsubst %,init/%,$(sort $(lib-y)))
95lib-y:=
96include libpwdgrp/Kbuild
97lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y)))
98lib-y:=
99include editors/Kbuild
100lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y)))
101lib-y:=
102include scripts/Kbuild
103lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
104lib-y:=
105include libbb/Kbuild
106lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
107lib-y:=
108
Bernhard Reutner-Fischer493691a2007-02-02 16:11:24 +0000109include Makefile.flags
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000110ifndef BB_VER
111BB_VER:=""
112endif
Bernhard Reutner-Fischer493691a2007-02-02 16:11:24 +0000113
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000114CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q
115
116HOSTCC = gcc
117CC = gcc
118
119busybox: $(usage_stuff)
120 $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_EXTRA) --combine -fwhole-program \
Bernhard Reutner-Fischer493691a2007-02-02 16:11:24 +0000121 -funit-at-a-time -Wno-error -std=gnu99 \
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000122 -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
127applets/usage:
128 $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c
129include/usage_compressed.h: $(srctree)/include/usage.h applets/usage
130 $(srctree)/applets/usage_compressed include/usage_compressed.h applets
131