aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile145
-rw-r--r--Rules.mak10
-rw-r--r--applets/Makefile12
-rw-r--r--applets/Makefile.in11
-rw-r--r--archival/Makefile12
-rw-r--r--archival/Makefile.in6
-rw-r--r--archival/libunarchive/Makefile12
-rw-r--r--archival/libunarchive/Makefile.in6
-rw-r--r--console-tools/Makefile12
-rw-r--r--console-tools/Makefile.in6
-rw-r--r--coreutils/Makefile12
-rw-r--r--coreutils/Makefile.in7
-rw-r--r--coreutils/libcoreutils/Makefile13
-rw-r--r--coreutils/libcoreutils/Makefile.in7
-rw-r--r--debianutils/Makefile12
-rw-r--r--debianutils/Makefile.in7
-rw-r--r--editors/Makefile12
-rw-r--r--editors/Makefile.in6
-rw-r--r--findutils/Makefile12
-rw-r--r--findutils/Makefile.in6
-rw-r--r--init/Makefile12
-rw-r--r--init/Makefile.in6
-rw-r--r--libbb/Makefile10
-rw-r--r--libbb/Makefile.in18
-rw-r--r--libpwdgrp/Makefile10
-rw-r--r--libpwdgrp/Makefile.in7
-rw-r--r--loginutils/Makefile10
-rw-r--r--loginutils/Makefile.in6
-rw-r--r--miscutils/Makefile10
-rw-r--r--miscutils/Makefile.in7
-rw-r--r--modutils/Makefile10
-rw-r--r--modutils/Makefile.in6
-rw-r--r--networking/Makefile10
-rw-r--r--networking/Makefile.in7
-rw-r--r--networking/libiproute/Makefile10
-rw-r--r--networking/libiproute/Makefile.in6
-rw-r--r--networking/udhcp/Makefile10
-rw-r--r--networking/udhcp/Makefile.in5
-rw-r--r--procps/Makefile10
-rw-r--r--procps/Makefile.in6
-rw-r--r--scripts/config/Makefile40
-rw-r--r--shell/Makefile10
-rw-r--r--shell/Makefile.in6
-rw-r--r--sysklogd/Makefile10
-rw-r--r--sysklogd/Makefile.in6
-rw-r--r--testsuite/du/du-h-works5
-rw-r--r--testsuite/du/du-k-works5
-rw-r--r--testsuite/du/du-l-works5
-rw-r--r--testsuite/du/du-m-works5
-rw-r--r--testsuite/du/du-s-works5
-rw-r--r--testsuite/du/du-works5
-rw-r--r--testsuite/head/head-n-works5
-rw-r--r--testsuite/head/head-works5
-rw-r--r--testsuite/ls/ls-1-works5
-rw-r--r--testsuite/ls/ls-h-works5
-rw-r--r--testsuite/ls/ls-l-works5
-rw-r--r--testsuite/ls/ls-s-works5
-rwxr-xr-xtestsuite/runtest18
-rw-r--r--testsuite/sort/sort-n-works5
-rw-r--r--testsuite/sort/sort-r-works5
-rw-r--r--testsuite/sort/sort-works5
-rw-r--r--testsuite/tail/tail-n-works5
-rw-r--r--testsuite/tail/tail-works5
-rw-r--r--testsuite/xargs/xargs-works5
-rw-r--r--util-linux/Makefile10
-rw-r--r--util-linux/Makefile.in8
66 files changed, 459 insertions, 241 deletions
diff --git a/Makefile b/Makefile
index 29897ef4e..3e2b3ef18 100644
--- a/Makefile
+++ b/Makefile
@@ -22,37 +22,112 @@
22#-------------------------------------------------------------- 22#--------------------------------------------------------------
23noconfig_targets := menuconfig config oldconfig randconfig \ 23noconfig_targets := menuconfig config oldconfig randconfig \
24 defconfig allyesconfig allnoconfig clean distclean \ 24 defconfig allyesconfig allnoconfig clean distclean \
25 release tags 25 release tags
26TOPDIR=./ 26
27include Rules.mak 27ifndef TOPDIR
28TOPDIR=$(CURDIR)/
29endif
30ifndef top_srcdir
31top_srcdir=$(CURDIR)
32endif
33ifndef top_builddir
34top_builddir=$(CURDIR)
35endif
36
37srctree=$(top_srcdir)
38vpath %/Config.in $(srctree)
39
40include $(top_builddir)/Rules.mak
28 41
29DIRS:=applets archival archival/libunarchive coreutils console-tools \ 42DIRS:=applets archival archival/libunarchive coreutils console-tools \
30 debianutils editors findutils init miscutils modutils networking \ 43 debianutils editors findutils init miscutils modutils networking \
31 networking/libiproute networking/udhcp procps loginutils shell \ 44 networking/libiproute networking/udhcp procps loginutils shell \
32 sysklogd util-linux libpwdgrp coreutils/libcoreutils libbb 45 sysklogd util-linux libpwdgrp coreutils/libcoreutils libbb
33 46
47SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
48
34ifeq ($(strip $(CONFIG_SELINUX)),y) 49ifeq ($(strip $(CONFIG_SELINUX)),y)
35CFLAGS += -I/usr/include/selinux 50CFLAGS += -I/usr/include/selinux
36LIBRARIES += -lsecure 51LIBRARIES += -lsecure
37endif 52endif
38 53
39CONFIG_CONFIG_IN = sysdeps/$(TARGET_OS)/Config.in 54CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in
40CONFIG_DEFCONFIG = sysdeps/$(TARGET_OS)/defconfig 55CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig
56
57ALL_DIRS:= $(DIRS) scripts/config
58ALL_MAKEFILES:=$(patsubst %,%/Makefile,$(ALL_DIRS))
59
60ifeq ($(KBUILD_SRC),)
61
62ifdef O
63 ifeq ("$(origin O)", "command line")
64 KBUILD_OUTPUT := $(O)
65 endif
66endif
67
68# That's our default target when none is given on the command line
69.PHONY: _all
70_all:
71
72ifneq ($(KBUILD_OUTPUT),)
73# Invoke a second make in the output directory, passing relevant variables
74# check that the output directory actually exists
75saved-output := $(KBUILD_OUTPUT)
76KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
77$(if $(wildcard $(KBUILD_OUTPUT)),, \
78 $(error output directory "$(saved-output)" does not exist))
79
80.PHONY: $(MAKECMDGOALS)
81
82$(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile
83 $(MAKE) -C $(KBUILD_OUTPUT) \
84 top_srcdir=$(CURDIR) \
85 top_builddir=$(KBUILD_OUTPUT) \
86 TOPDIR=$(KBUILD_OUTPUT) \
87 KBUILD_SRC=$(CURDIR) \
88 -f $(CURDIR)/Makefile $@
89
90$(KBUILD_OUTPUT)/Rules.mak:
91 @echo > $@
92 @echo top_srcdir=$(CURDIR) >> $@
93 @echo top_builddir=$(KBUILD_OUTPUT) >> $@
94 @echo include $(top_srcdir)/Rules.mak >> $@
95
96$(KBUILD_OUTPUT)/Makefile:
97 @echo > $@
98 @echo top_srcdir=$(CURDIR) >> $@
99 @echo top_builddir=$(KBUILD_OUTPUT) >> $@
100 @echo KBUILD_SRC='$$(top_srcdir)' >> $@
101 @echo include '$$(KBUILD_SRC)'/Makefile >> $@
102
103# Leave processing to above invocation of make
104skip-makefile := 1
105endif # ifneq ($(KBUILD_OUTPUT),)
106endif # ifeq ($(KBUILD_SRC),)
107
108ifeq ($(skip-makefile),)
109
110_all: all
41 111
42ifeq ($(strip $(HAVE_DOT_CONFIG)),y) 112ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
43 113
44all: busybox busybox.links doc 114all: busybox busybox.links doc
45 115
116all_tree: $(ALL_MAKEFILES)
117
118$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
119 d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
120
46# In this section, we need .config 121# In this section, we need .config
47-include .config.cmd 122-include $(top_builddir)/.config.cmd
48include $(patsubst %,%/Makefile.in, $(DIRS)) 123include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
49-include $(TOPDIR).depend 124-include $(top_builddir)/.depend
50 125
51busybox: .depend include/config.h $(libraries-y) 126busybox: $(ALL_MAKEFILES) .depend include/config.h $(libraries-y)
52 $(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group 127 $(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
53 $(STRIPCMD) $@ 128 $(STRIPCMD) $@
54 129
55busybox.links: applets/busybox.mkll include/config.h 130busybox.links: $(top_srcdir)/applets/busybox.mkll include/config.h $(top_srcdir)/include/applets.h
56 - $(SHELL) $^ >$@ 131 - $(SHELL) $^ >$@
57 132
58install: applets/install.sh busybox busybox.links 133install: applets/install.sh busybox busybox.links
@@ -75,14 +150,18 @@ uninstall: busybox.links
75install-hardlinks: applets/install.sh busybox busybox.links 150install-hardlinks: applets/install.sh busybox busybox.links
76 $(SHELL) $< $(PREFIX) --hardlinks 151 $(SHELL) $< $(PREFIX) --hardlinks
77 152
153check: busybox
154 bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
155 $(top_srcdir)/testsuite/runtest
78 156
79# Documentation Targets 157# Documentation Targets
80doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html 158doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
81 159
82docs/busybox.pod : docs/busybox_header.pod include/usage.h docs/busybox_footer.pod 160docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/usage.h $(top_srcdir)/docs/busybox_footer.pod
83 - ( cat docs/busybox_header.pod; \ 161 -mkdir -p docs
84 docs/autodocifier.pl include/usage.h; \ 162 - ( cat $(top_srcdir)/docs/busybox_header.pod; \
85 cat docs/busybox_footer.pod ) > docs/busybox.pod 163 $(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h; \
164 cat $(top_srcdir)/docs/busybox_footer.pod ) > docs/busybox.pod
86 165
87docs/BusyBox.txt: docs/busybox.pod 166docs/BusyBox.txt: docs/busybox.pod
88 @echo 167 @echo
@@ -99,7 +178,7 @@ docs/BusyBox.1: docs/busybox.pod
99docs/BusyBox.html: docs/busybox.net/BusyBox.html 178docs/BusyBox.html: docs/busybox.net/BusyBox.html
100 - mkdir -p docs 179 - mkdir -p docs
101 -@ rm -f docs/BusyBox.html 180 -@ rm -f docs/BusyBox.html
102 -@ ln -s busybox.net/BusyBox.html docs/BusyBox.html 181 -@ cp docs/busybox.net/BusyBox.html docs/BusyBox.html
103 182
104docs/busybox.net/BusyBox.html: docs/busybox.pod 183docs/busybox.net/BusyBox.html: docs/busybox.pod
105 -@ mkdir -p docs/busybox.net 184 -@ mkdir -p docs/busybox.net
@@ -108,20 +187,19 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
108 -@ rm -f pod2htm* 187 -@ rm -f pod2htm*
109 188
110# The nifty new buildsystem stuff 189# The nifty new buildsystem stuff
111scripts/mkdep: scripts/mkdep.c 190scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
112 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c 191 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
113 192
114scripts/split-include: scripts/split-include.c 193scripts/split-include: $(top_srcdir)/scripts/split-include.c
115 $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c 194 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
116 195
117.depend: scripts/mkdep 196.depend: scripts/mkdep
118 rm -f .depend .hdepend; 197 rm -f .depend .hdepend;
119 mkdir -p include/config; 198 mkdir -p include/config;
120 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
121 scripts/mkdep -I include -- \ 199 scripts/mkdep -I include -- \
122 `find -name \*.c -print | sed -e "s,^./,,"` >> .depend; 200 `find $(top_srcdir) -name \*.c -print | sed -e "s,^./,,"` >> .depend;
123 scripts/mkdep -I include -- \ 201 scripts/mkdep -I include -- \
124 `find -name \*.h -print | sed -e "s,^./,,"` >> .hdepend; 202 `find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
125 203
126depend dep: include/config.h .depend 204depend dep: include/config.h .depend
127 205
@@ -130,13 +208,10 @@ include/config/MARKER: depend scripts/split-include
130 @ touch include/config/MARKER 208 @ touch include/config/MARKER
131 209
132include/config.h: .config 210include/config.h: .config
133 @if [ ! -x ./scripts/config/conf ] ; then \ 211 @if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
134 $(MAKE) -C scripts/config conf; \ 212 $(MAKE) -C scripts/config conf; \
135 fi; 213 fi;
136 @./scripts/config/conf -o $(CONFIG_CONFIG_IN) 214 @$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
137
138%.o: %.c
139 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
140 215
141finished2: 216finished2:
142 @echo 217 @echo
@@ -150,12 +225,16 @@ all: menuconfig
150# configuration 225# configuration
151# --------------------------------------------------------------------------- 226# ---------------------------------------------------------------------------
152 227
153scripts/config/conf: 228$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
229 d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
230
231scripts/config/conf: scripts/config/Makefile Rules.mak
154 $(MAKE) -C scripts/config conf 232 $(MAKE) -C scripts/config conf
155 -@if [ ! -f .config ] ; then \ 233 -@if [ ! -f .config ] ; then \
156 cp $(CONFIG_DEFCONFIG) .config; \ 234 cp $(CONFIG_DEFCONFIG) .config; \
157 fi 235 fi
158scripts/config/mconf: 236
237scripts/config/mconf: scripts/config/Makefile Rules.mak
159 $(MAKE) -C scripts/config ncurses conf mconf 238 $(MAKE) -C scripts/config ncurses conf mconf
160 -@if [ ! -f .config ] ; then \ 239 -@if [ ! -f .config ] ; then \
161 cp $(CONFIG_DEFCONFIG) .config; \ 240 cp $(CONFIG_DEFCONFIG) .config; \
@@ -187,9 +266,6 @@ allnoconfig: scripts/config/conf
187defconfig: scripts/config/conf 266defconfig: scripts/config/conf
188 @./scripts/config/conf -d $(CONFIG_CONFIG_IN) 267 @./scripts/config/conf -d $(CONFIG_CONFIG_IN)
189 268
190check: busybox
191 cd testsuite && ./runtest
192
193clean: 269clean:
194 - rm -f docs/busybox.dvi docs/busybox.ps \ 270 - rm -f docs/busybox.dvi docs/busybox.ps \
195 docs/busybox.pod docs/busybox.net/busybox.html \ 271 docs/busybox.pod docs/busybox.net/busybox.html \
@@ -232,7 +308,8 @@ tags:
232 308
233endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y) 309endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
234 310
235.PHONY: dummy subdirs release distclean clean config oldconfig \ 311endif # ifeq ($(skip-makefile),)
236 menuconfig tags check test depend
237 312
313.PHONY: dummy subdirs release distclean clean config oldconfig \
314 menuconfig tags check test depend buildtree
238 315
diff --git a/Rules.mak b/Rules.mak
index 43cf24226..63b80f3a5 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -42,7 +42,7 @@ LD = $(CROSS)ld
42NM = $(CROSS)nm 42NM = $(CROSS)nm
43STRIP = $(CROSS)strip 43STRIP = $(CROSS)strip
44CPP = $(CC) -E 44CPP = $(CC) -E
45MAKEFILES = $(TOPDIR).config 45# MAKEFILES = $(top_builddir)/.config
46 46
47# What OS are you compiling busybox for? This allows you to include 47# What OS are you compiling busybox for? This allows you to include
48# OS specific things, syscall overrides, etc. 48# OS specific things, syscall overrides, etc.
@@ -80,7 +80,7 @@ BB_SRC_DIR=
80#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp") 80#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
81 81
82WARNINGS=-Wall -Wstrict-prototypes -Wshadow 82WARNINGS=-Wall -Wstrict-prototypes -Wshadow
83CFLAGS=-I$(TOPDIR)include 83CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
84ARFLAGS=-r 84ARFLAGS=-r
85 85
86#-------------------------------------------------------- 86#--------------------------------------------------------
@@ -102,7 +102,7 @@ endif
102 102
103# Pull in the user's busybox configuration 103# Pull in the user's busybox configuration
104ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) 104ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
105-include $(TOPDIR).config 105-include $(top_builddir)/.config
106endif 106endif
107 107
108# A nifty macro to make testing gcc features easier 108# A nifty macro to make testing gcc features easier
@@ -189,12 +189,8 @@ endif
189# have a chance of winning. 189# have a chance of winning.
190CFLAGS += $(CFLAGS_EXTRA) 190CFLAGS += $(CFLAGS_EXTRA)
191 191
192%.o: %.c
193 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
194
195.PHONY: dummy 192.PHONY: dummy
196 193
197 194
198
199.EXPORT_ALL_VARIABLES: 195.EXPORT_ALL_VARIABLES:
200 196
diff --git a/applets/Makefile b/applets/Makefile
index 5f9167442..b566e4d12 100644
--- a/applets/Makefile
+++ b/applets/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/applets
21APPLETS_DIR:=./ 23APPLETS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir).depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/applets/Makefile.in b/applets/Makefile.in
index afd5cbeb9..e31bb6fd9 100644
--- a/applets/Makefile.in
+++ b/applets/Makefile.in
@@ -19,18 +19,19 @@
19 19
20APPLETS_AR:=applets.a 20APPLETS_AR:=applets.a
21ifndef $(APPLETS_DIR) 21ifndef $(APPLETS_DIR)
22APPLETS_DIR:=$(TOPDIR)applets/ 22APPLETS_DIR:=$(top_builddir)/applets/
23endif 23endif
24srcdir=$(top_srcdir)/applets
24 25
25APPLET_SRC:=applets.c busybox.c 26APPLET_SRC:=applets.c busybox.c
26APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC)) 27APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
27 28
28
29
30libraries-y+=$(APPLETS_DIR)$(APPLETS_AR) 29libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
31 30
32$(APPLET_OBJ): $(TOPDIR).config
33
34$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ) 31$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
35 $(AR) -ro $@ $(APPLET_OBJ) 32 $(AR) -ro $@ $(APPLET_OBJ)
36 33
34$(APPLET_OBJ): $(top_builddir)/.config
35$(APPLET_OBJ): $(APPLETS_DIR)%.o: $(srcdir)/%.c
36 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
37
diff --git a/archival/Makefile b/archival/Makefile
index 1cbe7ee00..a96daa4df 100644
--- a/archival/Makefile
+++ b/archival/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
21ARCHIVAL_DIR:=./ 22ARCHIVAL_DIR:=./
22include $(TOPDIR).config 23srcdir=$(top_srcdir)/archival
23include $(TOPDIR)Rules.mak 24include $(top_builddir)/Rules.mak
24include Makefile.in 25include $(top_builddir)/.config
26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/archival/Makefile.in b/archival/Makefile.in
index 1673662f9..76ab6cd08 100644
--- a/archival/Makefile.in
+++ b/archival/Makefile.in
@@ -19,8 +19,9 @@
19 19
20ARCHIVAL_AR:=archival.a 20ARCHIVAL_AR:=archival.a
21ifndef $(ARCHIVAL_DIR) 21ifndef $(ARCHIVAL_DIR)
22ARCHIVAL_DIR:=$(TOPDIR)archival/ 22ARCHIVAL_DIR:=$(top_builddir)/archival/
23endif 23endif
24srcdir=$(top_srcdir)/archival
24 25
25ARCHIVAL-y:= 26ARCHIVAL-y:=
26ARCHIVAL-$(CONFIG_APT_GET) += 27ARCHIVAL-$(CONFIG_APT_GET) +=
@@ -42,3 +43,6 @@ libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
42$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y)) 43$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
43 $(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y)) 44 $(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
44 45
46$(ARCHIVAL_DIR)%.o: $(srcdir)/%.c
47 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
48
diff --git a/archival/libunarchive/Makefile b/archival/libunarchive/Makefile
index 9a20ea28b..e985fa49f 100644
--- a/archival/libunarchive/Makefile
+++ b/archival/libunarchive/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../../ 20top_srcdir=../..
21top_builddir=../..
22srcdir=$(top_srcdir)/archival/libunarchive
21LIBUNARCHIVE_DIR:=./ 23LIBUNARCHIVE_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in
index 5cf5efa33..809b0e10e 100644
--- a/archival/libunarchive/Makefile.in
+++ b/archival/libunarchive/Makefile.in
@@ -19,8 +19,9 @@
19 19
20LIBUNARCHIVE_AR:=libunarchive.a 20LIBUNARCHIVE_AR:=libunarchive.a
21ifndef $(LIBUNARCHIVE_DIR) 21ifndef $(LIBUNARCHIVE_DIR)
22LIBUNARCHIVE_DIR:=$(TOPDIR)archival/libunarchive/ 22LIBUNARCHIVE_DIR:=$(top_builddir)/archival/libunarchive/
23endif 23endif
24srcdir=$(top_srcdir)/archvial/libunarchive
24 25
25LIBUNARCHIVE-y:= \ 26LIBUNARCHIVE-y:= \
26\ 27\
@@ -78,3 +79,6 @@ libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
78$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y)) 79$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
79 $(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y)) 80 $(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
80 81
82$(LIBUNARCHIVA_DIR)%.o: $(srcdir)/%.c
83 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
84
diff --git a/console-tools/Makefile b/console-tools/Makefile
index 2ee51a5e6..42cf2c8c3 100644
--- a/console-tools/Makefile
+++ b/console-tools/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/console/tools
21CONSOLETOOLS_DIR:=./ 23CONSOLETOOLS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/console-tools/Makefile.in b/console-tools/Makefile.in
index 1d756c721..b19ce5cb2 100644
--- a/console-tools/Makefile.in
+++ b/console-tools/Makefile.in
@@ -19,8 +19,9 @@
19 19
20CONSOLETOOLS_AR:=console-tools.a 20CONSOLETOOLS_AR:=console-tools.a
21ifndef $(CONSOLETOOLS_DIR) 21ifndef $(CONSOLETOOLS_DIR)
22CONSOLETOOLS_DIR:=$(TOPDIR)console-tools/ 22CONSOLETOOLS_DIR:=$(top_builddir)/console-tools/
23endif 23endif
24srcdir=$(top_srcdir)/console-tools
24 25
25CONSOLETOOLS_DIR-y:= 26CONSOLETOOLS_DIR-y:=
26CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o 27CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o
@@ -38,3 +39,6 @@ libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
38$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y)) 39$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
39 $(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y)) 40 $(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
40 41
42$(CONSOLETOOLS_DIR)%.o: $(srcdir)/%.c
43 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
44
diff --git a/coreutils/Makefile b/coreutils/Makefile
index b42689a26..50fdac236 100644
--- a/coreutils/Makefile
+++ b/coreutils/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/coreutils
21SHELLUTILS_DIR:=./ 23SHELLUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/coreutils/Makefile.in b/coreutils/Makefile.in
index a5343c9c7..aacb813b3 100644
--- a/coreutils/Makefile.in
+++ b/coreutils/Makefile.in
@@ -19,8 +19,9 @@
19 19
20COREUTILS_AR:=coreutils.a 20COREUTILS_AR:=coreutils.a
21ifndef $(COREUTILS_DIR) 21ifndef $(COREUTILS_DIR)
22COREUTILS_DIR:=$(TOPDIR)coreutils/ 22COREUTILS_DIR:=$(top_builddir)/coreutils/
23endif 23endif
24srcdir=$(top_srcdir)/coreutils
24 25
25COREUTILS-y:= 26COREUTILS-y:=
26COREUTILS-$(CONFIG_BASENAME) += basename.o 27COREUTILS-$(CONFIG_BASENAME) += basename.o
@@ -91,3 +92,7 @@ libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
91 92
92$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y)) 93$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
93 $(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y)) 94 $(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
95
96$(COREUTILS_DIR)%.o: $(srcdir)/%.c
97 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
98
diff --git a/coreutils/libcoreutils/Makefile b/coreutils/libcoreutils/Makefile
index 11867c602..0a1c80a41 100644
--- a/coreutils/libcoreutils/Makefile
+++ b/coreutils/libcoreutils/Makefile
@@ -17,13 +17,16 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../../ 20top_srcdir=../..
21top_builddir=../..
22srcdir=$(top_srcdir)/coreutils/libcoreutils
21LIBCOREUTILS_DIR:=./ 23LIBCOREUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
27
25all: $(libraries-y) 28all: $(libraries-y)
26-include $(TOPDIR).depend 29-include $(top_builddir)/.depend
27 30
28clean: 31clean:
29 rm -f *.o *.a $(AR_TARGET) 32 rm -f *.o *.a $(AR_TARGET)
diff --git a/coreutils/libcoreutils/Makefile.in b/coreutils/libcoreutils/Makefile.in
index d0e8b3a05..cf83d7107 100644
--- a/coreutils/libcoreutils/Makefile.in
+++ b/coreutils/libcoreutils/Makefile.in
@@ -19,8 +19,9 @@
19 19
20LIBCOREUTILS_AR:=libcoreutils.a 20LIBCOREUTILS_AR:=libcoreutils.a
21ifndef $(LIBCOREUTILS_DIR) 21ifndef $(LIBCOREUTILS_DIR)
22LIBCOREUTILS_DIR:=$(TOPDIR)coreutils/libcoreutils/ 22LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils/
23endif 23endif
24srcdir=$(top_srcdir)/coreutils/libcoreutils
24 25
25LIBCOREUTILS_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c xgetoptfile_sort_uniq.c 26LIBCOREUTILS_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c xgetoptfile_sort_uniq.c
26 27
@@ -30,3 +31,7 @@ libraries-y+=$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR)
30 31
31$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR): $(LIBCOREUTILS_OBJS) 32$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR): $(LIBCOREUTILS_OBJS)
32 $(AR) -ro $@ $(LIBCOREUTILS_OBJS) 33 $(AR) -ro $@ $(LIBCOREUTILS_OBJS)
34
35$(LIBCOREUTILS_DIR)%.o: $(srcdir)/%.c
36 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
37
diff --git a/debianutils/Makefile b/debianutils/Makefile
index 0282b83c4..10ec1cc58 100644
--- a/debianutils/Makefile
+++ b/debianutils/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/debianutils
21DEBIANUTILS_DIR:=./ 23DEBIANUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/debianutils/Makefile.in b/debianutils/Makefile.in
index dabef27ef..3a204033e 100644
--- a/debianutils/Makefile.in
+++ b/debianutils/Makefile.in
@@ -19,9 +19,9 @@
19 19
20DEBIANUTILS_AR:=debianutils.a 20DEBIANUTILS_AR:=debianutils.a
21ifndef $(DEBIANUTILS_DIR) 21ifndef $(DEBIANUTILS_DIR)
22DEBIANUTILS_DIR:=$(TOPDIR)debianutils/ 22DEBIANUTILS_DIR:=$(top_builddir)/debianutils/
23endif 23endif
24 24srcdir=$(top_srcdir)/debianutils
25 25
26DEBIANUTILS-y:= 26DEBIANUTILS-y:=
27DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o 27DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
@@ -36,3 +36,6 @@ libraries-y+=$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR)
36$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR): $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y)) 36$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR): $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
37 $(AR) -ro $@ $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y)) 37 $(AR) -ro $@ $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
38 38
39$(DEBIANUTILS_DIR)%.o: $(srcdir)/%.c
40 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
41
diff --git a/editors/Makefile b/editors/Makefile
index 1c8223124..e6c114781 100644
--- a/editors/Makefile
+++ b/editors/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/editors
21EDITOR_DIR:=./ 23EDITOR_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/editors/Makefile.in b/editors/Makefile.in
index 017f30934..571e05568 100644
--- a/editors/Makefile.in
+++ b/editors/Makefile.in
@@ -19,8 +19,9 @@
19 19
20EDITOR_AR:=editors.a 20EDITOR_AR:=editors.a
21ifndef $(EDITOR_DIR) 21ifndef $(EDITOR_DIR)
22EDITOR_DIR:=$(TOPDIR)editors/ 22EDITOR_DIR:=$(top_builddir)/editors/
23endif 23endif
24srcdir=$(top_srcdir)/editors
24 25
25EDITOR-y:= 26EDITOR-y:=
26EDITOR-$(CONFIG_AWK) += awk.o 27EDITOR-$(CONFIG_AWK) += awk.o
@@ -42,3 +43,6 @@ endif
42$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y)) 43$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
43 $(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y)) 44 $(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
44 45
46$(EDITOR_DIR)%.o: $(srcdir)/%.c
47 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
48
diff --git a/findutils/Makefile b/findutils/Makefile
index ba65a0e1d..f3f8bb872 100644
--- a/findutils/Makefile
+++ b/findutils/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/findutils
21FINDUTILS_DIR:=./ 23FINDUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/findutils/Makefile.in b/findutils/Makefile.in
index 2d2f242a0..ae71070d9 100644
--- a/findutils/Makefile.in
+++ b/findutils/Makefile.in
@@ -19,8 +19,9 @@
19 19
20FINDUTILS_AR:=findutils.a 20FINDUTILS_AR:=findutils.a
21ifndef $(FINDUTILS_DIR) 21ifndef $(FINDUTILS_DIR)
22FINDUTILS_DIR:=$(TOPDIR)findutils/ 22FINDUTILS_DIR:=$(top_builddir)/findutils/
23endif 23endif
24srcdir=$(top_srcdir)/findutils
24 25
25FINDUTILS-y:= 26FINDUTILS-y:=
26FINDUTILS-$(CONFIG_FIND) += find.o 27FINDUTILS-$(CONFIG_FIND) += find.o
@@ -32,3 +33,6 @@ libraries-y+=$(FINDUTILS_DIR)$(FINDUTILS_AR)
32$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y)) 33$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
33 $(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y)) 34 $(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
34 35
36$(FINDUTILS_DIR)%.o: $(srcdir)/%.c
37 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
38
diff --git a/init/Makefile b/init/Makefile
index d23532735..9b0a1d139 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/init
21INIT_DIR:=./ 23INIT_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include $(srcdir)/Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/init/Makefile.in b/init/Makefile.in
index 6264710db..807259dee 100644
--- a/init/Makefile.in
+++ b/init/Makefile.in
@@ -19,8 +19,9 @@
19 19
20INIT_AR:=init.a 20INIT_AR:=init.a
21ifndef $(INIT_DIR) 21ifndef $(INIT_DIR)
22INIT_DIR:=$(TOPDIR)init/ 22INIT_DIR:=$(top_builddir)/init/
23endif 23endif
24srcdir=$(top_srcdir)/init
24 25
25INIT-y:= 26INIT-y:=
26INIT-$(CONFIG_HALT) += halt.o 27INIT-$(CONFIG_HALT) += halt.o
@@ -56,3 +57,6 @@ libraries-y+=$(INIT_DIR)$(INIT_AR)
56$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y)) 57$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
57 $(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y)) 58 $(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
58 59
60$(INIT_DIR)%.o: $(srcdir)/%.c
61 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
62
diff --git a/libbb/Makefile b/libbb/Makefile
index fbcb12330..e94c05260 100644
--- a/libbb/Makefile
+++ b/libbb/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/libbb
21LIBBB_DIR:=./ 23LIBBB_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/libbb/Makefile.in b/libbb/Makefile.in
index f86664f15..85d4a967b 100644
--- a/libbb/Makefile.in
+++ b/libbb/Makefile.in
@@ -16,12 +16,11 @@
16# along with this program; if not, write to the Free Software 16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18
19
20
21LIBBB_AR:=libbb.a 19LIBBB_AR:=libbb.a
22ifndef $(LIBBB_DIR) 20ifndef $(LIBBB_DIR)
23LIBBB_DIR:=$(TOPDIR)libbb/ 21LIBBB_DIR:=$(top_builddir)/libbb/
24endif 22endif
23srcdir=$(top_srcdir)/libbb
25 24
26LIBBB_SRC:= \ 25LIBBB_SRC:= \
27 bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \ 26 bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
@@ -51,7 +50,7 @@ LIBBB_SRC:= \
51 50
52LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC)) 51LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC))
53 52
54LIBBB_MSRC0:=$(LIBBB_DIR)messages.c 53LIBBB_MSRC0:=$(srcdir)/messages.c
55LIBBB_MOBJ0:=full_version.o \ 54LIBBB_MOBJ0:=full_version.o \
56 memory_exhausted.o invalid_date.o io_error.o \ 55 memory_exhausted.o invalid_date.o io_error.o \
57 write_error.o name_longer_than_foo.o unknown.o \ 56 write_error.o name_longer_than_foo.o unknown.o \
@@ -60,19 +59,19 @@ LIBBB_MOBJ0:=full_version.o \
60 securetty_file.o motd_file.o \ 59 securetty_file.o motd_file.o \
61 msg_standard_input.o msg_standard_output.o shell_file.o 60 msg_standard_input.o msg_standard_output.o shell_file.o
62 61
63LIBBB_MSRC1:=$(LIBBB_DIR)xfuncs.c 62LIBBB_MSRC1:=$(srcdir)/xfuncs.c
64LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \ 63LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \
65 xfopen.o xopen.o xread.o xread_all.o xread_char.o \ 64 xfopen.o xopen.o xread.o xread_all.o xread_char.o \
66 xferror.o xferror_stdout.o xfflush_stdout.o strlen.o 65 xferror.o xferror_stdout.o xfflush_stdout.o strlen.o
67 66
68LIBBB_MSRC2:=$(LIBBB_DIR)printf.c 67LIBBB_MSRC2:=$(srcdir)/printf.c
69LIBBB_MOBJ2:=bb_vfprintf.o bb_vprintf.o bb_fprintf.o bb_printf.o 68LIBBB_MOBJ2:=bb_vfprintf.o bb_vprintf.o bb_fprintf.o bb_printf.o
70 69
71LIBBB_MSRC3:=$(LIBBB_DIR)xgetularg.c 70LIBBB_MSRC3:=$(srcdir)/xgetularg.c
72LIBBB_MOBJ3:=xgetularg_bnd_sfx.o xgetlarg_bnd_sfx.o getlarg10_sfx.o \ 71LIBBB_MOBJ3:=xgetularg_bnd_sfx.o xgetlarg_bnd_sfx.o getlarg10_sfx.o \
73 xgetularg_bnd.o xgetularg10_bnd.o xgetularg10.o 72 xgetularg_bnd.o xgetularg10_bnd.o xgetularg10.o
74 73
75LIBBB_MSRC4:=$(LIBBB_DIR)/safe_strtol.c 74LIBBB_MSRC4:=$(srcdir)/safe_strtol.c
76LIBBB_MOBJ4:=safe_strtoi.o safe_strtod.o safe_strtol.o safe_strtoul.o 75LIBBB_MOBJ4:=safe_strtoi.o safe_strtod.o safe_strtol.o safe_strtoul.o
77 76
78LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0)) 77LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0))
@@ -88,6 +87,9 @@ $(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
88 $(AR) -ro $@ $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \ 87 $(AR) -ro $@ $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
89 $(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4) 88 $(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4)
90 89
90$(LIBBB_DIR)%.o: $(srcdir)/%.c
91 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
92
91$(LIBBB_MOBJS0): $(LIBBB_MSRC0) 93$(LIBBB_MOBJS0): $(LIBBB_MSRC0)
92 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@ 94 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
93 95
diff --git a/libpwdgrp/Makefile b/libpwdgrp/Makefile
index 79dbb462f..c833550bf 100644
--- a/libpwdgrp/Makefile
+++ b/libpwdgrp/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/libpwgrp
21LIBPWDGRP_DIR:=./ 23LIBPWDGRP_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/libpwdgrp/Makefile.in b/libpwdgrp/Makefile.in
index a79820252..9bdfc10d8 100644
--- a/libpwdgrp/Makefile.in
+++ b/libpwdgrp/Makefile.in
@@ -19,11 +19,12 @@
19 19
20LIBPWDGRP_AR:=libpwdgrp.a 20LIBPWDGRP_AR:=libpwdgrp.a
21ifndef $(LIBPWDGRP_DIR) 21ifndef $(LIBPWDGRP_DIR)
22LIBPWDGRP_DIR:=$(TOPDIR)libpwdgrp/ 22LIBPWDGRP_DIR:=$(top_builddir)/libpwdgrp/
23endif 23endif
24srcdir=$(top_srcdir)/libpwdgrp
24 25
25 26
26LIBPWDGRP_MSRC0:=$(LIBPWDGRP_DIR)pwd_grp.c 27LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c
27LIBPWDGRP_MOBJ0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r.o fgetgrent_r.o \ 28LIBPWDGRP_MOBJ0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r.o fgetgrent_r.o \
28 fgetpwent.o fgetgrent.o getpwnam_r.o getgrnam_r.o getpwuid_r.o \ 29 fgetpwent.o fgetgrent.o getpwnam_r.o getgrnam_r.o getpwuid_r.o \
29 getgrgid_r.o getpwuid.o getgrgid.o getpwnam.o getgrnam.o getpw.o \ 30 getgrgid_r.o getpwuid.o getgrgid.o getpwnam.o getgrnam.o getpw.o \
@@ -31,7 +32,7 @@ LIBPWDGRP_MOBJ0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r.o fgetgrent_r.o \
31 initgroups.o putpwent.o putgrent.o 32 initgroups.o putpwent.o putgrent.o
32LIBPWDGRP_MOBJS0=$(patsubst %,$(LIBPWDGRP_DIR)%, $(LIBPWDGRP_MOBJ0-y)) 33LIBPWDGRP_MOBJS0=$(patsubst %,$(LIBPWDGRP_DIR)%, $(LIBPWDGRP_MOBJ0-y))
33 34
34LIBPWDGRP_MSRC1:=$(LIBPWDGRP_DIR)pwd_grp.c 35LIBPWDGRP_MSRC1:=$(srcdir)/pwd_grp.c
35LIBPWDGRP_MOBJ1-$(CONFIG_USE_BB_PWD_GRP):= __parsepwent.o __parsegrent.o \ 36LIBPWDGRP_MOBJ1-$(CONFIG_USE_BB_PWD_GRP):= __parsepwent.o __parsegrent.o \
36 __pgsreader.o fgetspent_r.o fgetspent.o sgetspent_r.o getspnam_r.o \ 37 __pgsreader.o fgetspent_r.o fgetspent.o sgetspent_r.o getspnam_r.o \
37 getspnam.o getspent_r.o getspent.o sgetspent.o \ 38 getspnam.o getspent_r.o getspent.o sgetspent.o \
diff --git a/loginutils/Makefile b/loginutils/Makefile
index a013d141f..98226ae81 100644
--- a/loginutils/Makefile
+++ b/loginutils/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/loginutils
21LOGINUTILS_DIR:=./ 23LOGINUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/loginutils/Makefile.in b/loginutils/Makefile.in
index d6ffd3b6c..96a61e60f 100644
--- a/loginutils/Makefile.in
+++ b/loginutils/Makefile.in
@@ -19,8 +19,9 @@
19 19
20LOGINUTILS_AR:=loginutils.a 20LOGINUTILS_AR:=loginutils.a
21ifndef LOGINUTILS_DIR 21ifndef LOGINUTILS_DIR
22LOGINUTILS_DIR:=$(TOPDIR)loginutils/ 22LOGINUTILS_DIR:=$(top_builddir)/loginutils/
23endif 23endif
24srcdir=$(top_srcdir)/loginutils
24 25
25LOGINUTILS-y:= 26LOGINUTILS-y:=
26LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o 27LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o
@@ -51,3 +52,6 @@ endif
51$(LOGINUTILS_DIR)$(LOGINUTILS_AR): $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y)) 52$(LOGINUTILS_DIR)$(LOGINUTILS_AR): $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y))
52 $(AR) -ro $@ $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y)) 53 $(AR) -ro $@ $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y))
53 54
55$(LOGINUTILS_DIR)%.o: $(srcdir)/%.c
56 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
57
diff --git a/miscutils/Makefile b/miscutils/Makefile
index 4bae72476..ac427dc09 100644
--- a/miscutils/Makefile
+++ b/miscutils/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/miscutils
21MISCUTILS_DIR:=./ 23MISCUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/miscutils/Makefile.in b/miscutils/Makefile.in
index 89e3208a6..ddddf72b3 100644
--- a/miscutils/Makefile.in
+++ b/miscutils/Makefile.in
@@ -19,9 +19,9 @@
19 19
20MISCUTILS_AR:=miscutils.a 20MISCUTILS_AR:=miscutils.a
21ifndef $(MISCUTILS_DIR) 21ifndef $(MISCUTILS_DIR)
22MISCUTILS_DIR:=$(TOPDIR)miscutils/ 22MISCUTILS_DIR:=$(top_builddir)/miscutils/
23endif 23endif
24 24srcdir=$(top_srcdir)/miscutils
25 25
26MISCUTILS-y:= 26MISCUTILS-y:=
27MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o 27MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
@@ -50,3 +50,6 @@ endif
50$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y)) 50$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
51 $(AR) -ro $@ $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y)) 51 $(AR) -ro $@ $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
52 52
53$(MISCUTILS_DIR)%.o: $(srcdir)/%.c
54 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
55
diff --git a/modutils/Makefile b/modutils/Makefile
index 5e1c886c0..d2b50b4d8 100644
--- a/modutils/Makefile
+++ b/modutils/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/modutils
21MODUTILS_DIR:=./ 23MODUTILS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/modutils/Makefile.in b/modutils/Makefile.in
index a92befafb..9bd11d4d8 100644
--- a/modutils/Makefile.in
+++ b/modutils/Makefile.in
@@ -19,8 +19,9 @@
19 19
20MODUTILS_AR:=modutils.a 20MODUTILS_AR:=modutils.a
21ifndef $(MODUTILS_DIR) 21ifndef $(MODUTILS_DIR)
22MODUTILS_DIR:=$(TOPDIR)modutils/ 22MODUTILS_DIR:=$(top_builddir)/modutils/
23endif 23endif
24srcdir=$(top_srcdir)/modutils
24 25
25MODUTILS-y:= 26MODUTILS-y:=
26MODUTILS-$(CONFIG_INSMOD) += insmod.o 27MODUTILS-$(CONFIG_INSMOD) += insmod.o
@@ -33,3 +34,6 @@ libraries-y+=$(MODUTILS_DIR)$(MODUTILS_AR)
33$(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y)) 34$(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
34 $(AR) -ro $@ $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y)) 35 $(AR) -ro $@ $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
35 36
37$(MODUTILS_DIR)%.o: $(srcdir)/%.c
38 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
39
diff --git a/networking/Makefile b/networking/Makefile
index 456c433fd..91726b1b2 100644
--- a/networking/Makefile
+++ b/networking/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/networking
21NETWORKING_DIR:=./ 23NETWORKING_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/networking/Makefile.in b/networking/Makefile.in
index e15e61a3e..9bfe90176 100644
--- a/networking/Makefile.in
+++ b/networking/Makefile.in
@@ -19,9 +19,9 @@
19 19
20NETWORKING_AR:=networking.a 20NETWORKING_AR:=networking.a
21ifndef $(NETWORKING_DIR) 21ifndef $(NETWORKING_DIR)
22NETWORKING_DIR:=$(TOPDIR)networking/ 22NETWORKING_DIR:=$(top_builddir)/networking/
23endif 23endif
24 24srcdir=$(top_srcdir)/networking
25NETWORKING-y:= 25NETWORKING-y:=
26NETWORKING-$(CONFIG_ARPING) += arping.o 26NETWORKING-$(CONFIG_ARPING) += arping.o
27NETWORKING-$(CONFIG_FTPGET) += ftpgetput.o 27NETWORKING-$(CONFIG_FTPGET) += ftpgetput.o
@@ -63,3 +63,6 @@ endif
63$(NETWORKING_DIR)$(NETWORKING_AR): $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y)) 63$(NETWORKING_DIR)$(NETWORKING_AR): $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
64 $(AR) -ro $@ $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y)) 64 $(AR) -ro $@ $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
65 65
66$(NETWORKING_DIR)%.o: $(srcdir)/%.c
67 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
68
diff --git a/networking/libiproute/Makefile b/networking/libiproute/Makefile
index 0dc7191d3..d3aefaaf4 100644
--- a/networking/libiproute/Makefile
+++ b/networking/libiproute/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../../ 20top_srcdir=../..
21top_builddir=../..
22srcdir=$(top_srcdir)/networking/libiproute
21LIBIPROUTE_DIR:=./ 23LIBIPROUTE_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/networking/libiproute/Makefile.in b/networking/libiproute/Makefile.in
index 25c51999f..fcc7f48ce 100644
--- a/networking/libiproute/Makefile.in
+++ b/networking/libiproute/Makefile.in
@@ -19,8 +19,9 @@
19 19
20LIBIPROUTE_AR:=libiproute.a 20LIBIPROUTE_AR:=libiproute.a
21ifndef $(LIBIPROUTE_DIR) 21ifndef $(LIBIPROUTE_DIR)
22LIBIPROUTE_DIR:=$(TOPDIR)networking/libiproute/ 22LIBIPROUTE_DIR:=$(top_builddir)/networking/libiproute/
23endif 23endif
24srcdir=$(top_srcdir)/networking/libiproute
24 25
25LIBIPROUTE-$(CONFIG_IP) += \ 26LIBIPROUTE-$(CONFIG_IP) += \
26 ip_parse_common_args.o \ 27 ip_parse_common_args.o \
@@ -78,3 +79,6 @@ libraries-y+=$(LIBIPROUTE_DIR)$(LIBIPROUTE_AR)
78$(LIBIPROUTE_DIR)$(LIBIPROUTE_AR): $(patsubst %,$(LIBIPROUTE_DIR)%, $(LIBIPROUTE-y)) 79$(LIBIPROUTE_DIR)$(LIBIPROUTE_AR): $(patsubst %,$(LIBIPROUTE_DIR)%, $(LIBIPROUTE-y))
79 $(AR) -ro $@ $(patsubst %,$(LIBIPROUTE_DIR)%, $(LIBIPROUTE-y)) 80 $(AR) -ro $@ $(patsubst %,$(LIBIPROUTE_DIR)%, $(LIBIPROUTE-y))
80 81
82$(LIBIPROUTE_DIR)%.o: $(srcdir)/%.c
83 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
84
diff --git a/networking/udhcp/Makefile b/networking/udhcp/Makefile
index 2b79d2293..3d32db50a 100644
--- a/networking/udhcp/Makefile
+++ b/networking/udhcp/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../../ 20top_srcdir=../..
21top_builddir=../..
22srcdir=$(top_srcdir)/networking/udhcp
21UDHCP_DIR:=./ 23UDHCP_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/networking/udhcp/Makefile.in b/networking/udhcp/Makefile.in
index b48079429..2d7a08816 100644
--- a/networking/udhcp/Makefile.in
+++ b/networking/udhcp/Makefile.in
@@ -19,8 +19,9 @@
19 19
20UDHCP_AR:=udhcp.a 20UDHCP_AR:=udhcp.a
21ifndef $(UDHCP_DIR) 21ifndef $(UDHCP_DIR)
22UDHCP_DIR:=$(TOPDIR)networking/udhcp/ 22UDHCP_DIR:=$(top_builddir)/networking/udhcp/
23endif 23endif
24srcdir=$(top_srcdir)/networking/udhcp
24 25
25#ok, so I forgot how to do an or, but this is a quick and dirty hack 26#ok, so I forgot how to do an or, but this is a quick and dirty hack
26ifeq ($(CONFIG_UDHCPC), y) 27ifeq ($(CONFIG_UDHCPC), y)
@@ -48,6 +49,6 @@ libraries-y+=$(UDHCP_DIR)$(UDHCP_AR)
48$(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS) 49$(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS)
49 $(AR) -ro $@ $(UDHCP_OBJS) 50 $(AR) -ro $@ $(UDHCP_OBJS)
50 51
51$(UDHCP_OBJS): %.o : %.c 52$(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c
52 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DIN_BUSYBOX -c $< -o $@ 53 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DIN_BUSYBOX -c $< -o $@
53 54
diff --git a/procps/Makefile b/procps/Makefile
index 0238f7ebb..1cc880462 100644
--- a/procps/Makefile
+++ b/procps/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/procps
21PROCPS_DIR:=./ 23PROCPS_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/procps/Makefile.in b/procps/Makefile.in
index 1c2e00f7b..ced29a198 100644
--- a/procps/Makefile.in
+++ b/procps/Makefile.in
@@ -19,8 +19,9 @@
19 19
20PROCPS_AR:=procps.a 20PROCPS_AR:=procps.a
21ifndef $(PROCPS_DIR) 21ifndef $(PROCPS_DIR)
22PROCPS_DIR:=$(TOPDIR)procps/ 22PROCPS_DIR:=$(top_builddir)/procps/
23endif 23endif
24srcdir=$(top_srcdir)/procps
24 25
25PROCPS-y:= 26PROCPS-y:=
26PROCPS-$(CONFIG_FREE) += free.o 27PROCPS-$(CONFIG_FREE) += free.o
@@ -37,3 +38,6 @@ libraries-y+=$(PROCPS_DIR)$(PROCPS_AR)
37$(PROCPS_DIR)$(PROCPS_AR): $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y)) 38$(PROCPS_DIR)$(PROCPS_AR): $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
38 $(AR) -ro $@ $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y)) 39 $(AR) -ro $@ $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
39 40
41$(PROCPS_DIR)%.o: $(srcdir)/%.c
42 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
43
diff --git a/scripts/config/Makefile b/scripts/config/Makefile
index e15ec399c..c0b5b9d35 100644
--- a/scripts/config/Makefile
+++ b/scripts/config/Makefile
@@ -2,8 +2,10 @@
2# 2#
3# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
4 4
5TOPDIR=../../ 5top_srcdir=../..
6include $(TOPDIR)Rules.mak 6top_builddir=../..
7srcdir=$(top_srcdir)/scripts/config
8include $(top_builddir)/Rules.mak
7 9
8all: ncurses conf mconf 10all: ncurses conf mconf
9 11
@@ -33,7 +35,8 @@ endif
33CONF_SRC =conf.c 35CONF_SRC =conf.c
34MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c 36MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
35SHARED_SRC=zconf.tab.c 37SHARED_SRC=zconf.tab.c
36SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h 38SHARED_DEPS:=$(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
39 lkc_defs.h $(srcdir)/expr.h zconf.tab.h
37CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC)) 40CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
38MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC)) 41MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
39SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC)) 42SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
@@ -44,13 +47,13 @@ conf: $(CONF_OBJS) $(SHARED_OBJS)
44mconf: $(MCONF_OBJS) $(SHARED_OBJS) 47mconf: $(MCONF_OBJS) $(SHARED_OBJS)
45 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS) 48 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
46 49
47$(CONF_OBJS): %.o : %.c $(SHARED_DEPS) 50$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
48 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ 51 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
49 52
50$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS) 53$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
51 $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@ 54 $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
52 55
53lkc_defs.h: lkc_proto.h 56lkc_defs.h: $(srcdir)/lkc_proto.h
54 @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/' 57 @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
55 58
56### 59###
@@ -61,29 +64,30 @@ lkc_defs.h: lkc_proto.h
61 64
62ifdef LKC_GENPARSER 65ifdef LKC_GENPARSER
63 66
64%.tab.c %.tab.h: %.y 67%.tab.c %.tab.h: $(srcdir)/%.y
65 bison -t -d -v -b $* -p $(notdir $*) $< 68 bison -t -d -v -b $* -p $(notdir $*) $<
66 69
67lex.%.c: %.l 70lex.%.c: $(srcdir)/%.l
68 flex -P$(notdir $*) -o$@ $< 71 flex -P$(notdir $*) -o$@ $<
69else 72else
70 73
71lex.zconf.o: lex.zconf.c $(SHARED_DEPS) 74lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
72 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ 75 $(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -c $< -o $@
73
74lex.zconf.c: lex.zconf.c_shipped
75 cp lex.zconf.c_shipped lex.zconf.c
76 76
77zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS) 77lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
78 $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@ 78 cp $< $@
79 79
80zconf.tab.c: zconf.tab.c_shipped 80zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
81 cp zconf.tab.c_shipped zconf.tab.c 81 cp $< $@
82 82
83zconf.tab.h: zconf.tab.h_shipped 83zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
84 cp zconf.tab.h_shipped zconf.tab.h 84 cp $< $@
85endif 85endif
86 86
87zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
88 $(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
89 $(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -I. -c $< -o $@
90
87.PHONY: ncurses 91.PHONY: ncurses
88 92
89ncurses: 93ncurses:
diff --git a/shell/Makefile b/shell/Makefile
index 8f476c19e..bd1dad6f3 100644
--- a/shell/Makefile
+++ b/shell/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_builddir=..
22srcdir=$(top_srcdir)/shell
21SHELL_DIR:=./ 23SHELL_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/shell/Makefile.in b/shell/Makefile.in
index 7b9f41ed4..61b2846ac 100644
--- a/shell/Makefile.in
+++ b/shell/Makefile.in
@@ -19,8 +19,9 @@
19 19
20SHELL_AR:=shell.a 20SHELL_AR:=shell.a
21ifndef $(SHELL_DIR) 21ifndef $(SHELL_DIR)
22SHELL_DIR:=$(TOPDIR)shell/ 22SHELL_DIR:=$(top_builddir)/shell/
23endif 23endif
24srcdir=$(top_srcdir)/shell
24 25
25SHELLT-y:= 26SHELLT-y:=
26SHELLT-$(CONFIG_ASH) += ash.o 27SHELLT-$(CONFIG_ASH) += ash.o
@@ -34,3 +35,6 @@ libraries-y+=$(SHELL_DIR)$(SHELL_AR)
34$(SHELL_DIR)$(SHELL_AR): $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y)) 35$(SHELL_DIR)$(SHELL_AR): $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
35 $(AR) -ro $@ $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y)) 36 $(AR) -ro $@ $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
36 37
38$(SHELL_DIR)%.o: $(srcdir)/%.c
39 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
40
diff --git a/sysklogd/Makefile b/sysklogd/Makefile
index f6ce14530..78b0c0090 100644
--- a/sysklogd/Makefile
+++ b/sysklogd/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_buildddir=..
22srcdir=$(top_srcdir)/sysklogd
21SYSKLOGD_DIR:=./ 23SYSKLOGD_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/sysklogd/Makefile.in b/sysklogd/Makefile.in
index 1c6e90774..99a5f823c 100644
--- a/sysklogd/Makefile.in
+++ b/sysklogd/Makefile.in
@@ -19,8 +19,9 @@
19 19
20SYSKLOGD_AR:=sysklogd.a 20SYSKLOGD_AR:=sysklogd.a
21ifndef $(SYSKLOGD_DIR) 21ifndef $(SYSKLOGD_DIR)
22SYSKLOGD_DIR:=$(TOPDIR)sysklogd/ 22SYSKLOGD_DIR:=$(top_builddir)/sysklogd/
23endif 23endif
24srcdir=$(top_srcdir)/sysklogd
24 25
25SYSKLOGD-:= 26SYSKLOGD-:=
26SYSKLOGD-$(CONFIG_KLOGD) += klogd.o 27SYSKLOGD-$(CONFIG_KLOGD) += klogd.o
@@ -33,3 +34,6 @@ libraries-y+=$(SYSKLOGD_DIR)$(SYSKLOGD_AR)
33$(SYSKLOGD_DIR)$(SYSKLOGD_AR): $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y)) 34$(SYSKLOGD_DIR)$(SYSKLOGD_AR): $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
34 $(AR) -ro $@ $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y)) 35 $(AR) -ro $@ $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
35 36
37$(SYSKLOGD_DIR)%.o: $(srcdir)/%.c
38 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
39
diff --git a/testsuite/du/du-h-works b/testsuite/du/du-h-works
index 8ec5d4c24..82041ab33 100644
--- a/testsuite/du/du-h-works
+++ b/testsuite/du/du-h-works
@@ -1,3 +1,4 @@
1du -h .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox du -h .. > logfile.bb 2du -h "$d" > logfile.gnu
3busybox du -h "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-k-works b/testsuite/du/du-k-works
index 43b119c7c..177a1a2cd 100644
--- a/testsuite/du/du-k-works
+++ b/testsuite/du/du-k-works
@@ -1,3 +1,4 @@
1du -k .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox du -k .. > logfile.bb 2du -k "$d" > logfile.gnu
3busybox du -k "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-l-works b/testsuite/du/du-l-works
index c5d439853..61e91400c 100644
--- a/testsuite/du/du-l-works
+++ b/testsuite/du/du-l-works
@@ -1,3 +1,4 @@
1du -l .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox du -l .. > logfile.bb 2du -l "$d" > logfile.gnu
3busybox du -l "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-m-works b/testsuite/du/du-m-works
index e3e2d3a56..bc9707350 100644
--- a/testsuite/du/du-m-works
+++ b/testsuite/du/du-m-works
@@ -1,3 +1,4 @@
1du -m .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox du -m .. > logfile.bb 2du -m "$d" > logfile.gnu
3busybox du -m "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-s-works b/testsuite/du/du-s-works
index 16b0a3e5a..f0b3bf0ae 100644
--- a/testsuite/du/du-s-works
+++ b/testsuite/du/du-s-works
@@ -1,3 +1,4 @@
1du -s .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox du -s .. > logfile.bb 2du -s "$d" > logfile.gnu
3busybox du -s "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/du/du-works b/testsuite/du/du-works
index 87ba63032..47949c694 100644
--- a/testsuite/du/du-works
+++ b/testsuite/du/du-works
@@ -1,3 +1,4 @@
1du .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox du .. > logfile.bb 2du "$d" > logfile.gnu
3busybox du "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/head/head-n-works b/testsuite/head/head-n-works
index 121a1fa1d..db4325556 100644
--- a/testsuite/head/head-n-works
+++ b/testsuite/head/head-n-works
@@ -1,3 +1,4 @@
1head -n 2 ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox head -n 2 ../README > logfile.bb 2head -n 2 "$d/README" > logfile.gnu
3busybox head -n 2 "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/head/head-works b/testsuite/head/head-works
index ea10adeb4..56ad3e36b 100644
--- a/testsuite/head/head-works
+++ b/testsuite/head/head-works
@@ -1,3 +1,4 @@
1head ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox head ../README > logfile.bb 2head "$d/README" > logfile.gnu
3busybox head "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-1-works b/testsuite/ls/ls-1-works
index 8651ecd72..8ad484fc3 100644
--- a/testsuite/ls/ls-1-works
+++ b/testsuite/ls/ls-1-works
@@ -1,3 +1,4 @@
1ls -1 .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox ls -1 .. > logfile.bb 2ls -1 "$d" > logfile.gnu
3busybox ls -1 "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-h-works b/testsuite/ls/ls-h-works
index f54a7be0b..7331262c9 100644
--- a/testsuite/ls/ls-h-works
+++ b/testsuite/ls/ls-h-works
@@ -1,3 +1,4 @@
1ls -h .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox ls -h .. > logfile.bb 2ls -h "$d" > logfile.gnu
3busybox ls -h "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-l-works b/testsuite/ls/ls-l-works
index 50e44597e..ae5141d80 100644
--- a/testsuite/ls/ls-l-works
+++ b/testsuite/ls/ls-l-works
@@ -1,3 +1,4 @@
1ls -l .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox ls -l .. > logfile.bb 2ls -l "$d" > logfile.gnu
3busybox ls -l "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/ls/ls-s-works b/testsuite/ls/ls-s-works
index 98a612d06..d82f328b7 100644
--- a/testsuite/ls/ls-s-works
+++ b/testsuite/ls/ls-s-works
@@ -1,3 +1,4 @@
1ls -1s .. > logfile.gnu 1[ -n "$d" ] || d=..
2busybox ls -1s .. > logfile.bb 2ls -1s "$d" > logfile.gnu
3busybox ls -1s "$d" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/runtest b/testsuite/runtest
index 89aba3985..6ba334bce 100755
--- a/testsuite/runtest
+++ b/testsuite/runtest
@@ -1,6 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2 2
3PATH=$(dirname $(pwd)):$PATH 3[ -n "$srcdir" ] || srcdir=$(pwd)
4[ -n "$bindir" ] || bindir=$(dirname $(pwd))
5PATH=$bindir:$PATH
4 6
5run_applet_testcase () 7run_applet_testcase ()
6{ 8{
@@ -13,7 +15,7 @@ run_applet_testcase ()
13 local uc_applet=$(echo $applet | tr a-z A-Z) 15 local uc_applet=$(echo $applet | tr a-z A-Z)
14 local testname=$(basename $testcase) 16 local testname=$(basename $testcase)
15 17
16 if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then 18 if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
17 echo UNTESTED: $testname 19 echo UNTESTED: $testname
18 return 0 20 return 0
19 fi 21 fi
@@ -21,7 +23,7 @@ run_applet_testcase ()
21 if grep -q "^# FEATURE: " $testcase; then 23 if grep -q "^# FEATURE: " $testcase; then
22 local feature=`sed -ne 's/^# FEATURE: //p' $testcase` 24 local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
23 25
24 if grep -q "^# ${feature} is not set$" ../.config; then 26 if grep -q "^# ${feature} is not set$" $bindir/.config; then
25 echo UNTESTED: $testname 27 echo UNTESTED: $testname
26 return 0 28 return 0
27 fi 29 fi
@@ -31,7 +33,7 @@ run_applet_testcase ()
31 mkdir -p tmp 33 mkdir -p tmp
32 pushd tmp >/dev/null 34 pushd tmp >/dev/null
33 35
34 sh -x -e ../$testcase >.logfile.txt 2>&1 36 d=$srcdir sh -x -e $testcase >.logfile.txt 2>&1
35 37
36 if [ $? != 0 ] ; then 38 if [ $? != 0 ] ; then
37 echo FAIL: $testname 39 echo FAIL: $testname
@@ -58,8 +60,8 @@ run_applet_tests ()
58 60
59 local status=0 61 local status=0
60 62
61 for testcase in $applet/*; do 63 for testcase in $srcdir/$applet/*; do
62 if [ "$testcase" = "$applet/CVS" ]; then 64 if [ "$testcase" = "$srcdir/$applet/CVS" ]; then
63 continue 65 continue
64 fi 66 fi
65 67
@@ -84,11 +86,11 @@ fi
84if [ $# -ne 0 ]; then 86if [ $# -ne 0 ]; then
85 applets="$@" 87 applets="$@"
86else 88else
87 applets="*" 89 applets=$(ls $srcdir)
88fi 90fi
89 91
90for applet in $applets; do 92for applet in $applets; do
91 if [ "$applet" != CVS -a -d "$applet" ]; then 93 if [ "$applet" != CVS -a -d "$srcdir/$applet" ]; then
92 if run_applet_tests $applet; then 94 if run_applet_tests $applet; then
93 : 95 :
94 else 96 else
diff --git a/testsuite/sort/sort-n-works b/testsuite/sort/sort-n-works
index c9b63a36a..878108ddd 100644
--- a/testsuite/sort/sort-n-works
+++ b/testsuite/sort/sort-n-works
@@ -1,3 +1,4 @@
1sort -n ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox sort -n ../README > logfile.bb 2sort -n "$d/README" > logfile.gnu
3busybox sort -n "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/sort/sort-r-works b/testsuite/sort/sort-r-works
index 6422ba940..6ee0ceb1a 100644
--- a/testsuite/sort/sort-r-works
+++ b/testsuite/sort/sort-r-works
@@ -1,3 +1,4 @@
1sort -r ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox sort -r ../README > logfile.bb 2sort -r "$d/README" > logfile.gnu
3busybox sort -r "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/sort/sort-works b/testsuite/sort/sort-works
index 0110aa010..14a115abf 100644
--- a/testsuite/sort/sort-works
+++ b/testsuite/sort/sort-works
@@ -1,3 +1,4 @@
1sort ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox sort ../README > logfile.bb 2sort "$d/README" > logfile.gnu
3busybox sort "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/tail/tail-n-works b/testsuite/tail/tail-n-works
index 321db7f8a..27a905f88 100644
--- a/testsuite/tail/tail-n-works
+++ b/testsuite/tail/tail-n-works
@@ -1,3 +1,4 @@
1tail -n 2 ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox tail -n 2 ../README > logfile.bb 2tail -n 2 "$d/README" > logfile.gnu
3busybox tail -n 2 "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/tail/tail-works b/testsuite/tail/tail-works
index 321db7f8a..27a905f88 100644
--- a/testsuite/tail/tail-works
+++ b/testsuite/tail/tail-works
@@ -1,3 +1,4 @@
1tail -n 2 ../README > logfile.gnu 1[ -n "$d" ] || d=..
2busybox tail -n 2 ../README > logfile.bb 2tail -n 2 "$d/README" > logfile.gnu
3busybox tail -n 2 "$d/README" > logfile.bb
3cmp logfile.gnu logfile.bb 4cmp logfile.gnu logfile.bb
diff --git a/testsuite/xargs/xargs-works b/testsuite/xargs/xargs-works
index 4ad581804..c95869e89 100644
--- a/testsuite/xargs/xargs-works
+++ b/testsuite/xargs/xargs-works
@@ -1,3 +1,4 @@
1find -name \*works -type f | xargs md5sum > logfile.gnu 1[ -n "$d" ] || d=..
2find -name \*works -type f | busybox xargs md5sum > logfile.bb 2find "$d" -name \*works -type f | xargs md5sum > logfile.gnu
3find "$d" -name \*works -type f | busybox xargs md5sum > logfile.bb
3diff -u logfile.gnu logfile.bb 4diff -u logfile.gnu logfile.bb
diff --git a/util-linux/Makefile b/util-linux/Makefile
index f2e2021f0..4401fd1ed 100644
--- a/util-linux/Makefile
+++ b/util-linux/Makefile
@@ -17,13 +17,15 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR:= ../ 20top_srcdir=..
21top_buildddir=..
22srcdir=$(top_srcdir)/util-linux
21UTILLINUX_DIR:=./ 23UTILLINUX_DIR:=./
22include $(TOPDIR).config 24include $(top_builddir)/Rules.mak
23include $(TOPDIR)Rules.mak 25include $(top_builddir)/.config
24include Makefile.in 26include Makefile.in
25all: $(libraries-y) 27all: $(libraries-y)
26-include $(TOPDIR).depend 28-include $(top_builddir)/.depend
27 29
28clean: 30clean:
29 rm -f *.o *.a $(AR_TARGET) 31 rm -f *.o *.a $(AR_TARGET)
diff --git a/util-linux/Makefile.in b/util-linux/Makefile.in
index 72136f1ce..0172b3562 100644
--- a/util-linux/Makefile.in
+++ b/util-linux/Makefile.in
@@ -19,8 +19,9 @@
19 19
20UTILLINUX_AR:=util-linux.a 20UTILLINUX_AR:=util-linux.a
21ifndef $(UTILLINUX_DIR) 21ifndef $(UTILLINUX_DIR)
22UTILLINUX_DIR:=$(TOPDIR)util-linux/ 22UTILLINUX_DIR:=$(top_builddir)/util-linux/
23endif 23endif
24srcdir=$(top_srcdir)/util-linux
24 25
25UTILLINUX-:= 26UTILLINUX-:=
26UTILLINUX-$(CONFIG_DMESG) +=dmesg.o 27UTILLINUX-$(CONFIG_DMESG) +=dmesg.o
@@ -49,10 +50,13 @@ libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
49$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y)) 50$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
50 $(AR) -ro $@ $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y)) 51 $(AR) -ro $@ $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
51 52
53$(UTILLINUX_DIR)%.o: $(srcdir)/%.c
54 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
55
52ifneq ($(strip $(CONFIG_LFS)),y) 56ifneq ($(strip $(CONFIG_LFS)),y)
53ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y) 57ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y)
54 58
55$(UTILLINUX_DIR)fdisk.o: $(UTILLINUX_DIR)fdisk.c 59$(UTILLINUX_DIR)fdisk.o: $(srcdir)/fdisk.c
56 $(CC) $(CFLAGS) \ 60 $(CC) $(CFLAGS) \
57 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ 61 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
58 $(EXTRA_CFLAGS) -c -o $@ $< 62 $(EXTRA_CFLAGS) -c -o $@ $<