source: branches/2.2.9/mindi-busybox/scripts/Makefile.IMA @ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 9 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File size: 6.2 KB
Line 
1# This is completely unsupported.
2#
3# Uasge: make -f scripts/Makefile.IMA
4#
5# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
6# the changes back
7srctree     := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
8objtree     := $(CURDIR)
9src     := $(srctree)
10obj     := $(objtree)
11
12# Look for make include files relative to root of kernel src
13MAKEFLAGS += --include-dir=$(srctree)
14
15default: busybox
16
17include .config
18
19# Cross compiling and selecting different set of gcc/bin-utils
20ifeq ($(CROSS_COMPILE),)
21CROSS_COMPILE := $(subst ",,$(CONFIG_CROSS_COMPILER_PREFIX))
22endif
23
24ifneq ($(CROSS_COMPILE),)
25SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1)
26else
27SUBARCH := $(shell uname -m)
28endif
29SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
30                                         -e s/arm.*/arm/ -e s/sa110/arm/ \
31                                         -e s/s390x/s390/ -e s/parisc64/parisc/ \
32                                         -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
33ARCH ?= $(SUBARCH)
34
35ifndef HOSTCC
36HOSTCC = cc
37endif
38AS              = $(CROSS_COMPILE)as
39CC              = $(CROSS_COMPILE)gcc
40LD              = $(CC) -nostdlib
41CPP             = $(CC) -E
42AR              = $(CROSS_COMPILE)ar
43NM              = $(CROSS_COMPILE)nm
44STRIP           = $(CROSS_COMPILE)strip
45OBJCOPY         = $(CROSS_COMPILE)objcopy
46OBJDUMP         = $(CROSS_COMPILE)objdump
47
48CFLAGS   := $(CFLAGS)
49CPPFLAGS += -D"KBUILD_STR(s)=\#s" #-Q
50
51# We need some generic definitions
52include $(srctree)/scripts/Kbuild.include
53
54include Makefile.flags
55
56-include $(srctree)/arch/$(ARCH)/Makefile
57ifdef CONFIG_FEATURE_COMPRESS_USAGE
58usage_stuff = include/usage_compressed.h
59endif
60
61ifndef BB_VER
62BB_VER:=""
63endif
64
65WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,)
66
67# pull in the config stuff
68lib-all-y := applets/applets.o
69lib-y:=
70include procps/Kbuild
71lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y)))
72lib-y:=
73include networking/Kbuild
74lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y)))
75lib-y:=
76include networking/udhcp/Kbuild
77lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y)))
78lib-y:=
79include networking/libiproute/Kbuild
80lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y)))
81lib-y:=
82include loginutils/Kbuild
83lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y)))
84lib-y:=
85include archival/Kbuild
86lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y)))
87lib-y:=
88include archival/libarchive/Kbuild
89lib-all-y += $(patsubst %,archival/libarchive/%,$(sort $(lib-y)))
90lib-y:=
91include applets/Kbuild
92lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y)))
93lib-y:=
94include e2fsprogs/Kbuild
95lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y)))
96lib-y:=
97#include e2fsprogs/old_e2fsprogs/Kbuild
98#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y)))
99#lib-y:=
100#include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild
101#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y)))
102#lib-y:=
103#include e2fsprogs/old_e2fsprogs/blkid/Kbuild
104#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y)))
105#lib-y:=
106#include e2fsprogs/old_e2fsprogs/uuid/Kbuild
107#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y)))
108#lib-y:=
109#include e2fsprogs/old_e2fsprogs/e2p/Kbuild
110#lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y)))
111#lib-y:=
112include debianutils/Kbuild
113lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y)))
114lib-y:=
115include runit/Kbuild
116lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y)))
117lib-y:=
118include modutils/Kbuild
119lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y)))
120lib-y:=
121include miscutils/Kbuild
122lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y)))
123lib-y:=
124include coreutils/libcoreutils/Kbuild
125lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y)))
126lib-y:=
127include coreutils/Kbuild
128lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y)))
129lib-y:=
130include sysklogd/Kbuild
131lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y)))
132lib-y:=
133include shell/Kbuild
134lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y)))
135lib-y:=
136include console-tools/Kbuild
137lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y)))
138lib-y:=
139include findutils/Kbuild
140lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y)))
141lib-y:=
142include util-linux/Kbuild
143lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y)))
144lib-y:=
145include util-linux/volume_id/Kbuild
146lib-all-y += $(patsubst %,util-linux/volume_id/%,$(sort $(lib-y)))
147lib-y:=
148include init/Kbuild
149lib-all-y += $(patsubst %,init/%,$(sort $(lib-y)))
150lib-y:=
151include libpwdgrp/Kbuild
152lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y)))
153lib-y:=
154include editors/Kbuild
155lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y)))
156lib-y:=
157include printutils/Kbuild
158lib-all-y += $(patsubst %,printutils/%,$(sort $(lib-y)))
159lib-y:=
160include selinux/Kbuild
161lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y)))
162lib-y:=
163include scripts/Kbuild
164lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
165lib-y:=
166include libbb/Kbuild
167lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
168lib-y:=
169
170comma:=,
171busybox_unstripped.o: $(usage_stuff) include/applet_tables.h include/autoconf.h
172    $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) \
173        $(patsubst %,-Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) \
174        -DGCC_COMBINE=1 \
175        --combine $(WHOLE_PROGRAM) \
176        -funit-at-a-time -Wno-error -std=gnu99  \
177        -c -o busybox_unstripped.o \
178        $(lib-all-y:.o=.c)
179
180busybox: busybox_unstripped.o
181    $(srctree)/scripts/trylink \
182        busybox_unstripped \
183        "$(CC) $(CFLAGS_busybox)" \
184        "$(CFLAGS)" \
185        "$(LDFLAGS)" \
186        "busybox_unstripped.o" \
187        "" \
188        "crypt m"
189    cp -f $(@)_unstripped $@
190    -$(STRIP) -s -R .note -R .comment -R .version $@
191
192# If .config is newer than include/autoconf.h, someone tinkered
193# with it and forgot to run make oldconfig.
194include/autoconf.h: .config
195    $(MAKE) -f $(srctree)/Makefile silentoldconfig
196
197applets/usage: include/autoconf.h
198    $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c
199
200applets/applet_tables: include/autoconf.h
201    $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/applet_tables applets/applet_tables.c
202
203include/usage_compressed.h: include/usage.h applets/usage
204    $(srctree)/applets/usage_compressed include/usage_compressed.h applets
205
206include/applet_tables.h: include/applets.h
207    applets/applet_tables include/applet_tables.h
Note: See TracBrowser for help on using the repository browser.