aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-03-09 09:03:37 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-03-09 09:03:37 +0000
commit07a79e75f502ebd41e5341aacc5de303d3ffaea0 (patch)
tree4b95f98bab0b298c5df171772b629d03400ef507
parent874af85d5eb08b65476f406f6a1e7edc127ac210 (diff)
downloadbusybox-w32-07a79e75f502ebd41e5341aacc5de303d3ffaea0.tar.gz
busybox-w32-07a79e75f502ebd41e5341aacc5de303d3ffaea0.tar.bz2
busybox-w32-07a79e75f502ebd41e5341aacc5de303d3ffaea0.zip
- backout using features which are not available with the previous stable
version of make (3.71.1).
-rw-r--r--Makefile122
-rw-r--r--Rules.mak56
-rw-r--r--applets/Makefile.in8
-rw-r--r--archival/Makefile.in8
-rw-r--r--archival/libunarchive/Makefile.in8
-rw-r--r--console-tools/Makefile.in8
-rw-r--r--coreutils/Makefile.in8
-rw-r--r--coreutils/libcoreutils/Makefile.in9
-rw-r--r--debianutils/Makefile.in8
-rw-r--r--e2fsprogs/Makefile.in45
-rw-r--r--editors/Makefile.in8
-rw-r--r--findutils/Makefile.in8
-rw-r--r--init/Makefile.in8
-rw-r--r--libbb/Makefile.in9
-rw-r--r--libpwdgrp/Makefile.in8
-rw-r--r--loginutils/Makefile.in8
-rw-r--r--miscutils/Makefile.in8
-rw-r--r--modutils/Makefile.in8
-rw-r--r--networking/Makefile.in8
-rw-r--r--networking/libiproute/Makefile.in9
-rw-r--r--networking/udhcp/Makefile.in8
-rw-r--r--procps/Makefile.in8
-rw-r--r--shell/Makefile.in8
-rw-r--r--sysklogd/Makefile.in8
-rw-r--r--util-linux/Makefile.in8
25 files changed, 236 insertions, 166 deletions
diff --git a/Makefile b/Makefile
index fffc52466..7fcdd45e5 100644
--- a/Makefile
+++ b/Makefile
@@ -13,15 +13,16 @@ noconfig_targets := menuconfig config oldconfig randconfig \
13 clean distclean \ 13 clean distclean \
14 release tags 14 release tags
15 15
16# make-3.79.1 didn't support MAKEFILE_LIST
17# for building out-of-tree, users of make-3.79 still have to pass top_srcdir=
18# to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox
19ifndef MAKEFILE_LIST
20MAKEFILE_LIST=.
21endif
22# the toplevel sourcedir 16# the toplevel sourcedir
23ifndef top_srcdir 17ifndef top_srcdir
18# make-3.79.1 didn't support MAKEFILE_LIST
19# for building out-of-tree, users of make-3.79.1 still have to pass top_srcdir=
20# to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox
21ifdef MAKEFILE_LIST
24top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd) 22top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)
23else
24top_srcdir:=$(CURDIR)
25endif
25endif 26endif
26# toplevel directory of the object-tree 27# toplevel directory of the object-tree
27ifndef top_builddir 28ifndef top_builddir
@@ -63,44 +64,22 @@ else
63 PACKAGE_OUTPUTDIR := $(top_builddir) 64 PACKAGE_OUTPUTDIR := $(top_builddir)
64endif 65endif
65 66
66#######################################################################
67# Try to workaround bugs in make
68
69# make-3.79.1 didn't understand order-only prerequisites ('|').
70# Just treat them as normal prerequisites. Note that this will lead to
71# spurious rebuilds.
72ifeq ($(MAKE_VERSION),3.79.1)
73|: ;
74endif
75
76# Workaround for bugs in make-3.80
77# eval is broken if it is in a conditional
78
79#$ cat 3.80-eval-in-cond.mak
80#all:: ; @echo it
81#define Y
82# all:: ; @echo worked
83#endef
84#ifdef BAR
85#$(eval $(Y))
86#endif
87#$ make -f 3.80-eval-in-cond.mak
88#it
89#$ make -f 3.80-eval-in-cond.mak BAR=set
90#3.80-eval-in-cond.mak:5: *** missing `endif'. Stop.
91
92# This was fixed in December 2003.
93define check_gcc 67define check_gcc
94$(eval $(1)+=$(if $(2),$(if $(shell $(CC) $(2) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo y),$(2),$(if $(3),$(3))),$(if $(3),$(3)))) 68$(if $(2),$(if $(shell $(CC) $(2) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo y),$(2),$(if $(3),$(3))),$(if $(3),$(3)))
95endef 69endef
96 70
97define check_ld 71define check_ld
98$(eval $(1)+=$(if $(2),$(if $(shell $(LD) $(2) -o /dev/null -b binary /dev/null > /dev/null 2>&1 && echo y),$(shell echo \-Wl,$(2)),$(if $(3),$(3))),$(if $(3),$(3)))) 72$(if $(2),$(if $(shell $(LD) $(2) -o /dev/null -b binary /dev/null > /dev/null 2>&1 && echo y),$(shell echo \-Wl,$(2)),$(if $(3),$(3))),$(if $(3),$(3)))
99endef 73endef
100 74
101####################################################################### 75#######################################################################
76# make-3.79.1 doesn't support order-only prerequisites..
77ifeq ($(MAKE_VERSION),3.79.1)
78|: $(^) ;
79endif
80#######################################################################
81
102 82
103-include $(top_srcdir)/Rules.mak
104 83
105# Handle building out of tree 84# Handle building out of tree
106ifneq ($(top_builddir),$(top_srcdir)) 85ifneq ($(top_builddir),$(top_srcdir))
@@ -179,6 +158,8 @@ help:
179 @echo ' 2 also print when make enters a directory' 158 @echo ' 2 also print when make enters a directory'
180 @echo ' 3 also verbosely print shell invocations' 159 @echo ' 3 also verbosely print shell invocations'
181 160
161-include $(top_srcdir)/Rules.mak
162
182ifneq ($(strip $(HAVE_DOT_CONFIG)),y) 163ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
183# Default target if none was requested explicitly 164# Default target if none was requested explicitly
184all: defconfig menuconfig ; 165all: defconfig menuconfig ;
@@ -252,33 +233,8 @@ ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
252 233
253endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y) 234endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
254 235
255# convert $(DIRS) to upper case. Use sed instead of tr since we're already
256# depending on it.
257DIRS_UPPER:=$(shell echo $(DIRS) | $(SED) 'h;y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/')
258
259# First populate the variables ..._OBJ-y et al
260$(foreach d,$(DIRS_UPPER),$(eval $(notdir $(d))-y:=))
261
262include $(patsubst %,%/Makefile.in,$(SRC_DIRS)) 236include $(patsubst %,%/Makefile.in,$(SRC_DIRS))
263 237
264# Then we need the dependencies for ..._OBJ
265define dir_pattern.o
266ifeq ($(os),.os)
267$(if $($(1)_OBJ.os),$($(1)_OBJ.os:.os=.o): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c)
268endif
269$(if $($(1)_OBJ$(os)),$($(1)_OBJ$(os)): $(top_builddir)/$(2)/%$(os): $(top_srcdir)/$(2)/%.c)
270$(if $($(1)_OBJ),$($(1)_OBJ): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c)
271endef
272
273# The actual directory patterns for .o*
274$(foreach d,$(DIRS),$(eval $(call dir_pattern.o,$(subst /,_,$(d)),$(d))))
275
276define file_lists
277$($(1)$(2)) $($(1)$(2).o) $($(1)$(2).os)
278endef
279bin-obj-y:=$(subst .os,.o,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_OBJ)))
280bin-mobj-y:=$(subst .osm,.om,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_MOBJ)))
281
282ifeq ($(strip $(HAVE_DOT_CONFIG)),y) 238ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
283# Finally pull in the dependencies (headers and other includes) of the 239# Finally pull in the dependencies (headers and other includes) of the
284# individual object files 240# individual object files
@@ -294,9 +250,7 @@ all: busybox busybox.links doc ;
294# IMA compiles all sources at once (aka IPO aka IPA etc.) 250# IMA compiles all sources at once (aka IPO aka IPA etc.)
295 251
296ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y) 252ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
297# We are not building .o 253libraries-y:=
298bin-obj-y:=
299bin-mobj-y:=
300# Which parts of the internal libs are requested? 254# Which parts of the internal libs are requested?
301# Per default we only want what was actually selected. 255# Per default we only want what was actually selected.
302# -a denotes all while -y denotes the selected ones. 256# -a denotes all while -y denotes the selected ones.
@@ -312,30 +266,17 @@ APPLETS_DEFINE:=$(APPLETS_DEFINE-y)
312else # CONFIG_BUILD_AT_ONCE 266else # CONFIG_BUILD_AT_ONCE
313# no --combine, build archives out of the individual .o 267# no --combine, build archives out of the individual .o
314# This was the old way the binary was built. 268# This was the old way the binary was built.
315libbusybox-obj:=$(archival_libunarchive_OBJ$(os)) \ 269libbusybox-obj:=archival/libunarchive/libunarchive.a \
316 $(networking_libiproute_OBJ$(os)) \ 270 networking/libiproute/libiproute.a \
317 $(libpwdgrp_MOBJ$(os)) \ 271 libpwdgrp/libpwdgrp.a coreutils/libcoreutils/libcoreutils.a \
318 $(coreutils_libcoreutils_OBJ$(os)) \ 272 libbb/libbb.a
319 $(libbb_OBJ$(os)) $(libbb_MOBJ$(os)) 273libbusybox-obj:=$(patsubst %,$(top_builddir)/%,$(libbusybox-obj))
320
321ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y) 274ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
322# linking against libbusybox, so don't build the .o already contained in the .so 275# linking against libbusybox, so don't build the .a already contained in the .so
323bin-obj-y:=$(filter-out $(libbusybox-obj) $(libbusybox-obj:.os=.o),$(bin-obj-y)) 276libraries-y:=$(filter-out $(libbusybox-obj),$(libraries-y))
324bin-mobj-y:=$(filter-out $(libbusybox-obj) $(libbusybox-obj:.osm=.om),$(bin-mobj-y))
325endif # CONFIG_FEATURE_SHARED_BUSYBOX 277endif # CONFIG_FEATURE_SHARED_BUSYBOX
326endif # CONFIG_BUILD_AT_ONCE
327
328# build an .a to keep .hash et al small
329ifneq ($(bin-obj-y)$(bin-mobj-y),)
330 applets.a:=$(bin-obj-y) $(bin-mobj-y)
331endif
332ifdef applets.a
333applets.a: $(applets.a)
334 $(Q)-rm -f $(@)
335 $(do_ar)
336 278
337bin-obj.a=applets.a 279endif # CONFIG_BUILD_AT_ONCE
338endif
339 280
340ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) 281ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
341LD_LIBBUSYBOX:=libbusybox.so 282LD_LIBBUSYBOX:=libbusybox.so
@@ -355,6 +296,8 @@ endif # !CONFIG_FEATURE_SHARED_BUSYBOX
355$(LIBBUSYBOX_SONAME): $(LIBRARY_SRC) 296$(LIBBUSYBOX_SONAME): $(LIBRARY_SRC)
356else # CONFIG_BUILD_AT_ONCE 297else # CONFIG_BUILD_AT_ONCE
357$(LIBBUSYBOX_SONAME): $(libbusybox-obj) 298$(LIBBUSYBOX_SONAME): $(libbusybox-obj)
299AR_INTRO:=-Wl,--whole-archive
300AR_EXTRO:=-Wl,--no-whole-archive
358endif # CONFIG_BUILD_AT_ONCE 301endif # CONFIG_BUILD_AT_ONCE
359 302
360 303
@@ -367,12 +310,12 @@ $(LIBBUSYBOX_SONAME):
367ifndef MAJOR_VERSION 310ifndef MAJOR_VERSION
368 $(error MAJOR_VERSION needed for $@ is not defined) 311 $(error MAJOR_VERSION needed for $@ is not defined)
369endif 312endif
370 $(do_link) $(LIB_CFLAGS) $(LIB_LDFLAGS) $(CFLAGS_COMBINE) \ 313 $(do_link) $(LIB_CFLAGS) $(CFLAGS_COMBINE) \
371 -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ 314 -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
372 -Wl,-z,combreloc $(LIB_LDFLAGS) \ 315 -Wl,-z,combreloc $(LIB_LDFLAGS) \
373 -o $(@) \ 316 -o $(@) \
374 -Wl,--start-group \ 317 -Wl,--start-group \
375 $(LIBRARY_DEFINE) $(^) \ 318 $(LIBRARY_DEFINE) $(AR_INTRO) $(^) $(AR_EXTRO) \
376 -Wl,--end-group 319 -Wl,--end-group
377 @rm -f $(DO_INSTALL_LIBS) 320 @rm -f $(DO_INSTALL_LIBS)
378 @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done 321 @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done
@@ -380,14 +323,14 @@ endif
380 323
381endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) 324endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
382 325
383busybox_unstripped: $(top_builddir)/.depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(bin-obj.a) 326busybox_unstripped: $(top_builddir)/.depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y)
384 $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \ 327 $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \
385 $(foreach f,$(^:.o=.c),$(CFLAGS-$(notdir $(patsubst %/$,%,$(dir $(f))))-$(notdir $(f)))) \ 328 $(foreach f,$(^:.o=.c),$(CFLAGS-$(notdir $(patsubst %/$,%,$(dir $(f))))-$(notdir $(f)))) \
386 $(CFLAGS-$(@)) \ 329 $(CFLAGS-$(@)) \
387 -o $@ -Wl,--start-group \ 330 -o $@ -Wl,--start-group \
388 $(APPLETS_DEFINE) $(APPLET_SRC) \ 331 $(APPLETS_DEFINE) $(APPLET_SRC) \
389 $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) \ 332 $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) \
390 $(bin-obj.a) \ 333 $(libraries-y) \
391 $(LDBUSYBOX) $(LIBRARIES) \ 334 $(LDBUSYBOX) $(LIBRARIES) \
392 -Wl,--end-group 335 -Wl,--end-group
393 336
@@ -538,3 +481,4 @@ tags:
538 defconfig allyesconfig allnoconfig allbareconfig \ 481 defconfig allyesconfig allnoconfig allbareconfig \
539 clean distclean \ 482 clean distclean \
540 release tags 483 release tags
484
diff --git a/Rules.mak b/Rules.mak
index 51c9baeab..43a9ef1d2 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -71,6 +71,16 @@ HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
71# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc. 71# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
72LC_ALL:= C 72LC_ALL:= C
73 73
74# initialize flags here
75CFLAGS:=
76CFLAGS_COMBINE:=
77CFLAGS_PIC:=
78LD_FLAGS:=
79LIB_LDFLAGS:=
80PROG_LDFLAGS:=
81PROG_CFLAGS:=
82OPTIMIZATIONS:=
83
74# If you want to add some simple compiler switches (like -march=i686), 84# If you want to add some simple compiler switches (like -march=i686),
75# especially from the command line, use this instead of CFLAGS directly. 85# especially from the command line, use this instead of CFLAGS directly.
76# For optimization overrides, it's better still to set OPTIMIZATIONS. 86# For optimization overrides, it's better still to set OPTIMIZATIONS.
@@ -94,7 +104,7 @@ CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS)))
94WARNINGS=-Wall -Wstrict-prototypes -Wshadow 104WARNINGS=-Wall -Wstrict-prototypes -Wshadow
95CFLAGS+=-I$(top_builddir)/include -I$(top_srcdir)/include 105CFLAGS+=-I$(top_builddir)/include -I$(top_srcdir)/include
96 106
97ARFLAGS=cruP 107ARFLAGS=cru
98 108
99 109
100 110
@@ -149,8 +159,8 @@ __TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
149 ) 159 )
150endif 160endif
151 161
152$(call check_gcc,CFLAGS,-funsigned-char,) 162CFLAGS+=$(call check_gcc,CFLAGS,-funsigned-char,)
153$(call check_gcc,CFLAGS,-mmax-stack-frame=256,) 163CFLAGS+=$(call check_gcc,CFLAGS,-mmax-stack-frame=256,)
154 164
155#-------------------------------------------------------- 165#--------------------------------------------------------
156# Arch specific compiler optimization stuff should go here. 166# Arch specific compiler optimization stuff should go here.
@@ -158,51 +168,51 @@ $(call check_gcc,CFLAGS,-mmax-stack-frame=256,)
158# for OPTIMIZATIONS... 168# for OPTIMIZATIONS...
159 169
160# use '-Os' optimization if available, else use -O2 170# use '-Os' optimization if available, else use -O2
161$(call check_gcc,OPTIMIZATIONS,-Os,-O2) 171OPTIMIZATIONS+=$(call check_gcc,OPTIMIZATIONS,-Os,-O2)
162 172
163# gcc 2.95 exits with 0 for "unrecognized option" 173# gcc 2.95 exits with 0 for "unrecognized option"
164$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\ 174CFLAGS_COMBINE+=$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
165 $(if $(call cc_ge,3,0),\ 175 $(if $(call cc_ge,3,0),\
166 $(call check_gcc,CFLAGS_COMBINE,--combine,))) 176 $(call check_gcc,CFLAGS_COMBINE,--combine,)))
167 177
168$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\ 178OPTIMIZATIONS+=$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
169 $(call check_gcc,OPTIMIZATIONS,-funit-at-a-time,)) 179 $(call check_gcc,OPTIMIZATIONS,-funit-at-a-time,))
170 180
171# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25795 181# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25795
172#$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\ 182#PROG_CFLAGS+=$(if $(call is_eq,$(CONFIG_BUILD_AT_ONCE),y),\
173# $(call check_gcc,PROG_CFLAGS,-fwhole-program,)) 183# $(call check_gcc,PROG_CFLAGS,-fwhole-program,))
174 184
175$(call check_ld,LIB_LDFLAGS,--enable-new-dtags,) 185LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--enable-new-dtags,)
176#$(call check_ld,LIB_LDFLAGS,--reduce-memory-overheads,) 186#LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--reduce-memory-overheads,)
177#$(call check_ld,LIB_LDFLAGS,--as-needed,) 187#LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--as-needed,)
178#$(call check_ld,LIB_LDFLAGS,--warn-shared-textrel,) 188#LIB_LDFLAGS+=$(call check_ld,LIB_LDFLAGS,--warn-shared-textrel,)
179 189
180$(call check_ld,PROG_LDFLAGS,--gc-sections,) 190PROG_LDFLAGS+=$(call check_ld,PROG_LDFLAGS,--gc-sections,)
181 191
182# Some nice architecture specific optimizations 192# Some nice architecture specific optimizations
183ifeq ($(__TARGET_ARCH),arm) 193ifeq ($(__TARGET_ARCH),arm)
184 OPTIMIZATIONS+=-fstrict-aliasing 194 OPTIMIZATIONS+=-fstrict-aliasing
185endif # arm 195endif # arm
186 196
187$(if $(call is_eq,$(__TARGET_ARCH),i386),\ 197OPTIMIZATIONS+=$(if $(call is_eq,$(__TARGET_ARCH),i386),\
188 $(call check_gcc,OPTIMIZATIONS,-march=i386,)) 198 $(call check_gcc,OPTIMIZATIONS,-march=i386,))
189 199
190# gcc-4.0 and older seem to benefit from these 200# gcc-4.0 and older seem to benefit from these
191$(if $(call cc_le,4,0),\ 201OPTIMIZATIONS+=$(if $(call cc_le,4,0),\
192 $(call check_gcc,OPTIMIZATIONS,-mpreferred-stack-boundary=2,)\ 202 $(call check_gcc,OPTIMIZATIONS,-mpreferred-stack-boundary=2,)\
193 $(call check_gcc,OPTIMIZATIONS,-falign-functions=1 -falign-jumps=1 -falign-loops=1,\ 203 $(call check_gcc,OPTIMIZATIONS,-falign-functions=1 -falign-jumps=1 -falign-loops=1,\
194 -malign-functions=0 -malign-jumps=0 -malign-loops=0)) 204 -malign-functions=0 -malign-jumps=0 -malign-loops=0))
195 205
196# gcc-4.1 and beyond seem to benefit from these 206# gcc-4.1 and beyond seem to benefit from these
197# turn off flags which hurt -Os 207# turn off flags which hurt -Os
198$(if $(call cc_ge,4,1),\ 208OPTIMIZATIONS+=$(if $(call cc_ge,4,1),\
199 $(call check_gcc,OPTIMIZATIONS,-fno-tree-loop-optimize,)\ 209 $(call check_gcc,OPTIMIZATIONS,-fno-tree-loop-optimize,)\
200 $(call check_gcc,OPTIMIZATIONS,-fno-tree-dominator-opts,)\ 210 $(call check_gcc,OPTIMIZATIONS,-fno-tree-dominator-opts,)\
201 $(call check_gcc,OPTIMIZATIONS,-fno-strength-reduce,)\ 211 $(call check_gcc,OPTIMIZATIONS,-fno-strength-reduce,)\
202\ 212\
203 $(call check_gcc,OPTIMIZATIONS,-fno-branch-count-reg,)) 213 $(call check_gcc,OPTIMIZATIONS,-fno-branch-count-reg,))
204 214
205$(call check_gcc,OPTIMIZATIONS,-fomit-frame-pointer,) 215OPTIMIZATIONS+=$(call check_gcc,OPTIMIZATIONS,-fomit-frame-pointer,)
206 216
207# 217#
208#-------------------------------------------------------- 218#--------------------------------------------------------
@@ -227,9 +237,7 @@ else
227 endif 237 endif
228endif 238endif
229 239
230$(if $(call is_eq,$(CONFIG_DEBUG),y),\ 240LDFLAGS+=$(if $(call is_eq,$(CONFIG_DEBUG),y),$(call check_ld,LDFLAGS,--warn-common,)$(call check_ld,LDFLAGS,--sort-common,))
231 $(call check_ld,LDFLAGS,--warn-common,),\
232 $(call check_ld,LDFLAGS,--warn-common,)$(call check_ld,LDFLAGS,--sort-common,))
233ifeq ($(CONFIG_DEBUG),y) 241ifeq ($(CONFIG_DEBUG),y)
234 CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE 242 CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
235 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging 243 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
@@ -237,14 +245,15 @@ else
237 CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG 245 CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
238 STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment 246 STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
239endif 247endif
240$(if $(call is_eq,$(CONFIG_STATIC),y),\ 248PROG_CFLAGS+=$(if $(call is_eq,$(CONFIG_STATIC),y),\
241 $(call check_gcc,PROG_CFLAGS,-static,)) 249 $(call check_gcc,PROG_CFLAGS,-static,))
242 250
243$(call check_gcc,CFLAGS_SHARED,-shared,) 251CFLAGS_SHARED+=$(call check_gcc,CFLAGS_SHARED,-shared,)
244LIB_CFLAGS+=$(CFLAGS_SHARED) 252LIB_CFLAGS+=$(CFLAGS_SHARED)
245 253
246$(if $(call is_eq,$(CONFIG_BUILD_LIBBUSYBOX),y),\ 254CFLAGS_PIC+=$(if $(call is_eq,$(CONFIG_BUILD_LIBBUSYBOX),y),\
247 $(call check_gcc,CFLAGS_PIC,-fPIC,)) 255 $(call check_gcc,CFLAGS_PIC,-fPIC,))
256LIB_CFLAGS+=$(CFLAGS_PIC)
248 257
249ifeq ($(CONFIG_SELINUX),y) 258ifeq ($(CONFIG_SELINUX),y)
250 LIBRARIES += -lselinux 259 LIBRARIES += -lselinux
@@ -379,12 +388,11 @@ ifdef rules-mak-rules
379.SUFFIXES: .c .S .o .os .om .osm .oS .so .a .s .i .E 388.SUFFIXES: .c .S .o .os .om .osm .oS .so .a .s .i .E
380 389
381# generic rules 390# generic rules
382%.o: %.c ; $(compile.c)
383%.os: %.c ; $(compile.c) $(CFLAGS_PIC)
384%.o: ; $(compile.c) 391%.o: ; $(compile.c)
385%.os: ; $(compile.c) $(CFLAGS_PIC) 392%.os: ; $(compile.c) $(CFLAGS_PIC)
386%.om: ; $(compile.m) 393%.om: ; $(compile.m)
387%.osm: ; $(compile.m) $(CFLAGS_PIC) 394%.osm: ; $(compile.m) $(CFLAGS_PIC)
395%.a: ; $(do_ar)
388 396
389endif # rules-mak-rules 397endif # rules-mak-rules
390 398
diff --git a/applets/Makefile.in b/applets/Makefile.in
index 64aefc017..391b4658c 100644
--- a/applets/Makefile.in
+++ b/applets/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/applets 7srcdir:=$(top_srcdir)/applets
8objdir=$(top_builddir)/applets 8objdir:=$(top_builddir)/applets
9 9
10APPLETS_SRC:= $(patsubst %,$(srcdir)/%,applets.c busybox.c version.c) 10APPLETS_SRC:= $(patsubst %,$(srcdir)/%,applets.c busybox.c version.c)
11 11
@@ -14,3 +14,7 @@ APPLET_SRC-a+=$(APPLETS_SRC)
14 14
15applets_OBJ:=$(patsubst $(srcdir)/%.c,$(objdir)/%.o,$(APPLETS_SRC)) 15applets_OBJ:=$(patsubst $(srcdir)/%.c,$(objdir)/%.o,$(APPLETS_SRC))
16 16
17$(applets_OBJ): $(objdir)/%.o: $(srcdir)/%.c
18$(objdir)/applets.a: $(applets_OBJ)
19libraries-y:=$(libraries-y) $(objdir)/applets.a
20
diff --git a/archival/Makefile.in b/archival/Makefile.in
index 6a2979e67..8a7b3bd4a 100644
--- a/archival/Makefile.in
+++ b/archival/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/archival 7srcdir:=$(top_srcdir)/archival
8objdir=$(top_builddir)/archival 8objdir:=$(top_builddir)/archival
9 9
10ARCHIVAL-$(CONFIG_AR) += ar.o 10ARCHIVAL-$(CONFIG_AR) += ar.o
11ARCHIVAL-$(CONFIG_BUNZIP2) += bunzip2.o 11ARCHIVAL-$(CONFIG_BUNZIP2) += bunzip2.o
@@ -28,3 +28,7 @@ APPLET_SRC-a+=$(ARCHIVAL_SRC-a)
28 28
29archival_OBJ:= $(patsubst %,$(objdir)/%,$(ARCHIVAL-y)) 29archival_OBJ:= $(patsubst %,$(objdir)/%,$(ARCHIVAL-y))
30 30
31$(archival_OBJ): $(objdir)/%.o: $(srcdir)/%.c
32$(objdir)/archival.a: $(archival_OBJ)
33libraries-y:=$(libraries-y) $(objdir)/archival.a
34
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in
index 75d761036..d77aff736 100644
--- a/archival/libunarchive/Makefile.in
+++ b/archival/libunarchive/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/archival/libunarchive 7srcdir:=$(top_srcdir)/archival/libunarchive
8objdir=$(top_builddir)/archival/libunarchive 8objdir:=$(top_builddir)/archival/libunarchive
9 9
10LIBUNARCHIVE-y:= \ 10LIBUNARCHIVE-y:= \
11\ 11\
@@ -71,3 +71,7 @@ LIBRARY_SRC-a+=$(LIBUNARCHIVE_SRC-a)
71 71
72archival_libunarchive_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBUNARCHIVE-y)) 72archival_libunarchive_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBUNARCHIVE-y))
73 73
74$(archival_libunarchive_OBJ$(os)): $(objdir)/%$(os): $(srcdir)/%.c
75$(objdir)/libunarchive.a: $(archival_libunarchive_OBJ$(os))
76libraries-y:=$(libraries-y) $(objdir)/libunarchive.a
77
diff --git a/console-tools/Makefile.in b/console-tools/Makefile.in
index e10bc4f78..7994e0f08 100644
--- a/console-tools/Makefile.in
+++ b/console-tools/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/console-tools 7srcdir:=$(top_srcdir)/console-tools
8objdir=$(top_builddir)/console-tools 8objdir:=$(top_builddir)/console-tools
9 9
10CONSOLETOOLS-$(CONFIG_CHVT) += chvt.o 10CONSOLETOOLS-$(CONFIG_CHVT) += chvt.o
11CONSOLETOOLS-$(CONFIG_CLEAR) += clear.o 11CONSOLETOOLS-$(CONFIG_CLEAR) += clear.o
@@ -26,3 +26,7 @@ APPLET_SRC-a+=$(CONSOLETOOLS_SRC-a)
26 26
27console-tools_OBJ:= $(patsubst %,$(objdir)/%,$(CONSOLETOOLS-y)) 27console-tools_OBJ:= $(patsubst %,$(objdir)/%,$(CONSOLETOOLS-y))
28 28
29$(console-tools_OBJ): $(objdir)/%.o: $(srcdir)/%.c
30$(objdir)/console-tools.a: $(console-tools_OBJ)
31libraries-y:=$(libraries-y) $(objdir)/console-tools.a
32
diff --git a/coreutils/Makefile.in b/coreutils/Makefile.in
index 5f8a0ac52..73581f2aa 100644
--- a/coreutils/Makefile.in
+++ b/coreutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/coreutils 7srcdir:=$(top_srcdir)/coreutils
8objdir=$(top_builddir)/coreutils 8objdir:=$(top_builddir)/coreutils
9 9
10COREUTILS-$(CONFIG_BASENAME) += basename.o 10COREUTILS-$(CONFIG_BASENAME) += basename.o
11COREUTILS-$(CONFIG_CAL) += cal.o 11COREUTILS-$(CONFIG_CAL) += cal.o
@@ -86,3 +86,7 @@ APPLET_SRC-a+=$(COREUTILS_SRC-a)
86 86
87coreutils_OBJ:= $(patsubst %,$(objdir)/%,$(COREUTILS-y)) 87coreutils_OBJ:= $(patsubst %,$(objdir)/%,$(COREUTILS-y))
88 88
89$(coreutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
90$(objdir)/coreutils.a: $(coreutils_OBJ)
91libraries-y:=$(libraries-y) $(objdir)/coreutils.a
92
diff --git a/coreutils/libcoreutils/Makefile.in b/coreutils/libcoreutils/Makefile.in
index 700341c97..d89e9d049 100644
--- a/coreutils/libcoreutils/Makefile.in
+++ b/coreutils/libcoreutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/coreutils/libcoreutils 7srcdir:=$(top_srcdir)/coreutils/libcoreutils
8objdir=$(top_builddir)/coreutils/libcoreutils 8objdir:=$(top_builddir)/coreutils/libcoreutils
9 9
10LIBCOREUTILS-$(CONFIG_MKFIFO) += getopt_mk_fifo_nod 10LIBCOREUTILS-$(CONFIG_MKFIFO) += getopt_mk_fifo_nod
11LIBCOREUTILS-$(CONFIG_MKNOD) += getopt_mk_fifo_nod 11LIBCOREUTILS-$(CONFIG_MKNOD) += getopt_mk_fifo_nod
@@ -21,3 +21,8 @@ LIBRARY_SRC-y+=$(LIBCOREUTILS_SRC-y)
21LIBRARY_SRC-a+=$(LIBCOREUTILS_SRC-a) 21LIBRARY_SRC-a+=$(LIBCOREUTILS_SRC-a)
22 22
23coreutils_libcoreutils_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBCOREUTILS-y)) 23coreutils_libcoreutils_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBCOREUTILS-y))
24
25$(coreutils_libcoreutils_OBJ$(os)): $(objdir)/%$(os): $(srcdir)/%.c
26$(objdir)/libcoreutils.a: $(coreutils_libcoreutils_OBJ$(os))
27libraries-y:=$(libraries-y) $(objdir)/libcoreutils.a
28
diff --git a/debianutils/Makefile.in b/debianutils/Makefile.in
index ffdb7abdc..4f72c233c 100644
--- a/debianutils/Makefile.in
+++ b/debianutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/debianutils 7srcdir:=$(top_srcdir)/debianutils
8objdir=$(top_builddir)/debianutils 8objdir:=$(top_builddir)/debianutils
9 9
10DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o 10DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
11DEBIANUTILS-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o 11DEBIANUTILS-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o
@@ -21,3 +21,7 @@ APPLET_SRC-a+=$(DEBIANUTILS_SRC-a)
21 21
22debianutils_OBJ:= $(patsubst %,$(objdir)/%,$(DEBIANUTILS-y)) 22debianutils_OBJ:= $(patsubst %,$(objdir)/%,$(DEBIANUTILS-y))
23 23
24$(debianutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
25$(objdir)/debianutils.a: $(debianutils_OBJ)
26libraries-y:=$(libraries-y) $(objdir)/debianutils.a
27
diff --git a/e2fsprogs/Makefile.in b/e2fsprogs/Makefile.in
index c30318b67..0ca1c976d 100644
--- a/e2fsprogs/Makefile.in
+++ b/e2fsprogs/Makefile.in
@@ -45,14 +45,7 @@ $(patsubst %,$(objdir)/%, blkid e2fsck e2p ext2fs uuid):
45# may have object files created after the timestamp of the directory was 45# may have object files created after the timestamp of the directory was
46# updated which would lead to spurious rebuilds (as some of the dentries 46# updated which would lead to spurious rebuilds (as some of the dentries
47# may be older than the dir itself). 47# may be older than the dir itself).
48ifneq ($(MAKE_VERSION),3.81beta4) 48ifeq ($(MAKE_VERSION),3.81beta4)
49# /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/dir/file.c
50$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c |$(objdir)/blkid
51$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c|$(objdir)/e2fsck
52$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c |$(objdir)/e2p
53$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c|$(objdir)/ext2fs
54$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c |$(objdir)/uuid
55else
56# alleged bug in 3.81beta4. Stripping dir from dir/files.c 49# alleged bug in 3.81beta4. Stripping dir from dir/files.c
57# /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/file.c 50# /top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/file.c
58$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/%.c |$(objdir)/blkid 51$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/%.c |$(objdir)/blkid
@@ -60,8 +53,40 @@ $(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/%.c|$(ob
60$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/%.c |$(objdir)/e2p 53$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/%.c |$(objdir)/e2p
61$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/%.c|$(objdir)/ext2fs 54$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/%.c|$(objdir)/ext2fs
62$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/%.c |$(objdir)/uuid 55$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/%.c |$(objdir)/uuid
56
57e2fsprogs-rules-seen:=1
58endif
59
60ifeq ($(MAKE_VERSION),3.79.1)
61# no order-only prerequesites
62$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c #|$(objdir)/blkid
63$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c#|$(objdir)/e2fsck
64$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c #|$(objdir)/e2p
65$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c#|$(objdir)/ext2fs
66$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c #|$(objdir)/uuid
67$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid
68$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck
69$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p
70$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs
71$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid
72$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid
73$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck
74$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p
75$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs
76$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid
77
78e2fsprogs-rules-seen:=1
63endif 79endif
64 80
81ifndef e2fsprogs-rules-seen
82$(patsubst %,$(objdir)/%,$(BLKID_OBJS)): $(objdir)/blkid/%.o: $(srcdir)/blkid/%.c |$(objdir)/blkid
83$(patsubst %,$(objdir)/%,$(E2FSCK_OBJS)):$(objdir)/e2fsck/%.o:$(srcdir)/e2fsck/%.c|$(objdir)/e2fsck
84$(patsubst %,$(objdir)/%,$(E2P_OBJS)): $(objdir)/e2p/%.o: $(srcdir)/e2p/%.c |$(objdir)/e2p
85$(patsubst %,$(objdir)/%,$(EXT2FS_OBJS)):$(objdir)/ext2fs/%.o:$(srcdir)/ext2fs/%.c|$(objdir)/ext2fs
86$(patsubst %,$(objdir)/%,$(UUID_OBJS)): $(objdir)/uuid/%.o: $(srcdir)/uuid/%.c |$(objdir)/uuid
87endif
88
89
65E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS) 90E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
66E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS) 91E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
67E2FSPROGS-$(CONFIG_FSCK) += fsck.o util.o $(BLKID_OBJS) $(UUID_OBJS) 92E2FSPROGS-$(CONFIG_FSCK) += fsck.o util.o $(BLKID_OBJS) $(UUID_OBJS)
@@ -93,3 +118,7 @@ APPLETS_DEFINE-a+=$(CFLAGS-e2fsprogs) -I$(srcdir) $(E2FSPROGS_TMP_KLUDGE)
93 118
94e2fsprogs_OBJ:= $(patsubst %,$(objdir)/%,$(E2FSPROGS-y)) 119e2fsprogs_OBJ:= $(patsubst %,$(objdir)/%,$(E2FSPROGS-y))
95 120
121$(e2fsprogs_OBJ): $(objdir)/%.o: $(srcdir)/%.c
122$(objdir)/e2fsprogs.a: $(e2fsprogs_OBJ)
123libraries-y:=$(libraries-y) $(objdir)/e2fsprogs.a
124
diff --git a/editors/Makefile.in b/editors/Makefile.in
index 19d8bf8e6..dd09e7a21 100644
--- a/editors/Makefile.in
+++ b/editors/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/editors 7srcdir:=$(top_srcdir)/editors
8objdir=$(top_builddir)/editors 8objdir:=$(top_builddir)/editors
9 9
10EDITORS-$(CONFIG_AWK) += awk.o 10EDITORS-$(CONFIG_AWK) += awk.o
11EDITORS-$(CONFIG_PATCH) += patch.o 11EDITORS-$(CONFIG_PATCH) += patch.o
@@ -26,3 +26,7 @@ APPLET_SRC-a+=$(EDITOR_SRC-a)
26 26
27editors_OBJ:= $(patsubst %,$(objdir)/%,$(EDITORS-y)) 27editors_OBJ:= $(patsubst %,$(objdir)/%,$(EDITORS-y))
28 28
29$(editors_OBJ): $(objdir)/%.o: $(srcdir)/%.c
30$(objdir)/editors.a: $(editors_OBJ)
31libraries-y:=$(libraries-y) $(objdir)/editors.a
32
diff --git a/findutils/Makefile.in b/findutils/Makefile.in
index d268f987d..7fbf8d4b9 100644
--- a/findutils/Makefile.in
+++ b/findutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/findutils 7srcdir:=$(top_srcdir)/findutils
8objdir=$(top_builddir)/findutils 8objdir:=$(top_builddir)/findutils
9 9
10FINDUTILS-$(CONFIG_FIND) += find.o 10FINDUTILS-$(CONFIG_FIND) += find.o
11FINDUTILS-$(CONFIG_GREP) += grep.o 11FINDUTILS-$(CONFIG_GREP) += grep.o
@@ -18,3 +18,7 @@ APPLET_SRC-a+=$(FINDUTILS_SRC-a)
18 18
19findutils_OBJ:= $(patsubst %,$(objdir)/%,$(FINDUTILS-y)) 19findutils_OBJ:= $(patsubst %,$(objdir)/%,$(FINDUTILS-y))
20 20
21$(findutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
22$(objdir)/findutils.a: $(findutils_OBJ)
23libraries-y:=$(libraries-y) $(objdir)/findutils.a
24
diff --git a/init/Makefile.in b/init/Makefile.in
index a07c2189b..ef5eb1c58 100644
--- a/init/Makefile.in
+++ b/init/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/init 7srcdir:=$(top_srcdir)/init
8objdir=$(top_builddir)/init 8objdir:=$(top_builddir)/init
9 9
10INIT-$(CONFIG_HALT) += halt.o 10INIT-$(CONFIG_HALT) += halt.o
11INIT-$(CONFIG_INIT) += init.o 11INIT-$(CONFIG_INIT) += init.o
@@ -30,3 +30,7 @@ APPLET_SRC-a+=$(INIT_SRC-a)
30 30
31init_OBJ:= $(patsubst %,$(objdir)/%,$(INIT-y)) 31init_OBJ:= $(patsubst %,$(objdir)/%,$(INIT-y))
32 32
33$(init_OBJ): $(objdir)/%.o: $(srcdir)/%.c
34$(objdir)/init.a: $(init_OBJ)
35libraries-y:=$(libraries-y) $(objdir)/init.a
36
diff --git a/libbb/Makefile.in b/libbb/Makefile.in
index d4cc7646a..b4ee3f501 100644
--- a/libbb/Makefile.in
+++ b/libbb/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/libbb 7srcdir:=$(top_srcdir)/libbb
8objdir=$(top_builddir)/libbb 8objdir:=$(top_builddir)/libbb
9 9
10LIBBB-n:= 10LIBBB-n:=
11LIBBB-y:= \ 11LIBBB-y:= \
@@ -146,3 +146,8 @@ $(LIBBB_MOBJ5:.osm=.om): $(LIBBB_MSRC5)
146$(LIBBB_MOBJ6:.osm=.om): $(LIBBB_MSRC6) 146$(LIBBB_MOBJ6:.osm=.om): $(LIBBB_MSRC6)
147endif 147endif
148 148
149$(libbb_OBJ.os): $(objdir)/%.os: $(srcdir)/%.c
150$(libbb_OBJ.o): $(objdir)/%.o: $(srcdir)/%.c
151$(objdir)/libbb.a: $(libbb_OBJ$(os)) $(libbb_MOBJ$(os))
152libraries-y:=$(libraries-y) $(objdir)/libbb.a
153
diff --git a/libpwdgrp/Makefile.in b/libpwdgrp/Makefile.in
index 93c4634a2..a99d3d86f 100644
--- a/libpwdgrp/Makefile.in
+++ b/libpwdgrp/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/libpwdgrp 7srcdir:=$(top_srcdir)/libpwdgrp
8objdir=$(top_builddir)/libpwdgrp 8objdir:=$(top_builddir)/libpwdgrp
9 9
10LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c 10LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c
11LIBPWDGRP_M0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r fgetgrent_r \ 11LIBPWDGRP_M0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r fgetgrent_r \
@@ -43,3 +43,7 @@ ifeq ($(om),.osm)
43$(LIBPWDGRP_MOBJ0:.osm=.om): $(LIBPWDGRP_MSRC0) 43$(LIBPWDGRP_MOBJ0:.osm=.om): $(LIBPWDGRP_MSRC0)
44$(LIBPWDGRP_MOBJ1:.osm=.om): $(LIBPWDGRP_MSRC1) 44$(LIBPWDGRP_MOBJ1:.osm=.om): $(LIBPWDGRP_MSRC1)
45endif 45endif
46
47$(objdir)/libpwdgrp.a: $(libpwdgrp_MOBJ$(os))
48libraries-y:=$(libraries-y) $(objdir)/libpwdgrp.a
49
diff --git a/loginutils/Makefile.in b/loginutils/Makefile.in
index dfbba5019..959cb4f57 100644
--- a/loginutils/Makefile.in
+++ b/loginutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/loginutils 7srcdir:=$(top_srcdir)/loginutils
8objdir=$(top_builddir)/loginutils 8objdir:=$(top_builddir)/loginutils
9 9
10LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o 10LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o
11LOGINUTILS-$(CONFIG_ADDUSER) += adduser.o 11LOGINUTILS-$(CONFIG_ADDUSER) += adduser.o
@@ -36,3 +36,7 @@ endif
36 36
37loginutils_OBJ:= $(patsubst %,$(objdir)/%,$(LOGINUTILS-y)) 37loginutils_OBJ:= $(patsubst %,$(objdir)/%,$(LOGINUTILS-y))
38 38
39$(loginutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
40$(objdir)/loginutils.a: $(loginutils_OBJ)
41libraries-y:=$(libraries-y) $(objdir)/loginutils.a
42
diff --git a/miscutils/Makefile.in b/miscutils/Makefile.in
index 12b4f05a4..4f9de7c93 100644
--- a/miscutils/Makefile.in
+++ b/miscutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/miscutils 7srcdir:=$(top_srcdir)/miscutils
8objdir=$(top_builddir)/miscutils 8objdir:=$(top_builddir)/miscutils
9 9
10MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o 10MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
11MISCUTILS-$(CONFIG_CROND) += crond.o 11MISCUTILS-$(CONFIG_CROND) += crond.o
@@ -40,3 +40,7 @@ APPLET_SRC-a+=$(MISCUTILS_SRC-a)
40 40
41miscutils_OBJ:= $(patsubst %,$(objdir)/%,$(MISCUTILS-y)) 41miscutils_OBJ:= $(patsubst %,$(objdir)/%,$(MISCUTILS-y))
42 42
43$(miscutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
44$(objdir)/miscutils.a: $(miscutils_OBJ)
45libraries-y:=$(libraries-y) $(objdir)/miscutils.a
46
diff --git a/modutils/Makefile.in b/modutils/Makefile.in
index fc7e4ff8e..a59b29d76 100644
--- a/modutils/Makefile.in
+++ b/modutils/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/modutils 7srcdir:=$(top_srcdir)/modutils
8objdir=$(top_builddir)/modutils 8objdir:=$(top_builddir)/modutils
9 9
10MODUTILS-$(CONFIG_INSMOD) += insmod.o 10MODUTILS-$(CONFIG_INSMOD) += insmod.o
11MODUTILS-$(CONFIG_LSMOD) += lsmod.o 11MODUTILS-$(CONFIG_LSMOD) += lsmod.o
@@ -19,3 +19,7 @@ APPLET_SRC-a+=$(MODUTILS_SRC-a)
19 19
20modutils_OBJ:= $(patsubst %,$(objdir)/%,$(MODUTILS-y)) 20modutils_OBJ:= $(patsubst %,$(objdir)/%,$(MODUTILS-y))
21 21
22$(modutils_OBJ): $(objdir)/%.o: $(srcdir)/%.c
23$(objdir)/modutils.a: $(modutils_OBJ)
24libraries-y:=$(libraries-y) $(objdir)/modutils.a
25
diff --git a/networking/Makefile.in b/networking/Makefile.in
index efad05053..80cfd1733 100644
--- a/networking/Makefile.in
+++ b/networking/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/networking 7srcdir:=$(top_srcdir)/networking
8objdir=$(top_builddir)/networking 8objdir:=$(top_builddir)/networking
9 9
10NETWORKING-$(CONFIG_ARPING) += arping.o 10NETWORKING-$(CONFIG_ARPING) += arping.o
11NETWORKING-$(CONFIG_DNSD) += dnsd.o 11NETWORKING-$(CONFIG_DNSD) += dnsd.o
@@ -57,3 +57,7 @@ LIBRARY_DEFINE-a+= -I$(top_srcdir)/networking
57 57
58networking_OBJ:= $(patsubst %,$(objdir)/%,$(NETWORKING-y)) 58networking_OBJ:= $(patsubst %,$(objdir)/%,$(NETWORKING-y))
59 59
60$(networking_OBJ): $(objdir)/%.o: $(srcdir)/%.c
61$(objdir)/networking.a: $(networking_OBJ)
62libraries-y:=$(libraries-y) $(objdir)/networking.a
63
diff --git a/networking/libiproute/Makefile.in b/networking/libiproute/Makefile.in
index 99fa22e9d..2fee2796d 100644
--- a/networking/libiproute/Makefile.in
+++ b/networking/libiproute/Makefile.in
@@ -3,10 +3,9 @@
3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6#
7 6
8srcdir=$(top_srcdir)/networking/libiproute 7srcdir:=$(top_srcdir)/networking/libiproute
9objdir=$(top_builddir)/networking/libiproute 8objdir:=$(top_builddir)/networking/libiproute
10 9
11LIBIPROUTE-$(CONFIG_IP) += \ 10LIBIPROUTE-$(CONFIG_IP) += \
12 ip_parse_common_args \ 11 ip_parse_common_args \
@@ -68,3 +67,7 @@ LIBRARY_SRC-a+=$(LIBIPROUTE_SRC-a)
68 67
69networking_libiproute_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBIPROUTE-y)) 68networking_libiproute_OBJ$(os):=$(patsubst %,$(objdir)/%$(os),$(LIBIPROUTE-y))
70 69
70$(networking_libiproute_OBJ$(os)): $(objdir)/%$(os): $(srcdir)/%.c
71$(objdir)/networking.a: $(networking_libiproute_OBJ$(os))
72libraries-y:=$(libraries-y) $(objdir)/networking.a
73
diff --git a/networking/udhcp/Makefile.in b/networking/udhcp/Makefile.in
index ca00b647d..210939fd6 100644
--- a/networking/udhcp/Makefile.in
+++ b/networking/udhcp/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 5# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/networking/udhcp 7srcdir:=$(top_srcdir)/networking/udhcp
8objdir=$(top_builddir)/networking/udhcp 8objdir:=$(top_builddir)/networking/udhcp
9 9
10#ok, so I forgot how to do an or, but this is a quick and dirty hack 10#ok, so I forgot how to do an or, but this is a quick and dirty hack
11ifeq ($(strip $(CONFIG_UDHCPC)),y) 11ifeq ($(strip $(CONFIG_UDHCPC)),y)
@@ -88,3 +88,7 @@ endif
88 88
89networking_udhcp_OBJ:=$(patsubst %.c,$(objdir)/%.o,$(UDHCP-y)) 89networking_udhcp_OBJ:=$(patsubst %.c,$(objdir)/%.o,$(UDHCP-y))
90 90
91$(networking_udhcp_OBJ): $(objdir)/%.o: $(srcdir)/%.c
92$(objdir)/udhcp.a: $(networking_udhcp_OBJ)
93libraries-y:=$(libraries-y) $(objdir)/udhcp.a
94
diff --git a/procps/Makefile.in b/procps/Makefile.in
index 32314c3c5..69455eb26 100644
--- a/procps/Makefile.in
+++ b/procps/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/procps 7srcdir:=$(top_srcdir)/procps
8objdir=$(top_builddir)/procps 8objdir:=$(top_builddir)/procps
9 9
10PROCPS-$(CONFIG_FREE) += free.o 10PROCPS-$(CONFIG_FREE) += free.o
11PROCPS-$(CONFIG_KILL) += kill.o 11PROCPS-$(CONFIG_KILL) += kill.o
@@ -25,3 +25,7 @@ APPLET_SRC-a+=$(PROCPS_SRC-a)
25 25
26procps_OBJ:= $(patsubst %,$(objdir)/%,$(PROCPS-y)) 26procps_OBJ:= $(patsubst %,$(objdir)/%,$(PROCPS-y))
27 27
28$(procps_OBJ): $(objdir)/%.o: $(srcdir)/%.c
29$(objdir)/procps.a: $(procps_OBJ)
30libraries-y:=$(libraries-y) $(objdir)/procps.a
31
diff --git a/shell/Makefile.in b/shell/Makefile.in
index 43e2acd09..94cf729a7 100644
--- a/shell/Makefile.in
+++ b/shell/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/shell 7srcdir:=$(top_srcdir)/shell
8objdir=$(top_builddir)/shell 8objdir:=$(top_builddir)/shell
9 9
10SHELL-$(CONFIG_ASH) += ash.o 10SHELL-$(CONFIG_ASH) += ash.o
11SHELL-$(CONFIG_HUSH) += hush.o 11SHELL-$(CONFIG_HUSH) += hush.o
@@ -21,3 +21,7 @@ APPLET_SRC-a+=$(SHELLT_SRC-a)
21 21
22shell_OBJ:= $(patsubst %,$(objdir)/%,$(SHELL-y)) 22shell_OBJ:= $(patsubst %,$(objdir)/%,$(SHELL-y))
23 23
24$(shell_OBJ): $(objdir)/%.o: $(srcdir)/%.c
25$(objdir)/shell.a: $(shell_OBJ)
26libraries-y:=$(libraries-y) $(objdir)/shell.a
27
diff --git a/sysklogd/Makefile.in b/sysklogd/Makefile.in
index d1f274110..412cf5bab 100644
--- a/sysklogd/Makefile.in
+++ b/sysklogd/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/sysklogd 7srcdir:=$(top_srcdir)/sysklogd
8objdir=$(top_builddir)/sysklogd 8objdir:=$(top_builddir)/sysklogd
9 9
10SYSKLOGD-$(CONFIG_KLOGD) += klogd.o 10SYSKLOGD-$(CONFIG_KLOGD) += klogd.o
11SYSKLOGD-$(CONFIG_LOGGER) += logger.o 11SYSKLOGD-$(CONFIG_LOGGER) += logger.o
@@ -20,3 +20,7 @@ APPLET_SRC-a+=$(SYSKLOGD_SRC-a)
20 20
21sysklogd_OBJ:= $(patsubst %,$(objdir)/%,$(SYSKLOGD-y)) 21sysklogd_OBJ:= $(patsubst %,$(objdir)/%,$(SYSKLOGD-y))
22 22
23$(sysklogd_OBJ): $(objdir)/%.o: $(srcdir)/%.c
24$(objdir)/sysklogd.a: $(sysklogd_OBJ)
25libraries-y:=$(libraries-y) $(objdir)/sysklogd.a
26
diff --git a/util-linux/Makefile.in b/util-linux/Makefile.in
index 031c798a0..b56a7766e 100644
--- a/util-linux/Makefile.in
+++ b/util-linux/Makefile.in
@@ -4,8 +4,8 @@
4# 4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball. 5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6 6
7srcdir=$(top_srcdir)/util-linux 7srcdir:=$(top_srcdir)/util-linux
8objdir=$(top_builddir)/util-linux 8objdir:=$(top_builddir)/util-linux
9 9
10UTIL-LINUX-$(CONFIG_DMESG) +=dmesg.o 10UTIL-LINUX-$(CONFIG_DMESG) +=dmesg.o
11UTIL-LINUX-$(CONFIG_FBSET) +=fbset.o 11UTIL-LINUX-$(CONFIG_FBSET) +=fbset.o
@@ -48,3 +48,7 @@ endif
48 48
49util-linux_OBJ:= $(patsubst %,$(objdir)/%,$(UTIL-LINUX-y)) 49util-linux_OBJ:= $(patsubst %,$(objdir)/%,$(UTIL-LINUX-y))
50 50
51$(util-linux_OBJ): $(objdir)/%.o: $(srcdir)/%.c
52$(objdir)/util-linux.a: $(util-linux_OBJ)
53libraries-y:=$(libraries-y) $(objdir)/util-linux.a
54