Completely rework the config system so that it no longer annoys me to work on
authorEric Andersen <andersen@codepoet.org>
Fri, 12 Apr 2002 12:05:57 +0000 (12:05 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 12 Apr 2002 12:05:57 +0000 (12:05 -0000)
the busybox development tree.  This eliminates the use of recursive make, and
once again allows us to run 'make' in a subdirectory with the expected result.
And things are now much faster too.  Greatly improved IMHO...
 -Erik

32 files changed:
Makefile
Rules.mak
applets/Makefile
applets/Makefile.in [new file with mode: 0644]
archival/Makefile
archival/Makefile.in [new file with mode: 0644]
archival/libunarchive/Makefile
archival/libunarchive/Makefile.in [new file with mode: 0644]
console-tools/Makefile
console-tools/Makefile.in [new file with mode: 0644]
editors/Makefile
editors/Makefile.in [new file with mode: 0644]
findutils/Makefile
findutils/Makefile.in [new file with mode: 0644]
init/Makefile
init/Makefile.in [new file with mode: 0644]
libbb/Makefile
libbb/Makefile.in [new file with mode: 0644]
miscutils/Makefile
miscutils/Makefile.in [new file with mode: 0644]
modutils/Makefile
modutils/Makefile.in [new file with mode: 0644]
networking/Makefile
networking/Makefile.in [new file with mode: 0644]
procps/Makefile
procps/Makefile.in [new file with mode: 0644]
shell/Makefile
shell/Makefile.in [new file with mode: 0644]
sysklogd/Makefile
sysklogd/Makefile.in [new file with mode: 0644]
util-linux/Makefile
util-linux/Makefile.in [new file with mode: 0644]

index 19c28ed..28b041c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-PROG      := busybox
-VERSION   := 0.61.pre
-BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
-TOPDIR    := ${shell /bin/pwd}
-HOSTCC    := gcc
-HOSTCFLAGS:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-
-
-# What OS are you compiling busybox for?  This allows you to include
-# OS specific things, syscall overrides, etc.
-TARGET_OS := linux
-
-# With a modern GNU make(1) (highly recommended, that's what all the
-# developers use), all of the following configuration values can be
-# overridden at the command line.  For example:
-#   make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
-
-# If you want to add some simple compiler switches (like -march=i686),
-# especially from the command line, use this instead of CFLAGS directly.
-# For optimization overrides, it's better still to set OPTIMIZATION.
-CFLAGS_EXTRA =
-# If you want a static binary, turn this on.
-DOSTATIC = false
-
-# Set the following to `true' to make a debuggable build.
-# Leave this set to `false' for production use.
-DODEBUG = false
-
-# This enables compiling with dmalloc ( http://dmalloc.com/ )
-# which is an excellent public domain mem leak and malloc problem
-# detector.  To enable dmalloc, before running busybox you will
-# want to first set up your environment.
-# eg: `export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile`
-# The debug= value is generated using the following command
-# dmalloc -p log-stats -p log-non-free -p log-bad-space -p log-elapsed-time \
-#      -p check-fence -p check-heap -p check-lists -p check-blank \
-#      -p check-funcs -p realloc-copy -p allow-free-null
-# Do not enable this for production builds...
-DODMALLOC = false
-
-# Electric-fence is another very useful malloc debugging library.
-# Do not enable this for production builds...
-DOEFENCE  = false
-
-# If you want large file summit support, turn this on.
-# This has no effect if you don't have a kernel with lfs
-# support, and a system with libc-2.1.3 or later.
-# Some of the programs that can benefit from lfs support
-# are dd, gzip, mount, tar, and mkfs_minix.
-# LFS allows you to use the above programs for files
-# larger than 2GB!
-DOLFS = false
-
-# If you have a "pristine" source directory, point BB_SRC_DIR to it.
-# Experimental and incomplete; tell the mailing list
-# <busybox@busybox.net> if you do or don't like it so far.
-BB_SRC_DIR =
-
-# If you are running a cross compiler, you may want to set CROSS
-# to something more interesting, like "arm-linux-".
-CROSS =
-CC              = $(CROSS)gcc
-AR              = $(CROSS)ar
-AS              = $(CROSS)as
-LD              = $(CROSS)ld
-NM              = $(CROSS)nm
-STRIP           = $(CROSS)strip
-CPP             = $(CC) -E
-MAKEFILES       = $(TOPDIR)/.config
-export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
-
-
-# To compile vs uClibc, just use the compiler wrapper built by uClibc...
-# Everything should compile and work as expected these days...
-#CC = /usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
-
-# To compile vs some other alternative libc, you may need to use/adjust
-# the following lines to meet your needs...
-#
-# If you are using Red Hat 6.x with the compatible RPMs (for developing under
-# Red Hat 5.x and glibc 2.0) uncomment the following.  Be sure to read about
-# using the compatible RPMs (compat-*) at http://www.redhat.com !
-#LIBCDIR=/usr/i386-glibc20-linux
-#
-# The following is used for libc5 (if you install altgcc and libc5-altdev
-# on a Debian system).  
-#LIBCDIR=/usr/i486-linuxlibc1
-#
-# For other libraries, you are on your own...
-#LDFLAGS+=-nostdlib
-#LIBRARIES = $(LIBCDIR)/lib/libc.a -lgcc
-#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
-#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
-
-# use '-Os' optimization if available, else use -O2
-OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
-       >/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
-GCC_STACK_BOUNDRY := ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
-       >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
-OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY) #-fstrict-aliasing -march=i386 -mcpu=i386 -malign-functions=0 -malign-jumps=0
-WARNINGS=-Wall -Wstrict-prototypes -Wshadow
-CFLAGS = -I$(TOPDIR)/include
-ARFLAGS = -r
-
-#
-#--------------------------------------------------------
-# If you're going to do a lot of builds with a non-vanilla configuration,
-# it makes sense to adjust parameters above, so you can type "make"
-# by itself, instead of following it by the same half-dozen overrides
-# every time.  The stuff below, on the other hand, is probably less
-# prone to casual user adjustment.
-# 
-
-ifeq ($(strip $(DOLFS)),true)
-    # For large file summit support
-    CFLAGS+=-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64
-endif
-ifeq ($(strip $(DODMALLOC)),true)
-    # For testing mem leaks with dmalloc
-    CFLAGS+=-DDMALLOC
-    LIBRARIES = -ldmalloc
-    # Force debug=true, since this is useless when not debugging...
-    DODEBUG = true
-else
-    ifeq ($(strip $(DOEFENCE)),true)
-       LIBRARIES = -lefence
-       # Force debug=true, since this is useless when not debugging...
-       DODEBUG = true
-    endif
-endif
-ifeq ($(strip $(DODEBUG)),true)
-    CFLAGS  += $(WARNINGS) -g -D_GNU_SOURCE
-    LDFLAGS += -Wl,-warn-common
-    STRIPCMD = /bin/true -Not_stripping_since_we_are_debugging
-else
-    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
-    LDFLAGS += -s -Wl,-warn-common
-    STRIPCMD    = $(STRIP) --remove-section=.note --remove-section=.comment
-endif
-ifeq ($(strip $(DOSTATIC)),true)
-    LDFLAGS += --static
-endif
-
-ifndef $(PREFIX)
-    PREFIX = `pwd`/_install
-endif
-
-# Additional complications due to support for pristine source dir.
-# Include files in the build directory should take precedence over
-# the copy in BB_SRC_DIR, both during the compilation phase and the
-# shell script that finds the list of object files.
-# Work in progress by <ldoolitt@recycle.lbl.gov>.
-#
-ifneq ($(strip $(BB_SRC_DIR)),)
-    VPATH = $(BB_SRC_DIR)
-endif
-
-OBJECTS   = $(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
-CFLAGS    += $(CROSS_CFLAGS)
-ifdef BB_INIT_SCRIPT
-    CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
-endif
-
-# Put user-supplied flags at the end, where they
-# have a chance of winning.
-CFLAGS += $(CFLAGS_EXTRA)
-
-.EXPORT_ALL_VARIABLES:
+TOPDIR:= $(shell /bin/pwd)/
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+SUBDIRS:=applets archival archival/libunarchive console-tools \
+       editors fileutils findutils init miscutils modutils networking \
+       procps pwd_grp pwd_grp/libpwd_grp shell shellutils sysklogd \
+       textutils util-linux libbb
 
 all:    do-it-all
 
@@ -196,7 +34,8 @@ ifeq (.config,$(wildcard .config))
 include .config
 ifeq (.depend,$(wildcard .depend))
 include .depend 
-do-it-all:      busybox busybox.links doc
+do-it-all:      busybox busybox.links #doc
+include $(patsubst %,%/Makefile.in, $(SUBDIRS))
 else
 CONFIGURATION = depend
 do-it-all:      depend
@@ -207,18 +46,9 @@ do-it-all:      menuconfig
 endif
 
 
-SUBDIRS =applets archival archival/libunarchive console-tools editors \
-       fileutils findutils init miscutils modutils networking procps \
-       pwd_grp shell shellutils sysklogd textutils util-linux libbb
-
-bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
-
-$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
-       $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
-
-busybox: config.h dep-files bbsubdirs
-       $(CC) $(LDFLAGS) -o $@ applets/busybox.o $(shell find $(SUBDIRS) -name \*.a) $(LIBRARIES)
-       $(STRIPCMD) $(PROG)
+busybox: depend $(libraries-y)
+       $(CC) $(LDFLAGS) $(libraries-y) $(LIBRARIES) -o $@
+       $(STRIPCMD) $@
 
 busybox.links: applets/busybox.mkll
        - $(SHELL) $^ >$@
@@ -291,52 +121,52 @@ docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
        - mkdir -p docs
        (cd docs/busybox.net; sgmltools -b html ../busybox.sgml)
 
+
+
 # The nifty new buildsystem stuff
-scripts/mkdep: scripts/mkdep.c
+$(TOPDIR)scripts/mkdep: scripts/mkdep.c
        $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
 
-scripts/split-include: scripts/split-include.c
+$(TOPDIR)scripts/split-include: scripts/split-include.c
        $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
 
-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: config.h dep-files
+$(TOPDIR).depend: $(TOPDIR)scripts/mkdep
+       rm -f .depend .hdepend;
+       mkdir -p $(TOPDIR)include/config;
+       $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
+       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)" ;
        @ echo -e "\n\nNow run 'make' to build BusyBox\n\n"
 
