diff options
-rw-r--r-- | Makefile | 29 | ||||
-rwxr-xr-x | applets/busybox.mkll | 4 | ||||
-rwxr-xr-x | applets/busybox.sh | 16 |
3 files changed, 24 insertions, 25 deletions
@@ -200,6 +200,7 @@ CONFIGURATION = menuconfig | |||
200 | do-it-all: menuconfig | 200 | do-it-all: menuconfig |
201 | endif | 201 | endif |
202 | 202 | ||
203 | |||
203 | SUBDIRS =applets archival console-tools editors fileutils findutils init \ | 204 | SUBDIRS =applets archival console-tools editors fileutils findutils init \ |
204 | miscutils modutils networking pwd_grp shell shellutils sysklogd \ | 205 | miscutils modutils networking pwd_grp shell shellutils sysklogd \ |
205 | textutils util-linux libbb | 206 | textutils util-linux libbb |
@@ -209,7 +210,7 @@ bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS)) | |||
209 | $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER | 210 | $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER |
210 | $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@) | 211 | $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@) |
211 | 212 | ||
212 | busybox: bbsubdirs | 213 | busybox: config.h depend bbsubdirs |
213 | $(CC) $(LDFLAGS) -o $@ $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES) | 214 | $(CC) $(LDFLAGS) -o $@ $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES) |
214 | $(STRIPCMD) | 215 | $(STRIPCMD) |
215 | 216 | ||
@@ -291,13 +292,19 @@ scripts/mkdep: scripts/mkdep.c | |||
291 | scripts/split-include: scripts/split-include.c | 292 | scripts/split-include: scripts/split-include.c |
292 | $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c | 293 | $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c |
293 | 294 | ||
294 | dep-files: scripts/mkdep #archdep | 295 | dep-files: scripts/mkdep |
295 | rm -f .depend .hdepend | 296 | if [ ! -f .depend ] ; then \ |
296 | scripts/mkdep -I $(TOPDIR)/include -- `find $(TOPDIR) -name \*.c -print` >> .depend | 297 | rm -f .depend .hdepend; \ |
297 | scripts/mkdep -I $(TOPDIR)/include -- `find $(TOPDIR) -name \*.h -print` >> .hdepend | 298 | mkdir -p $(TOPDIR)/include/config; \ |
298 | $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" | 299 | scripts/mkdep -I $(TOPDIR)/include -- \ |
300 | `find $(TOPDIR) -name \*.c -print` >> .depend; \ | ||
301 | scripts/mkdep -I $(TOPDIR)/include -- \ | ||
302 | `find $(TOPDIR) -name \*.h -print` >> .hdepend; \ | ||
303 | $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ; \ | ||
304 | fi; | ||
305 | |||
299 | 306 | ||
300 | depend dep: dep-files | 307 | depend dep: config.h dep-files |
301 | @ echo -e "\n\nNow run 'make' to build BusyBox\n\n" | 308 | @ echo -e "\n\nNow run 'make' to build BusyBox\n\n" |
302 | 309 | ||
303 | CONFIG_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \ | 310 | CONFIG_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
@@ -308,14 +315,22 @@ include/config/MARKER: scripts/split-include include/config.h | |||
308 | scripts/split-include include/config.h include/config | 315 | scripts/split-include include/config.h include/config |
309 | @ touch include/config/MARKER | 316 | @ touch include/config/MARKER |
310 | 317 | ||
318 | config.h: | ||
319 | @if [ ! -f include/config.h ] ; then \ | ||
320 | make oldconfig; \ | ||
321 | fi; | ||
322 | |||
311 | menuconfig: | 323 | menuconfig: |
324 | mkdir -p $(TOPDIR)/include/config | ||
312 | $(MAKE) -C scripts/lxdialog all | 325 | $(MAKE) -C scripts/lxdialog all |
313 | $(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in | 326 | $(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in |
314 | 327 | ||
315 | config: | 328 | config: |
329 | mkdir -p $(TOPDIR)/include/config | ||
316 | $(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in | 330 | $(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in |
317 | 331 | ||
318 | oldconfig: | 332 | oldconfig: |
333 | mkdir -p $(TOPDIR)/include/config | ||
319 | $(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in | 334 | $(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in |
320 | 335 | ||
321 | 336 | ||
diff --git a/applets/busybox.mkll b/applets/busybox.mkll index 4e15e1611..5b6677d03 100755 --- a/applets/busybox.mkll +++ b/applets/busybox.mkll | |||
@@ -10,8 +10,8 @@ | |||
10 | export LC_ALL=POSIX | 10 | export LC_ALL=POSIX |
11 | export LC_CTYPE=POSIX | 11 | export LC_CTYPE=POSIX |
12 | 12 | ||
13 | CONFIG_H=${1:-Config.h} | 13 | CONFIG_H=${1:-include/config.h} |
14 | APPLETS_H=${2:-applets.h} | 14 | APPLETS_H=${2:-include/applets.h} |
15 | gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H | | 15 | gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H | |
16 | awk '/^[ \t]*LINK/{ | 16 | awk '/^[ \t]*LINK/{ |
17 | dir=substr($2,8) | 17 | dir=substr($2,8) |
diff --git a/applets/busybox.sh b/applets/busybox.sh deleted file mode 100755 index 6ac4e8043..000000000 --- a/applets/busybox.sh +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | export LC_ALL=POSIX | ||
4 | export LC_CTYPE=POSIX | ||
5 | |||
6 | RAW=` \ | ||
7 | $CC -E -dM ${1:-Config.h} | \ | ||
8 | sed -n -e '/^.*CONFIG_FEATURE.*$/d;s/^#define.*\<CONFIG_\(.*\)\>/\1.c/gp;' \ | ||
9 | | tr A-Z a-z | sort | ||
10 | ` | ||
11 | test "${RAW}" != "" || exit | ||
12 | if [ -d "$CONFIG_SRC_DIR" ]; then cd $CONFIG_SRC_DIR; fi | ||
13 | # By running $RAW through "ls", we avoid listing | ||
14 | # source files that don't exist. | ||
15 | ls $RAW 2>/dev/null | tr '\n' ' ' | ||
16 | |||