Fixup the new buildsystem a bit.
authorEric Andersen <andersen@codepoet.org>
Wed, 24 Oct 2001 07:58:02 +0000 (07:58 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 24 Oct 2001 07:58:02 +0000 (07:58 -0000)
Makefile
applets/busybox.mkll
applets/busybox.sh [deleted file]

index 8cae385ce28b3aa16981bfa0cad7f8d8186e0f57..864fa7d37824851afe9624bf337c1b5300bbd713 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -200,6 +200,7 @@ CONFIGURATION = menuconfig
 do-it-all:      menuconfig
 endif
 
+
 SUBDIRS =applets archival console-tools editors fileutils findutils init \
        miscutils modutils networking pwd_grp shell shellutils sysklogd \
        textutils util-linux libbb
@@ -209,7 +210,7 @@ bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
 $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
        $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
 
-busybox: bbsubdirs
+busybox: config.h depend bbsubdirs
        $(CC) $(LDFLAGS) -o $@ $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES)
        $(STRIPCMD)
 
@@ -291,13 +292,19 @@ scripts/mkdep: scripts/mkdep.c
 scripts/split-include: scripts/split-include.c
        $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
 
-dep-files: scripts/mkdep #archdep
-       rm -f .depend .hdepend
-       scripts/mkdep -I $(TOPDIR)/include -- `find $(TOPDIR) -name \*.c -print` >> .depend
-       scripts/mkdep -I $(TOPDIR)/include -- `find $(TOPDIR) -name \*.h -print` >> .hdepend
-       $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
+dep-files: scripts/mkdep
+       if [ ! -f .depend ] ; then \
+               rm -f .depend .hdepend; \
+               mkdir -p $(TOPDIR)/include/config; \
+               scripts/mkdep -I $(TOPDIR)/include -- \
+                       `find $(TOPDIR) -name \*.c -print` >> .depend; \
+               scripts/mkdep -I $(TOPDIR)/include -- \
+                       `find $(TOPDIR) -name \*.h -print` >> .hdepend; \
+               $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ; \
+       fi;
+
 
-depend dep: dep-files
+depend dep: config.h dep-files
        @ echo -e "\n\nNow run 'make' to build BusyBox\n\n"
 
 CONFIG_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -308,14 +315,22 @@ include/config/MARKER: scripts/split-include include/config.h
        scripts/split-include include/config.h include/config
        @ touch include/config/MARKER
 
+config.h:
+       @if [ ! -f include/config.h ] ; then \
+               make oldconfig; \
+       fi;
+
 menuconfig:
+       mkdir -p $(TOPDIR)/include/config
        $(MAKE) -C scripts/lxdialog all
        $(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
 
 config:
+       mkdir -p $(TOPDIR)/include/config
        $(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
 
 oldconfig:
+       mkdir -p $(TOPDIR)/include/config
        $(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in
 
 
index 4e15e1611a5aa6889047f74c8e18f2ced81320ef..5b6677d03bdc921cdd038026dea28bc9cd503db0 100755 (executable)
@@ -10,8 +10,8 @@
 export LC_ALL=POSIX
 export LC_CTYPE=POSIX
 
-CONFIG_H=${1:-Config.h}
-APPLETS_H=${2:-applets.h}
+CONFIG_H=${1:-include/config.h}
+APPLETS_H=${2:-include/applets.h}
 gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
   awk '/^[ \t]*LINK/{
        dir=substr($2,8)
diff --git a/applets/busybox.sh b/applets/busybox.sh
deleted file mode 100755 (executable)
index 6ac4e80..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-export LC_ALL=POSIX
-export LC_CTYPE=POSIX
-
-RAW=` \
-    $CC -E -dM ${1:-Config.h} | \
-    sed -n -e '/^.*CONFIG_FEATURE.*$/d;s/^#define.*\<CONFIG_\(.*\)\>/\1.c/gp;' \
-    | tr A-Z a-z | sort
-`
-test "${RAW}" != "" ||  exit
-if [ -d "$CONFIG_SRC_DIR" ]; then cd $CONFIG_SRC_DIR; fi
-# By running $RAW through "ls", we avoid listing
-# source files that don't exist.
-ls $RAW 2>/dev/null | tr '\n' ' '
-