Fixup the new buildsystem a bit.

This commit is contained in:
Eric Andersen 2001-10-24 07:58:02 +00:00
parent b36e684fd7
commit 3cd2760ba1
3 changed files with 24 additions and 25 deletions

View File

@ -200,6 +200,7 @@ CONFIGURATION = menuconfig
do-it-all: menuconfig do-it-all: menuconfig
endif endif
SUBDIRS =applets archival console-tools editors fileutils findutils init \ SUBDIRS =applets archival console-tools editors fileutils findutils init \
miscutils modutils networking pwd_grp shell shellutils sysklogd \ miscutils modutils networking pwd_grp shell shellutils sysklogd \
textutils util-linux libbb textutils util-linux libbb
@ -209,7 +210,7 @@ bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER $(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
$(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@) $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
busybox: bbsubdirs busybox: config.h depend bbsubdirs
$(CC) $(LDFLAGS) -o $@ $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES) $(CC) $(LDFLAGS) -o $@ $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES)
$(STRIPCMD) $(STRIPCMD)
@ -291,13 +292,19 @@ scripts/mkdep: scripts/mkdep.c
scripts/split-include: scripts/split-include.c scripts/split-include: scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
dep-files: scripts/mkdep #archdep dep-files: scripts/mkdep
rm -f .depend .hdepend if [ ! -f .depend ] ; then \
scripts/mkdep -I $(TOPDIR)/include -- `find $(TOPDIR) -name \*.c -print` >> .depend rm -f .depend .hdepend; \
scripts/mkdep -I $(TOPDIR)/include -- `find $(TOPDIR) -name \*.h -print` >> .hdepend mkdir -p $(TOPDIR)/include/config; \
$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" 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" @ echo -e "\n\nNow run 'make' to build BusyBox\n\n"
CONFIG_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \ 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 scripts/split-include include/config.h include/config
@ touch include/config/MARKER @ touch include/config/MARKER
config.h:
@if [ ! -f include/config.h ] ; then \
make oldconfig; \
fi;
menuconfig: menuconfig:
mkdir -p $(TOPDIR)/include/config
$(MAKE) -C scripts/lxdialog all $(MAKE) -C scripts/lxdialog all
$(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in $(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
config: config:
mkdir -p $(TOPDIR)/include/config
$(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in $(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
oldconfig: oldconfig:
mkdir -p $(TOPDIR)/include/config
$(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in $(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in

View File

@ -10,8 +10,8 @@
export LC_ALL=POSIX export LC_ALL=POSIX
export LC_CTYPE=POSIX export LC_CTYPE=POSIX
CONFIG_H=${1:-Config.h} CONFIG_H=${1:-include/config.h}
APPLETS_H=${2:-applets.h} APPLETS_H=${2:-include/applets.h}
gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H | gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
awk '/^[ \t]*LINK/{ awk '/^[ \t]*LINK/{
dir=substr($2,8) dir=substr($2,8)

View File

@ -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' ' '