egor duda writes:

Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
This commit is contained in:
Eric Andersen 2004-10-08 07:46:08 +00:00
parent 2842659cc0
commit 7daa076d3e
66 changed files with 460 additions and 242 deletions

147
Makefile
View File

@ -22,37 +22,112 @@
#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig clean distclean \
release tags
TOPDIR=./
include Rules.mak
release tags
ifndef TOPDIR
TOPDIR=$(CURDIR)/
endif
ifndef top_srcdir
top_srcdir=$(CURDIR)
endif
ifndef top_builddir
top_builddir=$(CURDIR)
endif
srctree=$(top_srcdir)
vpath %/Config.in $(srctree)
include $(top_builddir)/Rules.mak
DIRS:=applets archival archival/libunarchive coreutils console-tools \
debianutils editors findutils init miscutils modutils networking \
networking/libiproute networking/udhcp procps loginutils shell \
sysklogd util-linux libpwdgrp coreutils/libcoreutils libbb
SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
ifeq ($(strip $(CONFIG_SELINUX)),y)
CFLAGS += -I/usr/include/selinux
LIBRARIES += -lsecure
endif
CONFIG_CONFIG_IN = sysdeps/$(TARGET_OS)/Config.in
CONFIG_DEFCONFIG = sysdeps/$(TARGET_OS)/defconfig
CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in
CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig
ALL_DIRS:= $(DIRS) scripts/config
ALL_MAKEFILES:=$(patsubst %,%/Makefile,$(ALL_DIRS))
ifeq ($(KBUILD_SRC),)
ifdef O
ifeq ("$(origin O)", "command line")
KBUILD_OUTPUT := $(O)
endif
endif
# That's our default target when none is given on the command line
.PHONY: _all
_all:
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(wildcard $(KBUILD_OUTPUT)),, \
$(error output directory "$(saved-output)" does not exist))
.PHONY: $(MAKECMDGOALS)
$(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile
$(MAKE) -C $(KBUILD_OUTPUT) \
top_srcdir=$(CURDIR) \
top_builddir=$(KBUILD_OUTPUT) \
TOPDIR=$(KBUILD_OUTPUT) \
KBUILD_SRC=$(CURDIR) \
-f $(CURDIR)/Makefile $@
$(KBUILD_OUTPUT)/Rules.mak:
@echo > $@
@echo top_srcdir=$(CURDIR) >> $@
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
@echo include $(top_srcdir)/Rules.mak >> $@
$(KBUILD_OUTPUT)/Makefile:
@echo > $@
@echo top_srcdir=$(CURDIR) >> $@
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
@echo KBUILD_SRC='$$(top_srcdir)' >> $@
@echo include '$$(KBUILD_SRC)'/Makefile >> $@
# Leave processing to above invocation of make
skip-makefile := 1
endif # ifneq ($(KBUILD_OUTPUT),)
endif # ifeq ($(KBUILD_SRC),)
ifeq ($(skip-makefile),)
_all: all
ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
all: busybox busybox.links doc
# In this section, we need .config
-include .config.cmd
include $(patsubst %,%/Makefile.in, $(DIRS))
-include $(TOPDIR).depend
all_tree: $(ALL_MAKEFILES)
busybox: .depend include/config.h $(libraries-y)
$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
# In this section, we need .config
-include $(top_builddir)/.config.cmd
include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
-include $(top_builddir)/.depend
busybox: $(ALL_MAKEFILES) .depend include/config.h $(libraries-y)
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
$(STRIPCMD) $@
busybox.links: applets/busybox.mkll include/config.h
busybox.links: $(top_srcdir)/applets/busybox.mkll include/config.h $(top_srcdir)/include/applets.h
- $(SHELL) $^ >$@
install: applets/install.sh busybox busybox.links
@ -75,14 +150,18 @@ uninstall: busybox.links
install-hardlinks: applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX) --hardlinks
check: busybox
bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
$(top_srcdir)/testsuite/runtest
# Documentation Targets
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
docs/busybox.pod : docs/busybox_header.pod include/usage.h docs/busybox_footer.pod
- ( cat docs/busybox_header.pod; \
docs/autodocifier.pl include/usage.h; \
cat docs/busybox_footer.pod ) > docs/busybox.pod
docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/usage.h $(top_srcdir)/docs/busybox_footer.pod
-mkdir -p docs
- ( cat $(top_srcdir)/docs/busybox_header.pod; \
$(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h; \
cat $(top_srcdir)/docs/busybox_footer.pod ) > docs/busybox.pod
docs/BusyBox.txt: docs/busybox.pod
@echo
@ -99,7 +178,7 @@ docs/BusyBox.1: docs/busybox.pod
docs/BusyBox.html: docs/busybox.net/BusyBox.html
- mkdir -p docs
-@ rm -f docs/BusyBox.html
-@ ln -s busybox.net/BusyBox.html docs/BusyBox.html
-@ cp docs/busybox.net/BusyBox.html docs/BusyBox.html
docs/busybox.net/BusyBox.html: docs/busybox.pod
-@ mkdir -p docs/busybox.net
@ -108,20 +187,19 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
-@ rm -f pod2htm*
# The nifty new buildsystem stuff
scripts/mkdep: scripts/mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
scripts/split-include: scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
scripts/split-include: $(top_srcdir)/scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
.depend: scripts/mkdep
rm -f .depend .hdepend;
mkdir -p include/config;
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
scripts/mkdep -I include -- \
`find -name \*.c -print | sed -e "s,^./,,"` >> .depend;
`find $(top_srcdir) -name \*.c -print | sed -e "s,^./,,"` >> .depend;
scripts/mkdep -I include -- \
`find -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
`find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
depend dep: include/config.h .depend
@ -130,13 +208,10 @@ include/config/MARKER: depend scripts/split-include
@ touch include/config/MARKER
include/config.h: .config
@if [ ! -x ./scripts/config/conf ] ; then \
@if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
$(MAKE) -C scripts/config conf; \
fi;
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
@$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
finished2:
@echo
@ -150,12 +225,16 @@ all: menuconfig
# configuration
# ---------------------------------------------------------------------------
scripts/config/conf:
$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
scripts/config/conf: scripts/config/Makefile Rules.mak
$(MAKE) -C scripts/config conf
-@if [ ! -f .config ] ; then \
cp $(CONFIG_DEFCONFIG) .config; \
fi
scripts/config/mconf:
scripts/config/mconf: scripts/config/Makefile Rules.mak
$(MAKE) -C scripts/config ncurses conf mconf
-@if [ ! -f .config ] ; then \
cp $(CONFIG_DEFCONFIG) .config; \
@ -187,9 +266,6 @@ allnoconfig: scripts/config/conf
defconfig: scripts/config/conf
@./scripts/config/conf -d $(CONFIG_CONFIG_IN)
check: busybox
cd testsuite && ./runtest
clean:
- rm -f docs/busybox.dvi docs/busybox.ps \
docs/busybox.pod docs/busybox.net/busybox.html \
@ -232,7 +308,8 @@ tags:
endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
endif # ifeq ($(skip-makefile),)
.PHONY: dummy subdirs release distclean clean config oldconfig \
menuconfig tags check test depend
menuconfig tags check test depend buildtree

View File

@ -42,7 +42,7 @@ LD = $(CROSS)ld
NM = $(CROSS)nm
STRIP = $(CROSS)strip
CPP = $(CC) -E
MAKEFILES = $(TOPDIR).config
# MAKEFILES = $(top_builddir)/.config
# What OS are you compiling busybox for? This allows you to include
# OS specific things, syscall overrides, etc.
@ -80,7 +80,7 @@ BB_SRC_DIR=
#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
CFLAGS=-I$(TOPDIR)include
CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
ARFLAGS=-r
#--------------------------------------------------------
@ -102,7 +102,7 @@ endif
# Pull in the user's busybox configuration
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(TOPDIR).config
-include $(top_builddir)/.config
endif
# A nifty macro to make testing gcc features easier
@ -189,12 +189,8 @@ endif
# have a chance of winning.
CFLAGS += $(CFLAGS_EXTRA)
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
.PHONY: dummy
.EXPORT_ALL_VARIABLES:

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/applets
APPLETS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir).depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,18 +19,19 @@
APPLETS_AR:=applets.a
ifndef $(APPLETS_DIR)
APPLETS_DIR:=$(TOPDIR)applets/
APPLETS_DIR:=$(top_builddir)/applets/
endif
srcdir=$(top_srcdir)/applets
APPLET_SRC:=applets.c busybox.c
APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
$(APPLET_OBJ): $(TOPDIR).config
$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
$(AR) -ro $@ $(APPLET_OBJ)
$(APPLET_OBJ): $(top_builddir)/.config
$(APPLET_OBJ): $(APPLETS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
ARCHIVAL_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
srcdir=$(top_srcdir)/archival
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
ARCHIVAL_AR:=archival.a
ifndef $(ARCHIVAL_DIR)
ARCHIVAL_DIR:=$(TOPDIR)archival/
ARCHIVAL_DIR:=$(top_builddir)/archival/
endif
srcdir=$(top_srcdir)/archival
ARCHIVAL-y:=
ARCHIVAL-$(CONFIG_APT_GET) +=
@ -42,3 +43,6 @@ libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(ARCHIVAL_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../../
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/archival/libunarchive
LIBUNARCHIVE_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
LIBUNARCHIVE_AR:=libunarchive.a
ifndef $(LIBUNARCHIVE_DIR)
LIBUNARCHIVE_DIR:=$(TOPDIR)archival/libunarchive/
LIBUNARCHIVE_DIR:=$(top_builddir)/archival/libunarchive/
endif
srcdir=$(top_srcdir)/archvial/libunarchive
LIBUNARCHIVE-y:= \
\
@ -78,3 +79,6 @@ libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(LIBUNARCHIVA_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/console/tools
CONSOLETOOLS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
CONSOLETOOLS_AR:=console-tools.a
ifndef $(CONSOLETOOLS_DIR)
CONSOLETOOLS_DIR:=$(TOPDIR)console-tools/
CONSOLETOOLS_DIR:=$(top_builddir)/console-tools/
endif
srcdir=$(top_srcdir)/console-tools
CONSOLETOOLS_DIR-y:=
CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o
@ -38,3 +39,6 @@ libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(CONSOLETOOLS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/coreutils
SHELLUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
COREUTILS_AR:=coreutils.a
ifndef $(COREUTILS_DIR)
COREUTILS_DIR:=$(TOPDIR)coreutils/
COREUTILS_DIR:=$(top_builddir)/coreutils/
endif
srcdir=$(top_srcdir)/coreutils
COREUTILS-y:=
COREUTILS-$(CONFIG_BASENAME) += basename.o
@ -91,3 +92,7 @@ libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(COREUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,16 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../../
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/coreutils/libcoreutils
LIBCOREUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
LIBCOREUTILS_AR:=libcoreutils.a
ifndef $(LIBCOREUTILS_DIR)
LIBCOREUTILS_DIR:=$(TOPDIR)coreutils/libcoreutils/
LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils/
endif
srcdir=$(top_srcdir)/coreutils/libcoreutils
LIBCOREUTILS_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c xgetoptfile_sort_uniq.c
@ -30,3 +31,7 @@ libraries-y+=$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR)
$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR): $(LIBCOREUTILS_OBJS)
$(AR) -ro $@ $(LIBCOREUTILS_OBJS)
$(LIBCOREUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/debianutils
DEBIANUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,9 +19,9 @@
DEBIANUTILS_AR:=debianutils.a
ifndef $(DEBIANUTILS_DIR)
DEBIANUTILS_DIR:=$(TOPDIR)debianutils/
DEBIANUTILS_DIR:=$(top_builddir)/debianutils/
endif
srcdir=$(top_srcdir)/debianutils
DEBIANUTILS-y:=
DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
@ -36,3 +36,6 @@ libraries-y+=$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR)
$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR): $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
$(AR) -ro $@ $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
$(DEBIANUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/editors
EDITOR_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
EDITOR_AR:=editors.a
ifndef $(EDITOR_DIR)
EDITOR_DIR:=$(TOPDIR)editors/
EDITOR_DIR:=$(top_builddir)/editors/
endif
srcdir=$(top_srcdir)/editors
EDITOR-y:=
EDITOR-$(CONFIG_AWK) += awk.o
@ -42,3 +43,6 @@ endif
$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
$(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
$(EDITOR_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/findutils
FINDUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
FINDUTILS_AR:=findutils.a
ifndef $(FINDUTILS_DIR)
FINDUTILS_DIR:=$(TOPDIR)findutils/
FINDUTILS_DIR:=$(top_builddir)/findutils/
endif
srcdir=$(top_srcdir)/findutils
FINDUTILS-y:=
FINDUTILS-$(CONFIG_FIND) += find.o
@ -32,3 +33,6 @@ libraries-y+=$(FINDUTILS_DIR)$(FINDUTILS_AR)
$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
$(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
$(FINDUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/init
INIT_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
INIT_AR:=init.a
ifndef $(INIT_DIR)
INIT_DIR:=$(TOPDIR)init/
INIT_DIR:=$(top_builddir)/init/
endif
srcdir=$(top_srcdir)/init
INIT-y:=
INIT-$(CONFIG_HALT) += halt.o
@ -56,3 +57,6 @@ libraries-y+=$(INIT_DIR)$(INIT_AR)
$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
$(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
$(INIT_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/libbb
LIBBB_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -16,12 +16,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LIBBB_AR:=libbb.a
ifndef $(LIBBB_DIR)
LIBBB_DIR:=$(TOPDIR)libbb/
LIBBB_DIR:=$(top_builddir)/libbb/
endif
srcdir=$(top_srcdir)/libbb
LIBBB_SRC:= \
bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
@ -51,7 +50,7 @@ LIBBB_SRC:= \
LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC))
LIBBB_MSRC0:=$(LIBBB_DIR)messages.c
LIBBB_MSRC0:=$(srcdir)/messages.c
LIBBB_MOBJ0:=full_version.o \
memory_exhausted.o invalid_date.o io_error.o \
write_error.o name_longer_than_foo.o unknown.o \
@ -60,19 +59,19 @@ LIBBB_MOBJ0:=full_version.o \
securetty_file.o motd_file.o \
msg_standard_input.o msg_standard_output.o shell_file.o
LIBBB_MSRC1:=$(LIBBB_DIR)xfuncs.c
LIBBB_MSRC1:=$(srcdir)/xfuncs.c
LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \
xfopen.o xopen.o xread.o xread_all.o xread_char.o \
xferror.o xferror_stdout.o xfflush_stdout.o strlen.o
LIBBB_MSRC2:=$(LIBBB_DIR)printf.c
LIBBB_MSRC2:=$(srcdir)/printf.c
LIBBB_MOBJ2:=bb_vfprintf.o bb_vprintf.o bb_fprintf.o bb_printf.o
LIBBB_MSRC3:=$(LIBBB_DIR)xgetularg.c
LIBBB_MSRC3:=$(srcdir)/xgetularg.c
LIBBB_MOBJ3:=xgetularg_bnd_sfx.o xgetlarg_bnd_sfx.o getlarg10_sfx.o \
xgetularg_bnd.o xgetularg10_bnd.o xgetularg10.o
LIBBB_MSRC4:=$(LIBBB_DIR)/safe_strtol.c
LIBBB_MSRC4:=$(srcdir)/safe_strtol.c
LIBBB_MOBJ4:=safe_strtoi.o safe_strtod.o safe_strtol.o safe_strtoul.o
LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0))
@ -88,6 +87,9 @@ $(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
$(AR) -ro $@ $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
$(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4)
$(LIBBB_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
$(LIBBB_MOBJS0): $(LIBBB_MSRC0)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/libpwgrp
LIBPWDGRP_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,11 +19,12 @@
LIBPWDGRP_AR:=libpwdgrp.a
ifndef $(LIBPWDGRP_DIR)
LIBPWDGRP_DIR:=$(TOPDIR)libpwdgrp/
LIBPWDGRP_DIR:=$(top_builddir)/libpwdgrp/
endif
srcdir=$(top_srcdir)/libpwdgrp
LIBPWDGRP_MSRC0:=$(LIBPWDGRP_DIR)pwd_grp.c
LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c
LIBPWDGRP_MOBJ0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r.o fgetgrent_r.o \
fgetpwent.o fgetgrent.o getpwnam_r.o getgrnam_r.o getpwuid_r.o \
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 \
initgroups.o putpwent.o putgrent.o
LIBPWDGRP_MOBJS0=$(patsubst %,$(LIBPWDGRP_DIR)%, $(LIBPWDGRP_MOBJ0-y))
LIBPWDGRP_MSRC1:=$(LIBPWDGRP_DIR)pwd_grp.c
LIBPWDGRP_MSRC1:=$(srcdir)/pwd_grp.c
LIBPWDGRP_MOBJ1-$(CONFIG_USE_BB_PWD_GRP):= __parsepwent.o __parsegrent.o \
__pgsreader.o fgetspent_r.o fgetspent.o sgetspent_r.o getspnam_r.o \
getspnam.o getspent_r.o getspent.o sgetspent.o \

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/loginutils
LOGINUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
LOGINUTILS_AR:=loginutils.a
ifndef LOGINUTILS_DIR
LOGINUTILS_DIR:=$(TOPDIR)loginutils/
LOGINUTILS_DIR:=$(top_builddir)/loginutils/
endif
srcdir=$(top_srcdir)/loginutils
LOGINUTILS-y:=
LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o
@ -51,3 +52,6 @@ endif
$(LOGINUTILS_DIR)$(LOGINUTILS_AR): $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y))
$(AR) -ro $@ $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y))
$(LOGINUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/miscutils
MISCUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,9 +19,9 @@
MISCUTILS_AR:=miscutils.a
ifndef $(MISCUTILS_DIR)
MISCUTILS_DIR:=$(TOPDIR)miscutils/
MISCUTILS_DIR:=$(top_builddir)/miscutils/
endif
srcdir=$(top_srcdir)/miscutils
MISCUTILS-y:=
MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
@ -50,3 +50,6 @@ endif
$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
$(AR) -ro $@ $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
$(MISCUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/modutils
MODUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
MODUTILS_AR:=modutils.a
ifndef $(MODUTILS_DIR)
MODUTILS_DIR:=$(TOPDIR)modutils/
MODUTILS_DIR:=$(top_builddir)/modutils/
endif
srcdir=$(top_srcdir)/modutils
MODUTILS-y:=
MODUTILS-$(CONFIG_INSMOD) += insmod.o
@ -33,3 +34,6 @@ libraries-y+=$(MODUTILS_DIR)$(MODUTILS_AR)
$(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
$(AR) -ro $@ $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
$(MODUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/networking
NETWORKING_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,9 +19,9 @@
NETWORKING_AR:=networking.a
ifndef $(NETWORKING_DIR)
NETWORKING_DIR:=$(TOPDIR)networking/
NETWORKING_DIR:=$(top_builddir)/networking/
endif
srcdir=$(top_srcdir)/networking
NETWORKING-y:=
NETWORKING-$(CONFIG_ARPING) += arping.o
NETWORKING-$(CONFIG_FTPGET) += ftpgetput.o
@ -63,3 +63,6 @@ endif
$(NETWORKING_DIR)$(NETWORKING_AR): $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
$(AR) -ro $@ $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
$(NETWORKING_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../../
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/networking/libiproute
LIBIPROUTE_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
LIBIPROUTE_AR:=libiproute.a
ifndef $(LIBIPROUTE_DIR)
LIBIPROUTE_DIR:=$(TOPDIR)networking/libiproute/
LIBIPROUTE_DIR:=$(top_builddir)/networking/libiproute/
endif
srcdir=$(top_srcdir)/networking/libiproute
LIBIPROUTE-$(CONFIG_IP) += \
ip_parse_common_args.o \
@ -78,3 +79,6 @@ libraries-y+=$(LIBIPROUTE_DIR)$(LIBIPROUTE_AR)
$(LIBIPROUTE_DIR)$(LIBIPROUTE_AR): $(patsubst %,$(LIBIPROUTE_DIR)%, $(LIBIPROUTE-y))
$(AR) -ro $@ $(patsubst %,$(LIBIPROUTE_DIR)%, $(LIBIPROUTE-y))
$(LIBIPROUTE_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../../
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/networking/udhcp
UDHCP_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
UDHCP_AR:=udhcp.a
ifndef $(UDHCP_DIR)
UDHCP_DIR:=$(TOPDIR)networking/udhcp/
UDHCP_DIR:=$(top_builddir)/networking/udhcp/
endif
srcdir=$(top_srcdir)/networking/udhcp
#ok, so I forgot how to do an or, but this is a quick and dirty hack
ifeq ($(CONFIG_UDHCPC), y)
@ -48,6 +49,6 @@ libraries-y+=$(UDHCP_DIR)$(UDHCP_AR)
$(UDHCP_DIR)$(UDHCP_AR): $(UDHCP_OBJS)
$(AR) -ro $@ $(UDHCP_OBJS)
$(UDHCP_OBJS): %.o : %.c
$(UDHCP_OBJS): $(UDHCP_DIR)%.o : $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DIN_BUSYBOX -c $< -o $@

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/procps
PROCPS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
PROCPS_AR:=procps.a
ifndef $(PROCPS_DIR)
PROCPS_DIR:=$(TOPDIR)procps/
PROCPS_DIR:=$(top_builddir)/procps/
endif
srcdir=$(top_srcdir)/procps
PROCPS-y:=
PROCPS-$(CONFIG_FREE) += free.o
@ -37,3 +38,6 @@ libraries-y+=$(PROCPS_DIR)$(PROCPS_AR)
$(PROCPS_DIR)$(PROCPS_AR): $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
$(AR) -ro $@ $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
$(PROCPS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -2,8 +2,10 @@
#
# Copyright (C) 2002 Erik Andersen <andersen@codepoet.org>
TOPDIR=../../
include $(TOPDIR)Rules.mak
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/scripts/config
include $(top_builddir)/Rules.mak
all: ncurses conf mconf
@ -33,7 +35,8 @@ endif
CONF_SRC =conf.c
MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
SHARED_SRC=zconf.tab.c
SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h
SHARED_DEPS:=$(srcdir)/lkc.h $(srcdir)/lkc_proto.h \
lkc_defs.h $(srcdir)/expr.h zconf.tab.h
CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
@ -44,13 +47,13 @@ conf: $(CONF_OBJS) $(SHARED_OBJS)
mconf: $(MCONF_OBJS) $(SHARED_OBJS)
$(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
$(CONF_OBJS): %.o : %.c $(SHARED_DEPS)
$(CONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS)
$(MCONF_OBJS): %.o : $(srcdir)/%.c $(SHARED_DEPS)
$(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
lkc_defs.h: lkc_proto.h
lkc_defs.h: $(srcdir)/lkc_proto.h
@sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
###
@ -61,29 +64,30 @@ lkc_defs.h: lkc_proto.h
ifdef LKC_GENPARSER
%.tab.c %.tab.h: %.y
%.tab.c %.tab.h: $(srcdir)/%.y
bison -t -d -v -b $* -p $(notdir $*) $<
lex.%.c: %.l
lex.%.c: $(srcdir)/%.l
flex -P$(notdir $*) -o$@ $<
else
lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
$(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -c $< -o $@
lex.zconf.c: lex.zconf.c_shipped
cp lex.zconf.c_shipped lex.zconf.c
lex.zconf.c: $(srcdir)/lex.zconf.c_shipped
cp $< $@
zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
$(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
zconf.tab.c: $(srcdir)/zconf.tab.c_shipped
cp $< $@
zconf.tab.c: zconf.tab.c_shipped
cp zconf.tab.c_shipped zconf.tab.c
zconf.tab.h: zconf.tab.h_shipped
cp zconf.tab.h_shipped zconf.tab.h
zconf.tab.h: $(srcdir)/zconf.tab.h_shipped
cp $< $@
endif
zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
$(srcdir)/symbol.c $(srcdir)/menu.c $(SHARED_DEPS)
$(HOSTCC) $(HOSTCFLAGS) -I$(srcdir) -I. -c $< -o $@
.PHONY: ncurses
ncurses:

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/shell
SHELL_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
SHELL_AR:=shell.a
ifndef $(SHELL_DIR)
SHELL_DIR:=$(TOPDIR)shell/
SHELL_DIR:=$(top_builddir)/shell/
endif
srcdir=$(top_srcdir)/shell
SHELLT-y:=
SHELLT-$(CONFIG_ASH) += ash.o
@ -34,3 +35,6 @@ libraries-y+=$(SHELL_DIR)$(SHELL_AR)
$(SHELL_DIR)$(SHELL_AR): $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
$(AR) -ro $@ $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
$(SHELL_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_buildddir=..
srcdir=$(top_srcdir)/sysklogd
SYSKLOGD_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
SYSKLOGD_AR:=sysklogd.a
ifndef $(SYSKLOGD_DIR)
SYSKLOGD_DIR:=$(TOPDIR)sysklogd/
SYSKLOGD_DIR:=$(top_builddir)/sysklogd/
endif
srcdir=$(top_srcdir)/sysklogd
SYSKLOGD-:=
SYSKLOGD-$(CONFIG_KLOGD) += klogd.o
@ -33,3 +34,6 @@ libraries-y+=$(SYSKLOGD_DIR)$(SYSKLOGD_AR)
$(SYSKLOGD_DIR)$(SYSKLOGD_AR): $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
$(AR) -ro $@ $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
$(SYSKLOGD_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

View File

@ -1,3 +1,4 @@
du -h .. > logfile.gnu
busybox du -h .. > logfile.bb
[ -n "$d" ] || d=..
du -h "$d" > logfile.gnu
busybox du -h "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
du -k .. > logfile.gnu
busybox du -k .. > logfile.bb
[ -n "$d" ] || d=..
du -k "$d" > logfile.gnu
busybox du -k "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
du -l .. > logfile.gnu
busybox du -l .. > logfile.bb
[ -n "$d" ] || d=..
du -l "$d" > logfile.gnu
busybox du -l "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
du -m .. > logfile.gnu
busybox du -m .. > logfile.bb
[ -n "$d" ] || d=..
du -m "$d" > logfile.gnu
busybox du -m "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
du -s .. > logfile.gnu
busybox du -s .. > logfile.bb
[ -n "$d" ] || d=..
du -s "$d" > logfile.gnu
busybox du -s "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
du .. > logfile.gnu
busybox du .. > logfile.bb
[ -n "$d" ] || d=..
du "$d" > logfile.gnu
busybox du "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
head -n 2 ../README > logfile.gnu
busybox head -n 2 ../README > logfile.bb
[ -n "$d" ] || d=..
head -n 2 "$d/README" > logfile.gnu
busybox head -n 2 "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
head ../README > logfile.gnu
busybox head ../README > logfile.bb
[ -n "$d" ] || d=..
head "$d/README" > logfile.gnu
busybox head "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
ls -1 .. > logfile.gnu
busybox ls -1 .. > logfile.bb
[ -n "$d" ] || d=..
ls -1 "$d" > logfile.gnu
busybox ls -1 "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
ls -h .. > logfile.gnu
busybox ls -h .. > logfile.bb
[ -n "$d" ] || d=..
ls -h "$d" > logfile.gnu
busybox ls -h "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
ls -l .. > logfile.gnu
busybox ls -l .. > logfile.bb
[ -n "$d" ] || d=..
ls -l "$d" > logfile.gnu
busybox ls -l "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
ls -1s .. > logfile.gnu
busybox ls -1s .. > logfile.bb
[ -n "$d" ] || d=..
ls -1s "$d" > logfile.gnu
busybox ls -1s "$d" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,6 +1,8 @@
#!/bin/sh
PATH=$(dirname $(pwd)):$PATH
[ -n "$srcdir" ] || srcdir=$(pwd)
[ -n "$bindir" ] || bindir=$(dirname $(pwd))
PATH=$bindir:$PATH
run_applet_testcase ()
{
@ -13,7 +15,7 @@ run_applet_testcase ()
local uc_applet=$(echo $applet | tr a-z A-Z)
local testname=$(basename $testcase)
if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then
if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
echo UNTESTED: $testname
return 0
fi
@ -21,7 +23,7 @@ run_applet_testcase ()
if grep -q "^# FEATURE: " $testcase; then
local feature=`sed -ne 's/^# FEATURE: //p' $testcase`
if grep -q "^# ${feature} is not set$" ../.config; then
if grep -q "^# ${feature} is not set$" $bindir/.config; then
echo UNTESTED: $testname
return 0
fi
@ -31,7 +33,7 @@ run_applet_testcase ()
mkdir -p tmp
pushd tmp >/dev/null
sh -x -e ../$testcase >.logfile.txt 2>&1
d=$srcdir sh -x -e $testcase >.logfile.txt 2>&1
if [ $? != 0 ] ; then
echo FAIL: $testname
@ -58,8 +60,8 @@ run_applet_tests ()
local status=0
for testcase in $applet/*; do
if [ "$testcase" = "$applet/CVS" ]; then
for testcase in $srcdir/$applet/*; do
if [ "$testcase" = "$srcdir/$applet/CVS" ]; then
continue
fi
@ -84,11 +86,11 @@ fi
if [ $# -ne 0 ]; then
applets="$@"
else
applets="*"
applets=$(ls $srcdir)
fi
for applet in $applets; do
if [ "$applet" != CVS -a -d "$applet" ]; then
if [ "$applet" != CVS -a -d "$srcdir/$applet" ]; then
if run_applet_tests $applet; then
:
else

View File

@ -1,3 +1,4 @@
sort -n ../README > logfile.gnu
busybox sort -n ../README > logfile.bb
[ -n "$d" ] || d=..
sort -n "$d/README" > logfile.gnu
busybox sort -n "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
sort -r ../README > logfile.gnu
busybox sort -r ../README > logfile.bb
[ -n "$d" ] || d=..
sort -r "$d/README" > logfile.gnu
busybox sort -r "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
sort ../README > logfile.gnu
busybox sort ../README > logfile.bb
[ -n "$d" ] || d=..
sort "$d/README" > logfile.gnu
busybox sort "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
tail -n 2 ../README > logfile.gnu
busybox tail -n 2 ../README > logfile.bb
[ -n "$d" ] || d=..
tail -n 2 "$d/README" > logfile.gnu
busybox tail -n 2 "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
tail -n 2 ../README > logfile.gnu
busybox tail -n 2 ../README > logfile.bb
[ -n "$d" ] || d=..
tail -n 2 "$d/README" > logfile.gnu
busybox tail -n 2 "$d/README" > logfile.bb
cmp logfile.gnu logfile.bb

View File

@ -1,3 +1,4 @@
find -name \*works -type f | xargs md5sum > logfile.gnu
find -name \*works -type f | busybox xargs md5sum > logfile.bb
[ -n "$d" ] || d=..
find "$d" -name \*works -type f | xargs md5sum > logfile.gnu
find "$d" -name \*works -type f | busybox xargs md5sum > logfile.bb
diff -u logfile.gnu logfile.bb

View File

@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_buildddir=..
srcdir=$(top_srcdir)/util-linux
UTILLINUX_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)

View File

@ -19,8 +19,9 @@
UTILLINUX_AR:=util-linux.a
ifndef $(UTILLINUX_DIR)
UTILLINUX_DIR:=$(TOPDIR)util-linux/
UTILLINUX_DIR:=$(top_builddir)/util-linux/
endif
srcdir=$(top_srcdir)/util-linux
UTILLINUX-:=
UTILLINUX-$(CONFIG_DMESG) +=dmesg.o
@ -49,10 +50,13 @@ libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
$(AR) -ro $@ $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
$(UTILLINUX_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
ifneq ($(strip $(CONFIG_LFS)),y)
ifeq ($(strip $(FDISK_SUPPORT_LARGE_DISKS)),y)
$(UTILLINUX_DIR)fdisk.o: $(UTILLINUX_DIR)fdisk.c
$(UTILLINUX_DIR)fdisk.o: $(srcdir)/fdisk.c
$(CC) $(CFLAGS) \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
$(EXTRA_CFLAGS) -c -o $@ $<