summaryrefslogtreecommitdiff
path: root/scripts/Makefile.IMA
blob: 1d7bc2cc336f49df2f5f896e1eeb816a8326f869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# This is completely unsupported.
# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
# the changes back
srctree		:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
objtree		:= $(CURDIR)
src		:= $(srctree)
obj		:= $(objtree)

default: busybox
include .config
ifdef CONFIG_FEATURE_COMPRESS_USAGE
usage_stuff = include/usage_compressed.h
endif

# pull in the config stuff
lib-all-y := applets/applets.o
lib-y:=
include procps/Kbuild
lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y)))
lib-y:=
include networking/Kbuild
lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y)))
lib-y:=
include networking/udhcp/Kbuild
lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y)))
lib-y:=
include networking/libiproute/Kbuild
lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y)))
lib-y:=
include loginutils/Kbuild
lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y)))
lib-y:=
include archival/Kbuild
lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y)))
lib-y:=
include archival/libunarchive/Kbuild
lib-all-y += $(patsubst %,archival/libunarchive/%,$(sort $(lib-y)))
lib-y:=
include applets/Kbuild
lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y)))
lib-y:=
include e2fsprogs/Kbuild
lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y)))
lib-y:=
#include e2fsprogs/old_e2fsprogs/Kbuild
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y)))
#lib-y:=
#include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y)))
#lib-y:=
#include e2fsprogs/old_e2fsprogs/blkid/Kbuild
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y)))
#lib-y:=
#include e2fsprogs/old_e2fsprogs/uuid/Kbuild
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y)))
#lib-y:=
#include e2fsprogs/old_e2fsprogs/e2p/Kbuild
#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y)))
#lib-y:=
include debianutils/Kbuild
lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y)))
lib-y:=
include runit/Kbuild
lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y)))
lib-y:=
include modutils/Kbuild
lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y)))
lib-y:=
include miscutils/Kbuild
lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y)))
lib-y:=
include coreutils/libcoreutils/Kbuild
lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y)))
lib-y:=
include coreutils/Kbuild
lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y)))
lib-y:=
include sysklogd/Kbuild
lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y)))
lib-y:=
include shell/Kbuild
lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y)))
lib-y:=
include console-tools/Kbuild
lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y)))
lib-y:=
include findutils/Kbuild
lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y)))
lib-y:=
include util-linux/Kbuild
lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y)))
lib-y:=
include init/Kbuild
lib-all-y += $(patsubst %,init/%,$(sort $(lib-y)))
lib-y:=
include libpwdgrp/Kbuild
lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y)))
lib-y:=
include editors/Kbuild
lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y)))
lib-y:=
include selinux/Kbuild
lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y)))
lib-y:=
include scripts/Kbuild
lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
lib-y:=
include libbb/Kbuild
lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
lib-y:=

include Makefile.flags
ifndef BB_VER
BB_VER:=""
endif

CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q

HOSTCC = gcc
AS              = $(CROSS_COMPILE)as
CC              = $(CROSS_COMPILE)gcc
LD              = $(CC) -nostdlib
CPP             = $(CC) -E
AR              = $(CROSS_COMPILE)ar
NM              = $(CROSS_COMPILE)nm
STRIP           = $(CROSS_COMPILE)strip
OBJCOPY         = $(CROSS_COMPILE)objcopy
OBJDUMP         = $(CROSS_COMPILE)objdump

WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,)
busybox: $(usage_stuff)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) --combine $(WHOLE_PROGRAM) \
		-funit-at-a-time -Wno-error -std=gnu99  \
		-o $(@)_unstripped $(lib-all-y:.o=.c) \
		-Wl,--start-group -lcrypt -lm -Wl,--end-group
	cp -f $(@)_unstripped $@
	-$(STRIP) -s -R .note -R .comment -R .version $@

applets/usage:
	$(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -I$(srctree)/include -o applets/usage applets/usage.c
include/usage_compressed.h: $(srctree)/include/usage.h applets/usage
	$(srctree)/applets/usage_compressed include/usage_compressed.h applets