+depend dep: $(TOPDIR)include/config.h $(TOPDIR).depend
+
 BB_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \
        else if [ -x /bin/bash ]; then echo /bin/bash; \
        else echo sh; fi ; fi}
 
-include/config/MARKER: scripts/split-include include/config.h
+include/config/MARKER: depend $(TOPDIR)scripts/split-include
        scripts/split-include include/config.h include/config
        @ touch include/config/MARKER
 
-config.h:
-       @if [ ! -f include/config.h ] ; then \
+$(TOPDIR)include/config.h:
+       @if [ ! -f $(TOPDIR)include/config.h ] ; then \
                make oldconfig; \
        fi;
 
 menuconfig:
-       mkdir -p $(TOPDIR)/include/config
+       mkdir -p $(TOPDIR)include/config
        $(MAKE) -C scripts/lxdialog all
        $(BB_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
 
 config:
-       mkdir -p $(TOPDIR)/include/config
+       mkdir -p $(TOPDIR)include/config
        $(BB_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
 
 oldconfig:
-       mkdir -p $(TOPDIR)/include/config
+       mkdir -p $(TOPDIR)include/config
        $(BB_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in
 
 
@@ -359,7 +189,10 @@ dummy:
 
 endif
 
-include Rules.mak
+
+%.o: %.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+
 
 # Testing...
 test tests:
@@ -407,9 +240,11 @@ dist release: distclean doc
 
 
 
-.PHONY: tags check
+.PHONY: tags check depend
+
 tags:
        ctags -R .
 
 check: busybox
        cd testsuite && ./runtest
+
index a6f1116..2e9aa27 100644 (file)
--- a/Rules.mak
+++ b/Rules.mak
-#
-# This file contains rules which are shared between multiple Makefiles.
-#
-
-#
-# False targets.
-#
-.PHONY: dummy
-
-#
-# Special variables which should not be exported
-#
-unexport EXTRA_AFLAGS
-unexport EXTRA_CFLAGS
-unexport EXTRA_LDFLAGS
-unexport EXTRA_ARFLAGS
-unexport SUBDIRS
-unexport SUB_DIRS
-unexport ALL_SUB_DIRS
-unexport O_TARGET
-
-unexport obj-y
-unexport obj-n
-unexport obj-
-unexport export-objs
-unexport subdir-y
-unexport subdir-n
-unexport subdir-
-
-#
-# Get things started.
-#
-first_rule: sub_dirs
-       $(MAKE) all_targets
-
-SUB_DIRS       := $(subdir-y)
-ALL_SUB_DIRS   := $(sort $(subdir-y) $(subdir-n) $(subdir-))
-
-
-#
-# Common rules
-#
-
-%.s: %.c
-       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -S $< -o $@
-
-%.i: %.c
-       $(CPP) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) $< > $@
-
-%.o: %.c
-       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -c -o $@ $<
-       @ ( \
-           echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@))),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$@))))' ; \
-           echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
-           echo 'endif' \
-       ) > $(dir $@)/.$(notdir $@).flags
-
-%.o: %.s
-       $(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $<
-
-# Old makefiles define their own rules for compiling .S files,
-# but these standard rules are available for any Makefile that
-# wants to use them.  Our plan is to incrementally convert all
-# the Makefiles to these standard rules.  -- rmk, mec
-ifdef USE_STANDARD_AS_RULE
-
-%.s: %.S
-       $(CPP) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) $< > $@
-
-%.o: %.S
-       $(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $<
-
+# Rules.make for busybox
+#
+# Copyright (C) 2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+PROG      := busybox
+VERSION   := 0.61.pre
+BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
+HOSTCC    := gcc
+HOSTCFLAGS:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+
+
+# What OS are you compiling busybox for?  This allows you to include
+# OS specific things, syscall overrides, etc.
+TARGET_OS:=linux
+
+# With a modern GNU make(1) (highly recommended, that's what all the
+# developers use), all of the following configuration values can be
+# overridden at the command line.  For example:
+#   make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
+
+# If you want to add some simple compiler switches (like -march=i686),
+# especially from the command line, use this instead of CFLAGS directly.
+# For optimization overrides, it's better still to set OPTIMIZATION.
+CFLAGS_EXTRA:=
+# If you want a static binary, turn this on.
+DOSTATIC:=false
+
+# Set the following to `true' to make a debuggable build.
+# Leave this set to `false' for production use.
+DODEBUG:=false
+
+# This enables compiling with dmalloc ( http://dmalloc.com/ )
+# which is an excellent public domain mem leak and malloc problem
+# detector.  To enable dmalloc, before running busybox you will
+# want to first set up your environment.
+# eg: `export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile`
+# The debug= value is generated using the following command
+# dmalloc -p log-stats -p log-non-free -p log-bad-space -p log-elapsed-time \
+#      -p check-fence -p check-heap -p check-lists -p check-blank \
+#      -p check-funcs -p realloc-copy -p allow-free-null
+# Do not enable this for production builds...
+DODMALLOC:=false
+
+# Electric-fence is another very useful malloc debugging library.
+# Do not enable this for production builds...
+DOEFENCE:=false
+
+# If you want large file summit support, turn this on.
+# This has no effect if you don't have a kernel with lfs
+# support, and a system with libc-2.1.3 or later.
+# Some of the programs that can benefit from lfs support
+# are dd, gzip, mount, tar, and mkfs_minix.
+# LFS allows you to use the above programs for files
+# larger than 2GB!
+DOLFS:=false
+
+# If you have a "pristine" source directory, point BB_SRC_DIR to it.
+# Experimental and incomplete; tell the mailing list
+# <busybox@busybox.net> if you do or don't like it so far.
+BB_SRC_DIR:=
+
+# If you are running a cross compiler, you may want to set CROSS
+# to something more interesting, like "arm-linux-".
+CROSS:=
+CC             := $(CROSS)gcc
+AR             := $(CROSS)ar
+AS             := $(CROSS)as
+LD             := $(CROSS)ld
+NM             := $(CROSS)nm
+STRIP          := $(CROSS)strip
+CPP            := $(CC) -E
+MAKEFILES      := $(TOPDIR).config
+export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
+
+
+# To compile vs uClibc, just use the compiler wrapper built by uClibc...
+# Everything should compile and work as expected these days...
+#CC:=/usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
+
+# To compile vs some other alternative libc, you may need to use/adjust
+# the following lines to meet your needs...
+#
+# If you are using Red Hat 6.x with the compatible RPMs (for developing under
+# Red Hat 5.x and glibc 2.0) uncomment the following.  Be sure to read about
+# using the compatible RPMs (compat-*) at http://www.redhat.com !
+#LIBCDIR:=/usr/i386-glibc20-linux
+#
+# The following is used for libc5 (if you install altgcc and libc5-altdev
+# on a Debian system).  
+#LIBCDIR:=/usr/i486-linuxlibc1
+#
+# For other libraries, you are on your own...
+#LDFLAGS+=-nostdlib
+#LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
+#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
+#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+
+# use '-Os' optimization if available, else use -O2
+OPTIMIZATION:=${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
+       >/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
+GCC_STACK_BOUNDRY:=${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
+       >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
+OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY) #-fstrict-aliasing -march=i386 -mcpu=i386 -malign-functions=0 -malign-jumps=0
+WARNINGS:=-Wall -Wstrict-prototypes -Wshadow
+CFLAGS:=-I$(TOPDIR)include
+ARFLAGS:=-r
+
+#
+#--------------------------------------------------------
+# If you're going to do a lot of builds with a non-vanilla configuration,
+# it makes sense to adjust parameters above, so you can type "make"
+# by itself, instead of following it by the same half-dozen overrides
+# every time.  The stuff below, on the other hand, is probably less
+# prone to casual user adjustment.
+# 
+
+ifeq ($(strip $(DOLFS)),true)
+    # For large file summit support
+    CFLAGS+=-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64
+endif
+ifeq ($(strip $(DODMALLOC)),true)
+    # For testing mem leaks with dmalloc
+    CFLAGS+=-DDMALLOC
+    LIBRARIES:=-ldmalloc
+    # Force debug=true, since this is useless when not debugging...
+    DODEBUG:=true
+else
+    ifeq ($(strip $(DOEFENCE)),true)
+       LIBRARIES:=-lefence
+       # Force debug=true, since this is useless when not debugging...
+       DODEBUG:=true
+    endif
+endif
+ifeq ($(strip $(DODEBUG)),true)
+    CFLAGS  +=$(WARNINGS) -g -D_GNU_SOURCE
+    LDFLAGS +=-Wl,-warn-common
+    STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
+else
+    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
+    LDFLAGS += -s -Wl,-warn-common
+    STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
+endif
+ifeq ($(strip $(DOSTATIC)),true)
+    LDFLAGS += --static
 endif
 
-%.lst: %.c
-       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $<
-       $(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP)
-#
-#
-#
-all_targets: $(O_TARGET) $(L_TARGET)
+ifndef $(PREFIX)
+    PREFIX:=`pwd`/_install
+endif
 
+# Additional complications due to support for pristine source dir.
+# Include files in the build directory should take precedence over
+# the copy in BB_SRC_DIR, both during the compilation phase and the
+# shell script that finds the list of object files.
+# Work in progress by <ldoolitt@recycle.lbl.gov>.
 #
-# Rule to compile a set of .o files into one .o file
-#
-ifdef O_TARGET
-$(O_TARGET): $(obj-y)
-       rm -f $@
-    ifneq "$(strip $(obj-y))" ""
-       $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
-    else
-       $(AR) rcs $@
-    endif
-       @ ( \
-           echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
-           echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
-           echo 'endif' \
-       ) > $(dir $@)/.$(notdir $@).flags
-endif # O_TARGET
+ifneq ($(strip $(BB_SRC_DIR)),)
+    VPATH:=$(BB_SRC_DIR)
+endif
 
-#
-# Rule to compile a set of .o files into one .a file
-#
-ifdef L_TARGET
-$(L_TARGET): $(obj-y)
-       rm -f $@
-       $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
-       @ ( \
-           echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_ARFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_ARFLAGS) $$(obj-y))))' ; \
-           echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
-           echo 'endif' \
-       ) > $(dir $@)/.$(notdir $@).flags
+CFLAGS    += -DBB_VER='"$(VERSION)"'
+CFLAGS    += -DBB_BT='"$(BUILDTIME)"'
+OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
+CFLAGS    += $(CROSS_CFLAGS)
+ifdef BB_INIT_SCRIPT
+    CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
 endif
 
