blob: 1d7bc2cc336f49df2f5f896e1eeb816a8326f869 [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
Bernhard Reutner-Fischer64332bf2007-05-15 09:07:06 +000016lib-all-y := applets/applets.o
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +000017lib-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:=
Bernhard Reutner-Fischere11b4a42007-03-09 08:46:31 +0000102include selinux/Kbuild
103lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y)))
104lib-y:=
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000105include scripts/Kbuild
106lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
107lib-y:=
108include libbb/Kbuild
109lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
110lib-y:=
111
Bernhard Reutner-Fischer493691a2007-02-02 16:11:24 +0000112include Makefile.flags
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000113ifndef BB_VER
114BB_VER:=""
115endif
Bernhard Reutner-Fischer493691a2007-02-02 16:11:24 +0000116
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000117CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q
118
119HOSTCC = gcc
Bernhard Reutner-Fischer118b81d2007-06-22 17:39:21 +0000120AS = $(CROSS_COMPILE)as
121CC = $(CROSS_COMPILE)gcc
122LD = $(CC) -nostdlib
123CPP = $(CC) -E
124AR = $(CROSS_COMPILE)ar
125NM = $(CROSS_COMPILE)nm
126STRIP = $(CROSS_COMPILE)strip
127OBJCOPY = $(CROSS_COMPILE)objcopy
128OBJDUMP = $(CROSS_COMPILE)objdump
129
Bernhard Reutner-Fischer9a1c71a2007-02-12 12:57:38 +0000130WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,)
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000131busybox: $(usage_stuff)
Bernhard Reutner-Fischer9a1c71a2007-02-12 12:57:38 +0000132 $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) --combine $(WHOLE_PROGRAM) \
Bernhard Reutner-Fischer493691a2007-02-02 16:11:24 +0000133 -funit-at-a-time -Wno-error -std=gnu99 \
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000134 -o $(@)_unstripped $(lib-all-y:.o=.c) \
135 -Wl,--start-group -lcrypt -lm -Wl,--end-group
Bernhard Reutner-Fischer64332bf2007-05-15 09:07:06 +0000136 cp -f $(@)_unstripped $@
137 -$(STRIP) -s -R .note -R .comment -R .version $@
Bernhard Reutner-Fischerb5bb40f2007-01-23 01:29:04 +0000138
139applets/usage:
140 $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c
141include/usage_compressed.h: $(srctree)/include/usage.h applets/usage
142 $(srctree)/applets/usage_compressed include/usage_compressed.h applets
143