+# Put user-supplied flags at the end, where they
+# have a chance of winning.
+CFLAGS += $(CFLAGS_EXTRA)
 
-#
-# This make dependencies quickly
-#
+%.o: %.c
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+
+ifdef _FASTDEP_ALL_SUB_DIRS
 fastdep: dummy
-       $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS) -- $(wildcard *.[chS]) > .depend
+       $(TOPDIR)scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- $(wildcard *.[chS]) > .depend
 ifdef ALL_SUB_DIRS
        $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
 endif
 
-ifdef _FASTDEP_ALL_SUB_DIRS
 $(patsubst %,_sfdep_%,$(_FASTDEP_ALL_SUB_DIRS)):
        $(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep
 endif
 
-       
-#
-# A rule to make subdirectories
-#
-subdir-list = $(sort $(patsubst %,_subdir_%,$(SUB_DIRS)))
-sub_dirs: dummy $(subdir-list)
-
-ifdef SUB_DIRS
-$(subdir-list) : dummy
-       $(MAKE) -C $(patsubst _subdir_%,%,$@)
-endif
-
-#
-# A rule to do nothing
-#
-dummy:
-
-#
-# This is useful for testing
-#
-script:
-       $(SCRIPT)
-
-#
-# include dependency files if they exist
-#
-ifneq ($(wildcard .depend),)
-include .depend
-endif
-
-ifneq ($(wildcard $(TOPDIR)/.hdepend),)
-include $(TOPDIR)/.hdepend
-endif
+.PHONY: dummy
 
-#
-# Find files whose flags have changed and force recompilation.
-# For safety, this works in the converse direction:
-#   every file is forced, except those whose flags are positively up-to-date.
-#
-FILES_FLAGS_UP_TO_DATE :=
 
-# For use in expunging commas from flags, which mung our checking.
-comma = ,
 
-FILES_FLAGS_EXIST := $(wildcard .*.flags)
-ifneq ($(FILES_FLAGS_EXIST),)
-include $(FILES_FLAGS_EXIST)
-endif
+.EXPORT_ALL_VARIABLES:
 
-FILES_FLAGS_CHANGED := $(strip \
-    $(filter-out $(FILES_FLAGS_UP_TO_DATE), \
-       $(O_TARGET) $(L_TARGET) $(active-objs) \
-       ))
-
-# A kludge: .S files don't get flag dependencies (yet),
-#   because that will involve changing a lot of Makefiles.  Also
-#   suppress object files explicitly listed in $(IGNORE_FLAGS_OBJS).
-#   This allows handling of assembly files that get translated into
-#   multiple object files (see arch/ia64/lib/idiv.S, for example).
-FILES_FLAGS_CHANGED := $(strip \
-    $(filter-out $(patsubst %.S, %.o, $(wildcard *.S) $(IGNORE_FLAGS_OBJS)), \
-    $(FILES_FLAGS_CHANGED)))
-
-ifneq ($(FILES_FLAGS_CHANGED),)
-$(FILES_FLAGS_CHANGED): dummy
-endif
index e6efc17..c4887f9 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := applets.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-y          += applets.o busybox.o usage.o
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+APPLETS_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/applets/Makefile.in b/applets/Makefile.in
new file mode 100644 (file)
index 0000000..f198a14
--- /dev/null
@@ -0,0 +1,32 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+APPLETS_AR:=applets.a
+ifndef $(APPLETS_DIR)
+APPLETS_DIR:=$(TOPDIR)applets/
+endif
+
+APPLET_SRC:=applets.c busybox.c usage.c
+APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
+
+libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
+
+$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
+       $(AR) -ro $@ $(APPLET_OBJ)
+
index 35ba02f..d76face 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := archival.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-subdir-y       := libunarchive
-
-obj-$(CONFIG_AR)               += ar.o
-obj-$(CONFIG_BUNZIP2)          += bunzip2.o
-obj-$(CONFIG_CPIO)             += cpio.o
-obj-$(CONFIG_DPKG)             += dpkg.o
-obj-$(CONFIG_DPKG_DEB)         += dpkg_deb.o
-obj-$(CONFIG_GUNZIP)           += gunzip.o
-obj-$(CONFIG_GZIP)             += gzip.o
-obj-$(CONFIG_RPM2CPIO)         += rpm2cpio.o
-obj-$(CONFIG_TAR)              += tar.o
-obj-$(CONFIG_UNZIP)            += unzip.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+ARCHIVAL_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/archival/Makefile.in b/archival/Makefile.in
new file mode 100644 (file)
index 0000000..c53171e
--- /dev/null
@@ -0,0 +1,41 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+ARCHIVAL_AR:=archival.a
+ifndef $(ARCHIVAL_DIR)
+ARCHIVAL_DIR:=$(TOPDIR)archival/
+endif
+
+ARCHIVAL-y:=
+ARCHIVAL-$(CONFIG_AR)          += ar.o
+ARCHIVAL-$(CONFIG_BUNZIP2)     += bunzip2.o
+ARCHIVAL-$(CONFIG_CPIO)                += cpio.o
+ARCHIVAL-$(CONFIG_DPKG)                += dpkg.o
+ARCHIVAL-$(CONFIG_DPKG_DEB)    += dpkg_deb.o
+ARCHIVAL-$(CONFIG_GUNZIP)      += gunzip.o
+ARCHIVAL-$(CONFIG_GZIP)                += gzip.o
+ARCHIVAL-$(CONFIG_RPM2CPIO)    += rpm2cpio.o
+ARCHIVAL-$(CONFIG_TAR)         += tar.o
+ARCHIVAL-$(CONFIG_UNZIP)       += unzip.o
+
+libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
+
+$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
+       $(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
+
index a8409a4..7979879 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=../..
-L_TARGET := libunarchive.a
-
-obj-y           := unarchive.o seek_sub_file.o
-obj-n           :=
-obj-            :=
-
-ifeq ($(CONFIG_DPKG),y)
-       obj-y += deb_extract.o get_header_ar.o get_header_tar.o
-endif
-
-ifeq ($(CONFIG_DPKG_DEB),y)
-       obj-y += deb_extract.o get_header_ar.o get_header_tar.o
-endif
-
-ifeq ($(CONFIG_AR),y)
-       obj-y += get_header_ar.o
-endif
-
-ifeq ($(CONFIG_CPIO),y)
-       obj-y += get_header_cpio.o
-endif
-
-ifeq ($(CONFIG_RPM2CPIO),y)
-       obj-y += get_header_cpio.o
-endif
-
-ifeq ($(CONFIG_TAR),y)
-       obj-y += get_header_tar.o
-endif
-
-ifeq ($(CONFIG_UNZIP),y)
-       obj-y += get_header_zip.o
-endif
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../../
+LIBUNARCHIVE_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in
new file mode 100644 (file)
index 0000000..cd68be7
--- /dev/null
@@ -0,0 +1,38 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+LIBUNARCHIVE_AR:=libunarchive.a
+ifndef $(LIBUNARCHIVE_DIR)
+LIBUNARCHIVE_DIR:=$(TOPDIR)archival/libunarchive/
+endif
+
+LIBUNARCHIVE-y:=unarchive.o seek_sub_file.o
+LIBUNARCHIVE-$(CONFIG_DPKG) += deb_extract.o get_header_ar.o get_header_tar.o
+LIBUNARCHIVE-$(CONFIG_DPKG_DEB) += deb_extract.o get_header_ar.o get_header_tar.o
+LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o
+LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o
+LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += get_header_cpio.o
+LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
+LIBUNARCHIVE-$(CONFIG_UNZIP) += get_header_zip.o
+
+libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
+
+$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
+       $(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
+
index a67e4bb..2cea319 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := console-tools.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-$(CONFIG_CHVT)             += chvt.o
-obj-$(CONFIG_CLEAR)            += clear.o
-obj-$(CONFIG_DEALLOCVT)                += deallocvt.o
-obj-$(CONFIG_DUMPKMAP)         += dumpkmap.o
-obj-$(CONFIG_LOADACM)          += loadacm.o
-obj-$(CONFIG_LOADFONT)         += loadfont.o
-obj-$(CONFIG_LOADKMAP)         += loadkmap.o
-obj-$(CONFIG_RESET)            += reset.o
-obj-$(CONFIG_SETKEYCODES)      += setkeycodes.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+CONSOLETOOLS_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/console-tools/Makefile.in b/console-tools/Makefile.in
new file mode 100644 (file)
index 0000000..bc03356
--- /dev/null
@@ -0,0 +1,40 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+CONSOLETOOLS_AR:=console-tools.a
+ifndef $(CONSOLETOOLS_DIR)
+CONSOLETOOLS_DIR:=$(TOPDIR)console-tools/
+endif
+
+CONSOLETOOLS_DIR-y:=
+CONSOLETOOLS_DIR-$(CONFIG_CHVT)                += chvt.o
+CONSOLETOOLS_DIR-$(CONFIG_CLEAR)       += clear.o
+CONSOLETOOLS_DIR-$(CONFIG_DEALLOCVT)   += deallocvt.o
+CONSOLETOOLS_DIR-$(CONFIG_DUMPKMAP)    += dumpkmap.o
+CONSOLETOOLS_DIR-$(CONFIG_LOADACM)     += loadacm.o
+CONSOLETOOLS_DIR-$(CONFIG_LOADFONT)    += loadfont.o
+CONSOLETOOLS_DIR-$(CONFIG_LOADKMAP)    += loadkmap.o
+CONSOLETOOLS_DIR-$(CONFIG_RESET)       += reset.o
+CONSOLETOOLS_DIR-$(CONFIG_SETKEYCODES) += setkeycodes.o
+
+libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
+
+$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
+       $(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
+
index 7d8d965..4df7710 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := editors.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-$(CONFIG_SED)       += sed.o
-obj-$(CONFIG_VI)        += vi.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+EDITOR_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/editors/Makefile.in b/editors/Makefile.in
new file mode 100644 (file)
index 0000000..88c7589
--- /dev/null
@@ -0,0 +1,35 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+EDITOR_AR:=editors.a
+ifndef $(EDITOR_DIR)
+EDITOR_DIR:=$(TOPDIR)editors/
+endif
+
+EDITOR-y:=
+EDITOR-$(CONFIG_SED)       += sed.o
+EDITOR-$(CONFIG_VI)        += vi.o
+EDITOR_SRC:= $(EDITOR-y)
+EDITOR_OBJ:= $(patsubst %.c,$(EDITOR_DIR)%.o, $(EDITOR_SRC))
+
+libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
+
+$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
+       $(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
+
index ac590cc..dee8a66 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := findutils.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-
-obj-$(CONFIG_FIND)     += find.o
-obj-$(CONFIG_GREP)     += grep.o
-obj-$(CONFIG_WHICH)    += which.o
-obj-$(CONFIG_XARGS)    += xargs.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+FINDUTILS_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/findutils/Makefile.in b/findutils/Makefile.in
new file mode 100644 (file)
index 0000000..2deaadb
--- /dev/null
@@ -0,0 +1,35 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+FINDUTILS_AR:=findutils.a
+ifndef $(FINDUTILS_DIR)
+FINDUTILS_DIR:=$(TOPDIR)findutils/
+endif
+
+FINDUTILS-y:=
+FINDUTILS-$(CONFIG_FIND)       += find.o
+FINDUTILS-$(CONFIG_GREP)       += grep.o
+FINDUTILS-$(CONFIG_WHICH)      += which.o
+FINDUTILS-$(CONFIG_XARGS)      += xargs.o
+
+libraries-y+=$(FINDUTILS_DIR)$(FINDUTILS_AR)
+
+$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
+       $(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
+
index 76f4979..8d0cdc4 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := init.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-$(CONFIG_HALT)             += halt.o
-obj-$(CONFIG_INIT)             += init.o
-obj-$(CONFIG_POWEROFF)         += poweroff.o
-obj-$(CONFIG_REBOOT)           += reboot.o
-obj-$(CONFIG_START_STOP_DAEMON)        += start_stop_daemon.o
-obj-$(CONFIG_RUN_PARTS)                += run_parts.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+INIT_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/init/Makefile.in b/init/Makefile.in
new file mode 100644 (file)
index 0000000..8cc9526
--- /dev/null
@@ -0,0 +1,37 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+INIT_AR:=init.a
+ifndef $(INIT_DIR)
+INIT_DIR:=$(TOPDIR)init/
+endif
+
+INIT-y:=
+INIT-$(CONFIG_HALT)                    += halt.o
+INIT-$(CONFIG_INIT)                    += init.o
+INIT-$(CONFIG_POWEROFF)                        += poweroff.o
+INIT-$(CONFIG_REBOOT)                  += reboot.o
+INIT-$(CONFIG_START_STOP_DAEMON)       += start_stop_daemon.o
+INIT-$(CONFIG_RUN_PARTS)               += run_parts.o
+
+libraries-y+=$(INIT_DIR)$(INIT_AR)
+
+$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
+       $(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
+
index 879be24..f6d021c 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 2001 Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
 
-
-
-TOPDIR   :=..
-L_TARGET := libbb.a
-
-LIBBB_MSRC=messages.c
-LIBBB_OBJ= full_version name_too_long omitting_directory not_a_directory \
-       memory_exhausted invalid_date invalid_option io_error dash_dash_help \
-       write_error too_few_args name_longer_than_foo unknown can_not_create_raw_socket
-LIBBB_MOBJS=$(patsubst %,%.o, $(LIBBB_OBJ))
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-y += ask_confirmation.o chomp.o concat_path_file.o copy_file.o \
-       copy_file_chunk.o dump.o libc5.o device_open.o error_msg.o \
-       error_msg_and_die.o fgets_str.o find_mount_point.o find_pid_by_name.o \
-       find_root_device.o full_read.o full_write.o get_console.o \
-       get_last_path_component.o get_line_from_file.o gz_open.o human_readable.o \
-       isdirectory.o kernel_version.o loop.o mode_string.o module_syscalls.o mtab.o \
-       mtab_file.o my_getgrnam.o my_getgrgid.o my_getpwnam.o my_getpwnamegid.o \
-       my_getpwuid.o parse_mode.o parse_number.o perror_msg.o perror_msg_and_die.o \
-       print_file.o process_escape_sequence.o read_package_field.o recursive_action.o \
-       safe_read.o safe_strncpy.o syscalls.o syslog_msg_with_name.o time_string.o \
-       trim.o unzip.o vdprintf.o verror_msg.o vperror_msg.o wfopen.o xfuncs.o \
-       xgetcwd.o xreadlink.o xregcomp.o interface.o remove_file.o last_char_is.o \
-       copyfd.o vherror_msg.o herror_msg.o herror_msg_and_die.o xgethostbyname.o \
-       dirname.o make_directory.o create_icmp_socket.o u_signal_names.o arith.o \
-       simplify_path.o inet_common.o inode_hash.o $(LIBBB_MOBJS) $(LIBBB_AROBJS)
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
-
-$(LIBBB_MOBJS): $(LIBBB_MSRC)
-       $(CC) $(CFLAGS) -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"' \
-               $(LIBBB_CFLAGS) -DL_$(patsubst %,%,$*) -c $< -o $*.o
-
-$(LIBBB_AROBJS): $(LIBBB_ARCSRC)
-       $(CC) $(CFLAGS) $(LIBBB_CFLAGS) -DL_$(patsubst %,%,$*) -c $< -o $*.o
-
-loop.o: loop.h
-
-loop.h: mk_loop_h.sh
-       @ $(SHELL) $< > $@
+TOPDIR:= ../
+LIBBB_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
+
diff --git a/libbb/Makefile.in b/libbb/Makefile.in
new file mode 100644 (file)
index 0000000..6d098c0
--- /dev/null
@@ -0,0 +1,63 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# 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/
+endif
+
+LIBBB_SRC:= \
+       ask_confirmation.c chomp.c concat_path_file.c copy_file.c \
+       copy_file_chunk.c dump.c libc5.c device_open.c error_msg.c \
+       error_msg_and_die.c fgets_str.c find_mount_point.c find_pid_by_name.c \
+       find_root_device.c full_read.c full_write.c get_console.c \
+       get_last_path_component.c get_line_from_file.c gz_open.c human_readable.c \
+       isdirectory.c kernel_version.c loop.c mode_string.c module_syscalls.c mtab.c \
+       mtab_file.c my_getgrnam.c my_getgrgid.c my_getpwnam.c my_getpwnamegid.c \
+       my_getpwuid.c parse_mode.c parse_number.c perror_msg.c perror_msg_and_die.c \
+       print_file.c process_escape_sequence.c read_package_field.c recursive_action.c \
+       safe_read.c safe_strncpy.c syscalls.c syslog_msg_with_name.c time_string.c \
+       trim.c unzip.c vdprintf.c verror_msg.c vperror_msg.c wfopen.c xfuncs.c \
+       xgetcwd.c xreadlink.c xregcomp.c interface.c remove_file.c last_char_is.c \
+       copyfd.c vherror_msg.c herror_msg.c herror_msg_and_die.c xgethostbyname.c \
+       dirname.c make_directory.c create_icmp_socket.c u_signal_names.c arith.c \
+       simplify_path.c inet_common.c inode_hash.c
+LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC))
+
+LIBBB_MSRC:=$(LIBBB_DIR)messages.c
+LIBBB_MOBJ:=full_version.o name_too_long.o omitting_directory.o not_a_directory.o \
+       memory_exhausted.o invalid_date.o invalid_option.o io_error.o dash_dash_help.o \
+       write_error.o too_few_args.o name_longer_than_foo.o unknown.o can_not_create_raw_socket.o
+LIBBB_MOBJS=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ))
+
+libraries-y+=$(LIBBB_DIR)$(LIBBB_AR)
+
+$(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS) 
+       $(AR) -ro $@ $(LIBBB_OBJS) $(LIBBB_MOBJS)
+
+$(LIBBB_MOBJS): $(LIBBB_MSRC)
+       $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
+
+$(LIBBB_DIR)loop.o: $(LIBBB_DIR)loop.h
+
+$(LIBBB_DIR)loop.h: $(LIBBB_DIR)mk_loop_h.sh
+       @ $(SHELL) $< > $@
+
+
index 3a4d1b6..b1765f6 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := miscutils.a
-EXTRA_CFLAGS = -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"'
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-
-obj-$(CONFIG_ADJTIMEX)         += adjtimex.o
-obj-$(CONFIG_DC)               += dc.o
-obj-$(CONFIG_DUTMP)            += dutmp.o
-obj-$(CONFIG_MAKEDEVS)         += makedevs.o
-obj-$(CONFIG_MKTEMP)           += mktemp.o
-obj-$(CONFIG_MT)               += mt.o
-obj-$(CONFIG_READLINK)         += readlink.o
-obj-$(CONFIG_TIME)             += time.o
-obj-$(CONFIG_UPDATE)           += update.o
-obj-$(CONFIG_WATCHDOG)         += watchdog.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+MISCUTILS_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/miscutils/Makefile.in b/miscutils/Makefile.in
new file mode 100644 (file)
index 0000000..078f870
--- /dev/null
@@ -0,0 +1,42 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+MISCUTILS_AR:=miscutils.a
+ifndef $(MISCUTILS_DIR)
+MISCUTILS_DIR:=$(TOPDIR)miscutils/
+endif
+
+
+MISCUTILS-y:=
+MISCUTILS-$(CONFIG_ADJTIMEX)           += adjtimex.o
+MISCUTILS-$(CONFIG_DC)                 += dc.o
+MISCUTILS-$(CONFIG_DUTMP)              += dutmp.o
+MISCUTILS-$(CONFIG_MAKEDEVS)           += makedevs.o
+MISCUTILS-$(CONFIG_MKTEMP)             += mktemp.o
+MISCUTILS-$(CONFIG_MT)                 += mt.o
+MISCUTILS-$(CONFIG_READLINK)           += readlink.o
+MISCUTILS-$(CONFIG_TIME)               += time.o
+MISCUTILS-$(CONFIG_UPDATE)             += update.o
+MISCUTILS-$(CONFIG_WATCHDOG)           += watchdog.o
+
+libraries-y+=$(MISCUTILS_DIR)$(MISCUTILS_AR)
+
+$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
+       $(AR) -ro $@ $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
+
index 7a8d466..e8246ce 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := modutils.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-
-obj-$(CONFIG_INSMOD)           += insmod.o
-obj-$(CONFIG_LSMOD)            += lsmod.o
-obj-$(CONFIG_MODPROBE)         += modprobe.o
-obj-$(CONFIG_RMMOD)            += rmmod.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+MODUTILS_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/modutils/Makefile.in b/modutils/Makefile.in
new file mode 100644 (file)
index 0000000..6ad9582
--- /dev/null
@@ -0,0 +1,35 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+MODUTILS_AR:=modutils.a
+ifndef $(MODUTILS_DIR)
+MODUTILS_DIR:=$(TOPDIR)modutils/
+endif
+
+MODUTILS-y:=
+MODUTILS-$(CONFIG_INSMOD)              += insmod.o
+MODUTILS-$(CONFIG_LSMOD)               += lsmod.o
+MODUTILS-$(CONFIG_MODPROBE)            += modprobe.o
+MODUTILS-$(CONFIG_RMMOD)               += rmmod.o
+
+libraries-y+=$(MODUTILS_DIR)$(MODUTILS_AR)
+
+$(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
+       $(AR) -ro $@ $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
+
index 4b522ff..4caa183 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := networking.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-
-obj-$(CONFIG_HOSTNAME)         += hostname.o
-obj-$(CONFIG_IFCONFIG)         += ifconfig.o
-obj-$(CONFIG_NC)               += nc.o
-obj-$(CONFIG_NETSTAT)          += netstat.o
-obj-$(CONFIG_NSLOOKUP)         += nslookup.o
-obj-$(CONFIG_PING)             += ping.o
-obj-$(CONFIG_ROUTE)            += route.o
-obj-$(CONFIG_TELNET)           += telnet.o
-obj-$(CONFIG_TFTP)             += tftp.o
-obj-$(CONFIG_TRACEROUTE)       += traceroute.o
-obj-$(CONFIG_WGET)             += wget.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+NETWORKING_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/networking/Makefile.in b/networking/Makefile.in
new file mode 100644 (file)
index 0000000..6f3cc21
--- /dev/null
@@ -0,0 +1,42 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+NETWORKING_AR:=networking.a
+ifndef $(NETWORKING_DIR)
+NETWORKING_DIR:=$(TOPDIR)networking/
+endif
+
+NETWORKING-y:=
+NETWORKING-$(CONFIG_HOSTNAME)          += hostname.o
+NETWORKING-$(CONFIG_IFCONFIG)          += ifconfig.o
+NETWORKING-$(CONFIG_NC)                        += nc.o
+NETWORKING-$(CONFIG_NETSTAT)           += netstat.o
+NETWORKING-$(CONFIG_NSLOOKUP)          += nslookup.o
+NETWORKING-$(CONFIG_PING)              += ping.o
+NETWORKING-$(CONFIG_ROUTE)             += route.o
+NETWORKING-$(CONFIG_TELNET)            += telnet.o
+NETWORKING-$(CONFIG_TFTP)              += tftp.o
+NETWORKING-$(CONFIG_TRACEROUTE)                += traceroute.o
+NETWORKING-$(CONFIG_WGET)              += wget.o
+
+libraries-y+=$(NETWORKING_DIR)$(NETWORKING_AR)
+
+$(NETWORKING_DIR)$(NETWORKING_AR): $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
+       $(AR) -ro $@ $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
+
index 0e3bdc2..8e572aa 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := procps.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-$(CONFIG_FREE)             += free.o
-obj-$(CONFIG_KILL)             += kill.o
-obj-$(CONFIG_PIDOF)            += pidof.o
-obj-$(CONFIG_PS)               += ps.o
-obj-$(CONFIG_RENICE)           += renice.o
-obj-$(CONFIG_UPTIME)           += uptime.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+PROCPS_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/procps/Makefile.in b/procps/Makefile.in
new file mode 100644 (file)
index 0000000..1851d89
--- /dev/null
@@ -0,0 +1,37 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+PROCPS_AR:=procps.a
+ifndef $(PROCPS_DIR)
+PROCPS_DIR:=$(TOPDIR)procps/
+endif
+
+PROCPS-:=
+PROCPS-$(CONFIG_FREE)          += free.o
+PROCPS-$(CONFIG_KILL)          += kill.o
+PROCPS-$(CONFIG_PIDOF)         += pidof.o
+PROCPS-$(CONFIG_PS)            += ps.o
+PROCPS-$(CONFIG_RENICE)                += renice.o
+PROCPS-$(CONFIG_UPTIME)                += uptime.o
+
+libraries-y+=$(PROCPS_DIR)$(PROCPS_AR)
+
+$(PROCPS_DIR)$(PROCPS_AR): $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
+       $(AR) -ro $@ $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
+
index e022997..f3b1042 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := shell.a
-EXTRA_CFLAGS = -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"'
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-$(CONFIG_ASH)              += ash.o
-obj-$(CONFIG_HUSH)             += hush.o
-obj-$(CONFIG_LASH)             += lash.o
-obj-$(CONFIG_MSH)              += msh.o
-obj-$(CONFIG_FEATURE_COMMAND_EDITING)          += cmdedit.o
-
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+SHELL_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/shell/Makefile.in b/shell/Makefile.in
new file mode 100644 (file)
index 0000000..a5778d6
--- /dev/null
@@ -0,0 +1,36 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+SHELL_AR:=shell.a
+ifndef $(SHELL_DIR)
+SHELL_DIR:=$(TOPDIR)shell/
+endif
+
+SHELLT-y:=
+SHELLT-$(CONFIG_ASH)                           += ash.o
+SHELLT-$(CONFIG_HUSH)                          += hush.o
+SHELLT-$(CONFIG_LASH)                          += lash.o
+SHELLT-$(CONFIG_MSH)                           += msh.o
+SHELLT-$(CONFIG_FEATURE_COMMAND_EDITING)       += cmdedit.o
+
+libraries-y+=$(SHELL_DIR)$(SHELL_AR)
+
+$(SHELL_DIR)$(SHELL_AR): $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
+       $(AR) -ro $@ $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
+
index 3f7da6d..dc2098f 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := sysklogd.a
-EXTRA_CFLAGS = -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"'
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-
-obj-$(CONFIG_KLOGD)            += klogd.o
-obj-$(CONFIG_LOGGER)           += logger.o
-obj-$(CONFIG_LOGREAD)          += logread.o
-obj-$(CONFIG_SYSLOGD)          += syslogd.o
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+SYSKLOGD_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/sysklogd/Makefile.in b/sysklogd/Makefile.in
new file mode 100644 (file)
index 0000000..aacb941
--- /dev/null
@@ -0,0 +1,35 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+SYSKLOGD_AR:=sysklogd.a
+ifndef $(SYSKLOGD_DIR)
+SYSKLOGD_DIR:=$(TOPDIR)sysklogd/
+endif
+
+SYSKLOGD-:=
+SYSKLOGD-$(CONFIG_KLOGD)               += klogd.o
+SYSKLOGD-$(CONFIG_LOGGER)              += logger.o
+SYSKLOGD-$(CONFIG_LOGREAD)             += logread.o
+SYSKLOGD-$(CONFIG_SYSLOGD)             += syslogd.o
+
+libraries-y+=$(SYSKLOGD_DIR)$(SYSKLOGD_AR)
+
+$(SYSKLOGD_DIR)$(SYSKLOGD_AR): $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
+       $(AR) -ro $@ $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
+
index 9cd1486..41080a9 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for busybox
 #
-# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-TOPDIR   :=..
-L_TARGET := util-linux.a
-
-obj-y           :=
-obj-n           :=
-obj-            :=
-
-obj-$(CONFIG_DMESG)            += dmesg.o
-obj-$(CONFIG_FBSET)            += fbset.o
-obj-$(CONFIG_FDFLUSH)          += fdflush.o
-obj-$(CONFIG_FREERAMDISK)      += freeramdisk.o
-obj-$(CONFIG_FSCK_MINIX)       += fsck_minix.o
-obj-$(CONFIG_GETOPT)           += getopt.o
-obj-$(CONFIG_HEXDUMP)          += hexdump.o
-obj-$(CONFIG_LOSETUP)          += losetup.o
-obj-$(CONFIG_MKFS_MINIX)       += mkfs_minix.o
-obj-$(CONFIG_MKSWAP)           += mkswap.o
-obj-$(CONFIG_MORE)             += more.o
-obj-$(CONFIG_MOUNT)            += mount.o
-obj-$(CONFIG_NFSMOUNT)         += nfsmount.o
-obj-$(CONFIG_PIVOT_ROOT)       += pivot_root.o
-obj-$(CONFIG_RDATE)            += rdate.o
-obj-$(CONFIG_SWAPONOFF)                += swaponoff.o
-obj-$(CONFIG_UMOUNT)           += umount.o
-
-# Hand off to toplevel Rules.mak
-include $(TOPDIR)/Rules.mak
+TOPDIR:= ../
+UTILLINUX_DIR:=./
+include $(TOPDIR).config
+include $(TOPDIR)Rules.mak
+include Makefile.in
+all: $(libraries-y)
+-include $(TOPDIR).depend
 
 clean:
-       rm -f $(L_TARGET) *.o core
+       rm -f *.o *.a $(AR_TARGET)
 
diff --git a/util-linux/Makefile.in b/util-linux/Makefile.in
new file mode 100644 (file)
index 0000000..fbe075d
--- /dev/null
@@ -0,0 +1,48 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+UTILLINUX_AR:=util-linux.a
+ifndef $(UTILLINUX_DIR)
+UTILLINUX_DIR:=$(TOPDIR)util-linux/
+endif
+
+UTILLINUX-:=
+UTILLINUX-$(CONFIG_DMESG)              += dmesg.o
+UTILLINUX-$(CONFIG_FBSET)              += fbset.o
+UTILLINUX-$(CONFIG_FDFLUSH)            += fdflush.o
+UTILLINUX-$(CONFIG_FREERAMDISK)        += freeramdisk.o
+UTILLINUX-$(CONFIG_FSCK_MINIX) += fsck_minix.o
+UTILLINUX-$(CONFIG_GETOPT)             += getopt.o
+UTILLINUX-$(CONFIG_HEXDUMP)            += hexdump.o
+UTILLINUX-$(CONFIG_LOSETUP)            += losetup.o
+UTILLINUX-$(CONFIG_MKFS_MINIX) += mkfs_minix.o
+UTILLINUX-$(CONFIG_MKSWAP)             += mkswap.o
+UTILLINUX-$(CONFIG_MORE)               += more.o
+UTILLINUX-$(CONFIG_MOUNT)              += mount.o
+UTILLINUX-$(CONFIG_NFSMOUNT)           += nfsmount.o
+UTILLINUX-$(CONFIG_PIVOT_ROOT) += pivot_root.o
+UTILLINUX-$(CONFIG_RDATE)              += rdate.o
+UTILLINUX-$(CONFIG_SWAPONOFF)          += swaponoff.o
+UTILLINUX-$(CONFIG_UMOUNT)             += umount.o
+
+libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
+
+$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
+       $(AR) -ro $@ $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
+