aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-12 12:05:57 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-12 12:05:57 +0000
commit85208e2ab94ddd60cc97dd7ae4a3b2a588281398 (patch)
tree8065760390f8f705c47f01a30a7f63c93cef8cf3
parentb1591d1f8b9444c770771c9482d708dd5e497829 (diff)
downloadbusybox-w32-85208e2ab94ddd60cc97dd7ae4a3b2a588281398.tar.gz
busybox-w32-85208e2ab94ddd60cc97dd7ae4a3b2a588281398.tar.bz2
busybox-w32-85208e2ab94ddd60cc97dd7ae4a3b2a588281398.zip
Completely rework the config system so that it no longer annoys me to work on
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
-rw-r--r--Makefile247
-rw-r--r--Rules.mak361
-rw-r--r--applets/Makefile22
-rw-r--r--applets/Makefile.in32
-rw-r--r--archival/Makefile33
-rw-r--r--archival/Makefile.in41
-rw-r--r--archival/libunarchive/Makefile49
-rw-r--r--archival/libunarchive/Makefile.in38
-rw-r--r--console-tools/Makefile31
-rw-r--r--console-tools/Makefile.in40
-rw-r--r--editors/Makefile24
-rw-r--r--editors/Makefile.in35
-rw-r--r--findutils/Makefile27
-rw-r--r--findutils/Makefile.in35
-rw-r--r--init/Makefile28
-rw-r--r--init/Makefile.in37
-rw-r--r--libbb/Makefile59
-rw-r--r--libbb/Makefile.in63
-rw-r--r--miscutils/Makefile34
-rw-r--r--miscutils/Makefile.in42
-rw-r--r--modutils/Makefile27
-rw-r--r--modutils/Makefile.in35
-rw-r--r--networking/Makefile34
-rw-r--r--networking/Makefile.in42
-rw-r--r--procps/Makefile28
-rw-r--r--procps/Makefile.in37
-rw-r--r--shell/Makefile28
-rw-r--r--shell/Makefile.in36
-rw-r--r--sysklogd/Makefile27
-rw-r--r--sysklogd/Makefile.in35
-rw-r--r--util-linux/Makefile38
-rw-r--r--util-linux/Makefile.in48
32 files changed, 961 insertions, 732 deletions
diff --git a/Makefile b/Makefile
index 19c28edf3..28b041ce0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,175 +17,13 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20PROG := busybox 20TOPDIR:= $(shell /bin/pwd)/
21VERSION := 0.61.pre 21include $(TOPDIR).config
22BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z") 22include $(TOPDIR)Rules.mak
23TOPDIR := ${shell /bin/pwd} 23SUBDIRS:=applets archival archival/libunarchive console-tools \
24HOSTCC := gcc 24 editors fileutils findutils init miscutils modutils networking \
25HOSTCFLAGS:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 25 procps pwd_grp pwd_grp/libpwd_grp shell shellutils sysklogd \
26 26 textutils util-linux libbb
27
28# What OS are you compiling busybox for? This allows you to include
29# OS specific things, syscall overrides, etc.
30TARGET_OS := linux
31
32# With a modern GNU make(1) (highly recommended, that's what all the
33# developers use), all of the following configuration values can be
34# overridden at the command line. For example:
35# make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
36
37# If you want to add some simple compiler switches (like -march=i686),
38# especially from the command line, use this instead of CFLAGS directly.
39# For optimization overrides, it's better still to set OPTIMIZATION.
40CFLAGS_EXTRA =
41
42# If you want a static binary, turn this on.
43DOSTATIC = false
44
45# Set the following to `true' to make a debuggable build.
46# Leave this set to `false' for production use.
47DODEBUG = false
48
49# This enables compiling with dmalloc ( http://dmalloc.com/ )
50# which is an excellent public domain mem leak and malloc problem
51# detector. To enable dmalloc, before running busybox you will
52# want to first set up your environment.
53# eg: `export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile`
54# The debug= value is generated using the following command
55# dmalloc -p log-stats -p log-non-free -p log-bad-space -p log-elapsed-time \
56# -p check-fence -p check-heap -p check-lists -p check-blank \
57# -p check-funcs -p realloc-copy -p allow-free-null
58# Do not enable this for production builds...
59DODMALLOC = false
60
61# Electric-fence is another very useful malloc debugging library.
62# Do not enable this for production builds...
63DOEFENCE = false
64
65# If you want large file summit support, turn this on.
66# This has no effect if you don't have a kernel with lfs
67# support, and a system with libc-2.1.3 or later.
68# Some of the programs that can benefit from lfs support
69# are dd, gzip, mount, tar, and mkfs_minix.
70# LFS allows you to use the above programs for files
71# larger than 2GB!
72DOLFS = false
73
74# If you have a "pristine" source directory, point BB_SRC_DIR to it.
75# Experimental and incomplete; tell the mailing list
76# <busybox@busybox.net> if you do or don't like it so far.
77BB_SRC_DIR =
78
79# If you are running a cross compiler, you may want to set CROSS
80# to something more interesting, like "arm-linux-".
81CROSS =
82CC = $(CROSS)gcc
83AR = $(CROSS)ar
84AS = $(CROSS)as
85LD = $(CROSS)ld
86NM = $(CROSS)nm
87STRIP = $(CROSS)strip
88CPP = $(CC) -E
89MAKEFILES = $(TOPDIR)/.config
90export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
91
92
93# To compile vs uClibc, just use the compiler wrapper built by uClibc...
94# Everything should compile and work as expected these days...
95#CC = /usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
96
97# To compile vs some other alternative libc, you may need to use/adjust
98# the following lines to meet your needs...
99#
100# If you are using Red Hat 6.x with the compatible RPMs (for developing under
101# Red Hat 5.x and glibc 2.0) uncomment the following. Be sure to read about
102# using the compatible RPMs (compat-*) at http://www.redhat.com !
103#LIBCDIR=/usr/i386-glibc20-linux
104#
105# The following is used for libc5 (if you install altgcc and libc5-altdev
106# on a Debian system).
107#LIBCDIR=/usr/i486-linuxlibc1
108#
109# For other libraries, you are on your own...
110#LDFLAGS+=-nostdlib
111#LIBRARIES = $(LIBCDIR)/lib/libc.a -lgcc
112#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
113#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
114
115# use '-Os' optimization if available, else use -O2
116OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
117 >/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
118GCC_STACK_BOUNDRY := ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
119 >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
120OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY) #-fstrict-aliasing -march=i386 -mcpu=i386 -malign-functions=0 -malign-jumps=0
121WARNINGS=-Wall -Wstrict-prototypes -Wshadow
122CFLAGS = -I$(TOPDIR)/include
123ARFLAGS = -r
124
125#
126#--------------------------------------------------------
127# If you're going to do a lot of builds with a non-vanilla configuration,
128# it makes sense to adjust parameters above, so you can type "make"
129# by itself, instead of following it by the same half-dozen overrides
130# every time. The stuff below, on the other hand, is probably less
131# prone to casual user adjustment.
132#
133
134ifeq ($(strip $(DOLFS)),true)
135 # For large file summit support
136 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64
137endif
138ifeq ($(strip $(DODMALLOC)),true)
139 # For testing mem leaks with dmalloc
140 CFLAGS+=-DDMALLOC
141 LIBRARIES = -ldmalloc
142 # Force debug=true, since this is useless when not debugging...
143 DODEBUG = true
144else
145 ifeq ($(strip $(DOEFENCE)),true)
146 LIBRARIES = -lefence
147 # Force debug=true, since this is useless when not debugging...
148 DODEBUG = true
149 endif
150endif
151ifeq ($(strip $(DODEBUG)),true)
152 CFLAGS += $(WARNINGS) -g -D_GNU_SOURCE
153 LDFLAGS += -Wl,-warn-common
154 STRIPCMD = /bin/true -Not_stripping_since_we_are_debugging
155else
156 CFLAGS += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
157 LDFLAGS += -s -Wl,-warn-common
158 STRIPCMD = $(STRIP) --remove-section=.note --remove-section=.comment
159endif
160ifeq ($(strip $(DOSTATIC)),true)
161 LDFLAGS += --static
162endif
163
164ifndef $(PREFIX)
165 PREFIX = `pwd`/_install
166endif
167
168# Additional complications due to support for pristine source dir.
169# Include files in the build directory should take precedence over
170# the copy in BB_SRC_DIR, both during the compilation phase and the
171# shell script that finds the list of object files.
172# Work in progress by <ldoolitt@recycle.lbl.gov>.
173#
174ifneq ($(strip $(BB_SRC_DIR)),)
175 VPATH = $(BB_SRC_DIR)
176endif
177
178OBJECTS = $(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
179CFLAGS += $(CROSS_CFLAGS)
180ifdef BB_INIT_SCRIPT
181 CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
182endif
183
184# Put user-supplied flags at the end, where they
185# have a chance of winning.
186CFLAGS += $(CFLAGS_EXTRA)
187
188.EXPORT_ALL_VARIABLES:
189 27
190all: do-it-all 28all: do-it-all
191 29
@@ -196,7 +34,8 @@ ifeq (.config,$(wildcard .config))
196include .config 34include .config
197ifeq (.depend,$(wildcard .depend)) 35ifeq (.depend,$(wildcard .depend))
198include .depend 36include .depend
199do-it-all: busybox busybox.links doc 37do-it-all: busybox busybox.links #doc
38include $(patsubst %,%/Makefile.in, $(SUBDIRS))
200else 39else
201CONFIGURATION = depend 40CONFIGURATION = depend
202do-it-all: depend 41do-it-all: depend
@@ -207,18 +46,9 @@ do-it-all: menuconfig
207endif 46endif
208 47
209 48
210SUBDIRS =applets archival archival/libunarchive console-tools editors \ 49busybox: depend $(libraries-y)
211 fileutils findutils init miscutils modutils networking procps \ 50 $(CC) $(LDFLAGS) $(libraries-y) $(LIBRARIES) -o $@
212 pwd_grp shell shellutils sysklogd textutils util-linux libbb 51 $(STRIPCMD) $@
213
214bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
215
216$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
217 $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
218
219busybox: config.h dep-files bbsubdirs
220 $(CC) $(LDFLAGS) -o $@ applets/busybox.o $(shell find $(SUBDIRS) -name \*.a) $(LIBRARIES)
221 $(STRIPCMD) $(PROG)
222 52
223busybox.links: applets/busybox.mkll 53busybox.links: applets/busybox.mkll
224 - $(SHELL) $^ >$@ 54 - $(SHELL) $^ >$@
@@ -291,52 +121,52 @@ docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
291 - mkdir -p docs 121 - mkdir -p docs
292 (cd docs/busybox.net; sgmltools -b html ../busybox.sgml) 122 (cd docs/busybox.net; sgmltools -b html ../busybox.sgml)
293 123
124
125
294# The nifty new buildsystem stuff 126# The nifty new buildsystem stuff
295scripts/mkdep: scripts/mkdep.c 127$(TOPDIR)scripts/mkdep: scripts/mkdep.c
296 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c 128 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
297 129
298scripts/split-include: scripts/split-include.c 130$(TOPDIR)scripts/split-include: scripts/split-include.c
299 $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c 131 $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
300 132
301dep-files: scripts/mkdep 133$(TOPDIR).depend: $(TOPDIR)scripts/mkdep
302 @if [ ! -f .depend ] ; then \ 134 rm -f .depend .hdepend;
303 rm -f .depend .hdepend; \ 135 mkdir -p $(TOPDIR)include/config;
304 mkdir -p $(TOPDIR)/include/config; \ 136 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
305 scripts/mkdep -I $(TOPDIR)/include -- \ 137 scripts/mkdep -I $(TOPDIR)include -- \
306 `find $(TOPDIR) -name \*.c -print` >> .depend; \ 138 `find $(TOPDIR) -name \*.c -print` >> .depend;
307 scripts/mkdep -I $(TOPDIR)/include -- \ 139 scripts/mkdep -I $(TOPDIR)include -- \
308 `find $(TOPDIR) -name \*.h -print` >> .hdepend; \ 140 `find $(TOPDIR) -name \*.h -print` >> .hdepend;
309 $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ; \ 141 $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ;
310 fi;
311
312
313depend dep: config.h dep-files
314 @ echo -e "\n\nNow run 'make' to build BusyBox\n\n" 142 @ echo -e "\n\nNow run 'make' to build BusyBox\n\n"
315 143
144depend dep: $(TOPDIR)include/config.h $(TOPDIR).depend
145
316BB_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \ 146BB_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \
317 else if [ -x /bin/bash ]; then echo /bin/bash; \ 147 else if [ -x /bin/bash ]; then echo /bin/bash; \
318 else echo sh; fi ; fi} 148 else echo sh; fi ; fi}
319 149
320include/config/MARKER: scripts/split-include include/config.h 150include/config/MARKER: depend $(TOPDIR)scripts/split-include
321 scripts/split-include include/config.h include/config 151 scripts/split-include include/config.h include/config
322 @ touch include/config/MARKER 152 @ touch include/config/MARKER
323 153
324config.h: 154$(TOPDIR)include/config.h:
325 @if [ ! -f include/config.h ] ; then \ 155 @if [ ! -f $(TOPDIR)include/config.h ] ; then \
326 make oldconfig; \ 156 make oldconfig; \
327 fi; 157 fi;
328 158
329menuconfig: 159menuconfig:
330 mkdir -p $(TOPDIR)/include/config 160 mkdir -p $(TOPDIR)include/config
331 $(MAKE) -C scripts/lxdialog all 161 $(MAKE) -C scripts/lxdialog all
332 $(BB_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in 162 $(BB_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
333 163
334config: 164config:
335 mkdir -p $(TOPDIR)/include/config 165 mkdir -p $(TOPDIR)include/config
336 $(BB_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in 166 $(BB_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
337 167
338oldconfig: 168oldconfig:
339 mkdir -p $(TOPDIR)/include/config 169 mkdir -p $(TOPDIR)include/config
340 $(BB_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in 170 $(BB_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in
341 171
342 172
@@ -359,7 +189,10 @@ dummy:
359 189
360endif 190endif
361 191
362include Rules.mak 192
193%.o: %.c
194 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
195
363 196
364# Testing... 197# Testing...
365test tests: 198test tests:
@@ -407,9 +240,11 @@ dist release: distclean doc
407 240
408 241
409 242
410.PHONY: tags check 243.PHONY: tags check depend
244
411tags: 245tags:
412 ctags -R . 246 ctags -R .
413 247
414check: busybox 248check: busybox
415 cd testsuite && ./runtest 249 cd testsuite && ./runtest
250
diff --git a/Rules.mak b/Rules.mak
index a6f111695..2e9aa27e6 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -1,195 +1,208 @@
1# 1# Rules.make for busybox
2# This file contains rules which are shared between multiple Makefiles. 2#
3# 3# Copyright (C) 2002 Erik Andersen <andersee@debian.org>
4 4#
5# 5# This program is free software; you can redistribute it and/or modify
6# False targets. 6# it under the terms of the GNU General Public License as published by
7# 7# the Free Software Foundation; either version 2 of the License, or
8.PHONY: dummy 8# (at your option) any later version.
9 9#
10# 10# This program is distributed in the hope that it will be useful,
11# Special variables which should not be exported 11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13unexport EXTRA_AFLAGS 13# General Public License for more details.
14unexport EXTRA_CFLAGS 14#
15unexport EXTRA_LDFLAGS 15# You should have received a copy of the GNU General Public License
16unexport EXTRA_ARFLAGS 16# along with this program; if not, write to the Free Software
17unexport SUBDIRS 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18unexport SUB_DIRS 18#
19unexport ALL_SUB_DIRS 19
20unexport O_TARGET 20PROG := busybox
21 21VERSION := 0.61.pre
22unexport obj-y 22BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
23unexport obj-n 23HOSTCC := gcc
24unexport obj- 24HOSTCFLAGS:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
25unexport export-objs 25
26unexport subdir-y 26
27unexport subdir-n 27# What OS are you compiling busybox for? This allows you to include
28unexport subdir- 28# OS specific things, syscall overrides, etc.
29 29TARGET_OS:=linux
30# 30
31# Get things started. 31# With a modern GNU make(1) (highly recommended, that's what all the
32# 32# developers use), all of the following configuration values can be
33first_rule: sub_dirs 33# overridden at the command line. For example:
34 $(MAKE) all_targets 34# make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
35 35
36SUB_DIRS := $(subdir-y) 36# If you want to add some simple compiler switches (like -march=i686),
37ALL_SUB_DIRS := $(sort $(subdir-y) $(subdir-n) $(subdir-)) 37# especially from the command line, use this instead of CFLAGS directly.
38 38# For optimization overrides, it's better still to set OPTIMIZATION.
39 39CFLAGS_EXTRA:=
40# 40
41# Common rules 41# If you want a static binary, turn this on.
42# 42DOSTATIC:=false
43 43
44%.s: %.c 44# Set the following to `true' to make a debuggable build.
45 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -S $< -o $@ 45# Leave this set to `false' for production use.
46 46DODEBUG:=false
47%.i: %.c 47
48 $(CPP) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) $< > $@ 48# This enables compiling with dmalloc ( http://dmalloc.com/ )
49 49# which is an excellent public domain mem leak and malloc problem
50%.o: %.c 50# detector. To enable dmalloc, before running busybox you will
51 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -c -o $@ $< 51# want to first set up your environment.
52 @ ( \ 52# eg: `export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile`
53 echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@))),$$(strip $$(subst $$(comma),:,$$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$@))))' ; \ 53# The debug= value is generated using the following command
54 echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \ 54# dmalloc -p log-stats -p log-non-free -p log-bad-space -p log-elapsed-time \
55 echo 'endif' \ 55# -p check-fence -p check-heap -p check-lists -p check-blank \
56 ) > $(dir $@)/.$(notdir $@).flags 56# -p check-funcs -p realloc-copy -p allow-free-null
57 57# Do not enable this for production builds...
58%.o: %.s 58DODMALLOC:=false
59 $(AS) $(AFLAGS) $(EXTRA_CFLAGS) -o $@ $< 59
60 60# Electric-fence is another very useful malloc debugging library.
61# Old makefiles define their own rules for compiling .S files, 61# Do not enable this for production builds...
62# but these standard rules are available for any Makefile that 62DOEFENCE:=false
63# wants to use them. Our plan is to incrementally convert all 63
64# the Makefiles to these standard rules. -- rmk, mec 64# If you want large file summit support, turn this on.
65ifdef USE_STANDARD_AS_RULE 65# This has no effect if you don't have a kernel with lfs
66 66# support, and a system with libc-2.1.3 or later.
67%.s: %.S 67# Some of the programs that can benefit from lfs support
68 $(CPP) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) $< > $@ 68# are dd, gzip, mount, tar, and mkfs_minix.
69 69# LFS allows you to use the above programs for files
70%.o: %.S 70# larger than 2GB!
71 $(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $< 71DOLFS:=false
72 72
73# If you have a "pristine" source directory, point BB_SRC_DIR to it.
74# Experimental and incomplete; tell the mailing list
75# <busybox@busybox.net> if you do or don't like it so far.
76BB_SRC_DIR:=
77
78# If you are running a cross compiler, you may want to set CROSS
79# to something more interesting, like "arm-linux-".
80CROSS:=
81CC := $(CROSS)gcc
82AR := $(CROSS)ar
83AS := $(CROSS)as
84LD := $(CROSS)ld
85NM := $(CROSS)nm
86STRIP := $(CROSS)strip
87CPP := $(CC) -E
88MAKEFILES := $(TOPDIR).config
89export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
90
91
92# To compile vs uClibc, just use the compiler wrapper built by uClibc...
93# Everything should compile and work as expected these days...
94#CC:=/usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
95
96# To compile vs some other alternative libc, you may need to use/adjust
97# the following lines to meet your needs...
98#
99# If you are using Red Hat 6.x with the compatible RPMs (for developing under
100# Red Hat 5.x and glibc 2.0) uncomment the following. Be sure to read about
101# using the compatible RPMs (compat-*) at http://www.redhat.com !
102#LIBCDIR:=/usr/i386-glibc20-linux
103#
104# The following is used for libc5 (if you install altgcc and libc5-altdev
105# on a Debian system).
106#LIBCDIR:=/usr/i486-linuxlibc1
107#
108# For other libraries, you are on your own...
109#LDFLAGS+=-nostdlib
110#LIBRARIES:=$(LIBCDIR)/lib/libc.a -lgcc
111#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
112#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
113
114# use '-Os' optimization if available, else use -O2
115OPTIMIZATION:=${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
116 >/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
117GCC_STACK_BOUNDRY:=${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null \
118 >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; else echo "" ; fi}
119OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer $(GCC_STACK_BOUNDRY) #-fstrict-aliasing -march=i386 -mcpu=i386 -malign-functions=0 -malign-jumps=0
120WARNINGS:=-Wall -Wstrict-prototypes -Wshadow
121CFLAGS:=-I$(TOPDIR)include
122ARFLAGS:=-r
123
124#
125#--------------------------------------------------------
126# If you're going to do a lot of builds with a non-vanilla configuration,
127# it makes sense to adjust parameters above, so you can type "make"
128# by itself, instead of following it by the same half-dozen overrides
129# every time. The stuff below, on the other hand, is probably less
130# prone to casual user adjustment.
131#
132
133ifeq ($(strip $(DOLFS)),true)
134 # For large file summit support
135 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64
136endif
137ifeq ($(strip $(DODMALLOC)),true)
138 # For testing mem leaks with dmalloc
139 CFLAGS+=-DDMALLOC
140 LIBRARIES:=-ldmalloc
141 # Force debug=true, since this is useless when not debugging...
142 DODEBUG:=true
143else
144 ifeq ($(strip $(DOEFENCE)),true)
145 LIBRARIES:=-lefence
146 # Force debug=true, since this is useless when not debugging...
147 DODEBUG:=true
148 endif
149endif
150ifeq ($(strip $(DODEBUG)),true)
151 CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
152 LDFLAGS +=-Wl,-warn-common
153 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
154else
155 CFLAGS += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
156 LDFLAGS += -s -Wl,-warn-common
157 STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
158endif
159ifeq ($(strip $(DOSTATIC)),true)
160 LDFLAGS += --static
73endif 161endif
74 162
75%.lst: %.c 163ifndef $(PREFIX)
76 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -g -c -o $*.o $< 164 PREFIX:=`pwd`/_install
77 $(TOPDIR)/scripts/makelst $* $(TOPDIR) $(OBJDUMP) 165endif
78#
79#
80#
81all_targets: $(O_TARGET) $(L_TARGET)
82 166
167# Additional complications due to support for pristine source dir.
168# Include files in the build directory should take precedence over
169# the copy in BB_SRC_DIR, both during the compilation phase and the
170# shell script that finds the list of object files.
171# Work in progress by <ldoolitt@recycle.lbl.gov>.
83# 172#
84# Rule to compile a set of .o files into one .o file 173ifneq ($(strip $(BB_SRC_DIR)),)
85# 174 VPATH:=$(BB_SRC_DIR)
86ifdef O_TARGET 175endif
87$(O_TARGET): $(obj-y)
88 rm -f $@
89 ifneq "$(strip $(obj-y))" ""
90 $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^)
91 else
92 $(AR) rcs $@
93 endif
94 @ ( \
95 echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFLAGS) $$(obj-y))))' ; \
96 echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
97 echo 'endif' \
98 ) > $(dir $@)/.$(notdir $@).flags
99endif # O_TARGET
100 176
101# 177CFLAGS += -DBB_VER='"$(VERSION)"'
102# Rule to compile a set of .o files into one .a file 178CFLAGS += -DBB_BT='"$(BUILDTIME)"'
103# 179OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
104ifdef L_TARGET 180CFLAGS += $(CROSS_CFLAGS)
105$(L_TARGET): $(obj-y) 181ifdef BB_INIT_SCRIPT
106 rm -f $@ 182 CFLAGS += -DINIT_SCRIPT='"$(BB_INIT_SCRIPT)"'
107 $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y)
108 @ ( \
109 echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_ARFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_ARFLAGS) $$(obj-y))))' ; \
110 echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \
111 echo 'endif' \
112 ) > $(dir $@)/.$(notdir $@).flags
113endif 183endif
114 184
185# Put user-supplied flags at the end, where they
186# have a chance of winning.
187CFLAGS += $(CFLAGS_EXTRA)
115 188
116# 189%.o: %.c
117# This make dependencies quickly 190 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
118# 191
192ifdef _FASTDEP_ALL_SUB_DIRS
119fastdep: dummy 193fastdep: dummy
120 $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS) -- $(wildcard *.[chS]) > .depend 194 $(TOPDIR)scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -- $(wildcard *.[chS]) > .depend
121ifdef ALL_SUB_DIRS 195ifdef ALL_SUB_DIRS
122 $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)" 196 $(MAKE) $(patsubst %,_sfdep_%,$(ALL_SUB_DIRS)) _FASTDEP_ALL_SUB_DIRS="$(ALL_SUB_DIRS)"
123endif 197endif
124 198
125ifdef _FASTDEP_ALL_SUB_DIRS
126$(patsubst %,_sfdep_%,$(_FASTDEP_ALL_SUB_DIRS)): 199$(patsubst %,_sfdep_%,$(_FASTDEP_ALL_SUB_DIRS)):
127 $(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep 200 $(MAKE) -C $(patsubst _sfdep_%,%,$@) fastdep
128endif 201endif
129 202
130 203.PHONY: dummy
131#
132# A rule to make subdirectories
133#
134subdir-list = $(sort $(patsubst %,_subdir_%,$(SUB_DIRS)))
135sub_dirs: dummy $(subdir-list)
136
137ifdef SUB_DIRS
138$(subdir-list) : dummy
139 $(MAKE) -C $(patsubst _subdir_%,%,$@)
140endif
141
142#
143# A rule to do nothing
144#
145dummy:
146
147#
148# This is useful for testing
149#
150script:
151 $(SCRIPT)
152
153#
154# include dependency files if they exist
155#
156ifneq ($(wildcard .depend),)
157include .depend
158endif
159
160ifneq ($(wildcard $(TOPDIR)/.hdepend),)
161include $(TOPDIR)/.hdepend
162endif
163 204
164#
165# Find files whose flags have changed and force recompilation.
166# For safety, this works in the converse direction:
167# every file is forced, except those whose flags are positively up-to-date.
168#
169FILES_FLAGS_UP_TO_DATE :=
170 205
171# For use in expunging commas from flags, which mung our checking.
172comma = ,
173 206
174FILES_FLAGS_EXIST := $(wildcard .*.flags) 207.EXPORT_ALL_VARIABLES:
175ifneq ($(FILES_FLAGS_EXIST),)
176include $(FILES_FLAGS_EXIST)
177endif
178 208
179FILES_FLAGS_CHANGED := $(strip \
180 $(filter-out $(FILES_FLAGS_UP_TO_DATE), \
181 $(O_TARGET) $(L_TARGET) $(active-objs) \
182 ))
183
184# A kludge: .S files don't get flag dependencies (yet),
185# because that will involve changing a lot of Makefiles. Also
186# suppress object files explicitly listed in $(IGNORE_FLAGS_OBJS).
187# This allows handling of assembly files that get translated into
188# multiple object files (see arch/ia64/lib/idiv.S, for example).
189FILES_FLAGS_CHANGED := $(strip \
190 $(filter-out $(patsubst %.S, %.o, $(wildcard *.S) $(IGNORE_FLAGS_OBJS)), \
191 $(FILES_FLAGS_CHANGED)))
192
193ifneq ($(FILES_FLAGS_CHANGED),)
194$(FILES_FLAGS_CHANGED): dummy
195endif
diff --git a/applets/Makefile b/applets/Makefile
index e6efc17d9..c4887f908 100644
--- a/applets/Makefile
+++ b/applets/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,18 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := applets.a 21APPLETS_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27obj-y += applets.o busybox.o usage.o
28
29# Hand off to toplevel Rules.mak
30include $(TOPDIR)/Rules.mak
31 27
32clean: 28clean:
33 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
34 30
diff --git a/applets/Makefile.in b/applets/Makefile.in
new file mode 100644
index 000000000..f198a1447
--- /dev/null
+++ b/applets/Makefile.in
@@ -0,0 +1,32 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20APPLETS_AR:=applets.a
21ifndef $(APPLETS_DIR)
22APPLETS_DIR:=$(TOPDIR)applets/
23endif
24
25APPLET_SRC:=applets.c busybox.c usage.c
26APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
27
28libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
29
30$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
31 $(AR) -ro $@ $(APPLET_OBJ)
32
diff --git a/archival/Makefile b/archival/Makefile
index 35ba02f3b..d76face4b 100644
--- a/archival/Makefile
+++ b/archival/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,29 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := archival.a 21ARCHIVAL_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26subdir-y := libunarchive 26-include $(TOPDIR).depend
27
28obj-$(CONFIG_AR) += ar.o
29obj-$(CONFIG_BUNZIP2) += bunzip2.o
30obj-$(CONFIG_CPIO) += cpio.o
31obj-$(CONFIG_DPKG) += dpkg.o
32obj-$(CONFIG_DPKG_DEB) += dpkg_deb.o
33obj-$(CONFIG_GUNZIP) += gunzip.o
34obj-$(CONFIG_GZIP) += gzip.o
35obj-$(CONFIG_RPM2CPIO) += rpm2cpio.o
36obj-$(CONFIG_TAR) += tar.o
37obj-$(CONFIG_UNZIP) += unzip.o
38
39
40# Hand off to toplevel Rules.mak
41include $(TOPDIR)/Rules.mak
42 27
43clean: 28clean:
44 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
45 30
diff --git a/archival/Makefile.in b/archival/Makefile.in
new file mode 100644
index 000000000..c53171eea
--- /dev/null
+++ b/archival/Makefile.in
@@ -0,0 +1,41 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20ARCHIVAL_AR:=archival.a
21ifndef $(ARCHIVAL_DIR)
22ARCHIVAL_DIR:=$(TOPDIR)archival/
23endif
24
25ARCHIVAL-y:=
26ARCHIVAL-$(CONFIG_AR) += ar.o
27ARCHIVAL-$(CONFIG_BUNZIP2) += bunzip2.o
28ARCHIVAL-$(CONFIG_CPIO) += cpio.o
29ARCHIVAL-$(CONFIG_DPKG) += dpkg.o
30ARCHIVAL-$(CONFIG_DPKG_DEB) += dpkg_deb.o
31ARCHIVAL-$(CONFIG_GUNZIP) += gunzip.o
32ARCHIVAL-$(CONFIG_GZIP) += gzip.o
33ARCHIVAL-$(CONFIG_RPM2CPIO) += rpm2cpio.o
34ARCHIVAL-$(CONFIG_TAR) += tar.o
35ARCHIVAL-$(CONFIG_UNZIP) += unzip.o
36
37libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
38
39$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
40 $(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
41
diff --git a/archival/libunarchive/Makefile b/archival/libunarchive/Makefile
index a8409a432..7979879c4 100644
--- a/archival/libunarchive/Makefile
+++ b/archival/libunarchive/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,45 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=../.. 20TOPDIR:= ../../
21L_TARGET := libunarchive.a 21LIBUNARCHIVE_DIR:=./
22 22include $(TOPDIR).config
23obj-y := unarchive.o seek_sub_file.o 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27ifeq ($(CONFIG_DPKG),y)
28 obj-y += deb_extract.o get_header_ar.o get_header_tar.o
29endif
30
31ifeq ($(CONFIG_DPKG_DEB),y)
32 obj-y += deb_extract.o get_header_ar.o get_header_tar.o
33endif
34
35ifeq ($(CONFIG_AR),y)
36 obj-y += get_header_ar.o
37endif
38
39ifeq ($(CONFIG_CPIO),y)
40 obj-y += get_header_cpio.o
41endif
42
43ifeq ($(CONFIG_RPM2CPIO),y)
44 obj-y += get_header_cpio.o
45endif
46
47ifeq ($(CONFIG_TAR),y)
48 obj-y += get_header_tar.o
49endif
50
51ifeq ($(CONFIG_UNZIP),y)
52 obj-y += get_header_zip.o
53endif
54
55
56# Hand off to toplevel Rules.mak
57include $(TOPDIR)/Rules.mak
58 27
59clean: 28clean:
60 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
61 30
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in
new file mode 100644
index 000000000..cd68be732
--- /dev/null
+++ b/archival/libunarchive/Makefile.in
@@ -0,0 +1,38 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20LIBUNARCHIVE_AR:=libunarchive.a
21ifndef $(LIBUNARCHIVE_DIR)
22LIBUNARCHIVE_DIR:=$(TOPDIR)archival/libunarchive/
23endif
24
25LIBUNARCHIVE-y:=unarchive.o seek_sub_file.o
26LIBUNARCHIVE-$(CONFIG_DPKG) += deb_extract.o get_header_ar.o get_header_tar.o
27LIBUNARCHIVE-$(CONFIG_DPKG_DEB) += deb_extract.o get_header_ar.o get_header_tar.o
28LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o
29LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o
30LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += get_header_cpio.o
31LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
32LIBUNARCHIVE-$(CONFIG_UNZIP) += get_header_zip.o
33
34libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
35
36$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
37 $(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
38
diff --git a/console-tools/Makefile b/console-tools/Makefile
index a67e4bb7b..2cea319ad 100644
--- a/console-tools/Makefile
+++ b/console-tools/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,27 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := console-tools.a 21CONSOLETOOLS_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27obj-$(CONFIG_CHVT) += chvt.o
28obj-$(CONFIG_CLEAR) += clear.o
29obj-$(CONFIG_DEALLOCVT) += deallocvt.o
30obj-$(CONFIG_DUMPKMAP) += dumpkmap.o
31obj-$(CONFIG_LOADACM) += loadacm.o
32obj-$(CONFIG_LOADFONT) += loadfont.o
33obj-$(CONFIG_LOADKMAP) += loadkmap.o
34obj-$(CONFIG_RESET) += reset.o
35obj-$(CONFIG_SETKEYCODES) += setkeycodes.o
36
37
38# Hand off to toplevel Rules.mak
39include $(TOPDIR)/Rules.mak
40 27
41clean: 28clean:
42 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
43 30
diff --git a/console-tools/Makefile.in b/console-tools/Makefile.in
new file mode 100644
index 000000000..bc0335643
--- /dev/null
+++ b/console-tools/Makefile.in
@@ -0,0 +1,40 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20CONSOLETOOLS_AR:=console-tools.a
21ifndef $(CONSOLETOOLS_DIR)
22CONSOLETOOLS_DIR:=$(TOPDIR)console-tools/
23endif
24
25CONSOLETOOLS_DIR-y:=
26CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o
27CONSOLETOOLS_DIR-$(CONFIG_CLEAR) += clear.o
28CONSOLETOOLS_DIR-$(CONFIG_DEALLOCVT) += deallocvt.o
29CONSOLETOOLS_DIR-$(CONFIG_DUMPKMAP) += dumpkmap.o
30CONSOLETOOLS_DIR-$(CONFIG_LOADACM) += loadacm.o
31CONSOLETOOLS_DIR-$(CONFIG_LOADFONT) += loadfont.o
32CONSOLETOOLS_DIR-$(CONFIG_LOADKMAP) += loadkmap.o
33CONSOLETOOLS_DIR-$(CONFIG_RESET) += reset.o
34CONSOLETOOLS_DIR-$(CONFIG_SETKEYCODES) += setkeycodes.o
35
36libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
37
38$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
39 $(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
40
diff --git a/editors/Makefile b/editors/Makefile
index 7d8d96582..4df771090 100644
--- a/editors/Makefile
+++ b/editors/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,20 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := editors.a 21EDITOR_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27obj-$(CONFIG_SED) += sed.o
28obj-$(CONFIG_VI) += vi.o
29
30
31# Hand off to toplevel Rules.mak
32include $(TOPDIR)/Rules.mak
33 27
34clean: 28clean:
35 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
36 30
diff --git a/editors/Makefile.in b/editors/Makefile.in
new file mode 100644
index 000000000..88c75890f
--- /dev/null
+++ b/editors/Makefile.in
@@ -0,0 +1,35 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20EDITOR_AR:=editors.a
21ifndef $(EDITOR_DIR)
22EDITOR_DIR:=$(TOPDIR)editors/
23endif
24
25EDITOR-y:=
26EDITOR-$(CONFIG_SED) += sed.o
27EDITOR-$(CONFIG_VI) += vi.o
28EDITOR_SRC:= $(EDITOR-y)
29EDITOR_OBJ:= $(patsubst %.c,$(EDITOR_DIR)%.o, $(EDITOR_SRC))
30
31libraries-y+=$(EDITOR_DIR)$(EDITOR_AR)
32
33$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
34 $(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
35
diff --git a/findutils/Makefile b/findutils/Makefile
index ac590ccf4..dee8a664f 100644
--- a/findutils/Makefile
+++ b/findutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,23 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := findutils.a 21FINDUTILS_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27
28obj-$(CONFIG_FIND) += find.o
29obj-$(CONFIG_GREP) += grep.o
30obj-$(CONFIG_WHICH) += which.o
31obj-$(CONFIG_XARGS) += xargs.o
32
33
34# Hand off to toplevel Rules.mak
35include $(TOPDIR)/Rules.mak
36 27
37clean: 28clean:
38 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
39 30
diff --git a/findutils/Makefile.in b/findutils/Makefile.in
new file mode 100644
index 000000000..2deaadb05
--- /dev/null
+++ b/findutils/Makefile.in
@@ -0,0 +1,35 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20FINDUTILS_AR:=findutils.a
21ifndef $(FINDUTILS_DIR)
22FINDUTILS_DIR:=$(TOPDIR)findutils/
23endif
24
25FINDUTILS-y:=
26FINDUTILS-$(CONFIG_FIND) += find.o
27FINDUTILS-$(CONFIG_GREP) += grep.o
28FINDUTILS-$(CONFIG_WHICH) += which.o
29FINDUTILS-$(CONFIG_XARGS) += xargs.o
30
31libraries-y+=$(FINDUTILS_DIR)$(FINDUTILS_AR)
32
33$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
34 $(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
35
diff --git a/init/Makefile b/init/Makefile
index 76f49794d..8d0cdc4ec 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,24 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := init.a 21INIT_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27obj-$(CONFIG_HALT) += halt.o
28obj-$(CONFIG_INIT) += init.o
29obj-$(CONFIG_POWEROFF) += poweroff.o
30obj-$(CONFIG_REBOOT) += reboot.o
31obj-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o
32obj-$(CONFIG_RUN_PARTS) += run_parts.o
33
34
35# Hand off to toplevel Rules.mak
36include $(TOPDIR)/Rules.mak
37 27
38clean: 28clean:
39 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
40 30
diff --git a/init/Makefile.in b/init/Makefile.in
new file mode 100644
index 000000000..8cc95264d
--- /dev/null
+++ b/init/Makefile.in
@@ -0,0 +1,37 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20INIT_AR:=init.a
21ifndef $(INIT_DIR)
22INIT_DIR:=$(TOPDIR)init/
23endif
24
25INIT-y:=
26INIT-$(CONFIG_HALT) += halt.o
27INIT-$(CONFIG_INIT) += init.o
28INIT-$(CONFIG_POWEROFF) += poweroff.o
29INIT-$(CONFIG_REBOOT) += reboot.o
30INIT-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o
31INIT-$(CONFIG_RUN_PARTS) += run_parts.o
32
33libraries-y+=$(INIT_DIR)$(INIT_AR)
34
35$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
36 $(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
37
diff --git a/libbb/Makefile b/libbb/Makefile
index 879be2452..f6d021ce9 100644
--- a/libbb/Makefile
+++ b/libbb/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 2001 Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -15,53 +15,16 @@
15# You should have received a copy of the GNU General Public License 15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software 16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
18 19
19 20TOPDIR:= ../
20 21LIBBB_DIR:=./
21TOPDIR :=.. 22include $(TOPDIR).config
22L_TARGET := libbb.a 23include $(TOPDIR)Rules.mak
23 24include Makefile.in
24LIBBB_MSRC=messages.c 25all: $(libraries-y)
25LIBBB_OBJ= full_version name_too_long omitting_directory not_a_directory \ 26-include $(TOPDIR).depend
26 memory_exhausted invalid_date invalid_option io_error dash_dash_help \
27 write_error too_few_args name_longer_than_foo unknown can_not_create_raw_socket
28LIBBB_MOBJS=$(patsubst %,%.o, $(LIBBB_OBJ))
29
30obj-y :=
31obj-n :=
32obj- :=
33
34obj-y += ask_confirmation.o chomp.o concat_path_file.o copy_file.o \
35 copy_file_chunk.o dump.o libc5.o device_open.o error_msg.o \
36 error_msg_and_die.o fgets_str.o find_mount_point.o find_pid_by_name.o \
37 find_root_device.o full_read.o full_write.o get_console.o \
38 get_last_path_component.o get_line_from_file.o gz_open.o human_readable.o \
39 isdirectory.o kernel_version.o loop.o mode_string.o module_syscalls.o mtab.o \
40 mtab_file.o my_getgrnam.o my_getgrgid.o my_getpwnam.o my_getpwnamegid.o \
41 my_getpwuid.o parse_mode.o parse_number.o perror_msg.o perror_msg_and_die.o \
42 print_file.o process_escape_sequence.o read_package_field.o recursive_action.o \
43 safe_read.o safe_strncpy.o syscalls.o syslog_msg_with_name.o time_string.o \
44 trim.o unzip.o vdprintf.o verror_msg.o vperror_msg.o wfopen.o xfuncs.o \
45 xgetcwd.o xreadlink.o xregcomp.o interface.o remove_file.o last_char_is.o \
46 copyfd.o vherror_msg.o herror_msg.o herror_msg_and_die.o xgethostbyname.o \
47 dirname.o make_directory.o create_icmp_socket.o u_signal_names.o arith.o \
48 simplify_path.o inet_common.o inode_hash.o $(LIBBB_MOBJS) $(LIBBB_AROBJS)
49
50
51# Hand off to toplevel Rules.mak
52include $(TOPDIR)/Rules.mak
53
54$(LIBBB_MOBJS): $(LIBBB_MSRC)
55 $(CC) $(CFLAGS) -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"' \
56 $(LIBBB_CFLAGS) -DL_$(patsubst %,%,$*) -c $< -o $*.o
57
58$(LIBBB_AROBJS): $(LIBBB_ARCSRC)
59 $(CC) $(CFLAGS) $(LIBBB_CFLAGS) -DL_$(patsubst %,%,$*) -c $< -o $*.o
60
61loop.o: loop.h
62
63loop.h: mk_loop_h.sh
64 @ $(SHELL) $< > $@
65 27
66clean: 28clean:
67 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
30
diff --git a/libbb/Makefile.in b/libbb/Makefile.in
new file mode 100644
index 000000000..6d098c0e5
--- /dev/null
+++ b/libbb/Makefile.in
@@ -0,0 +1,63 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19
20
21LIBBB_AR:=libbb.a
22ifndef $(LIBBB_DIR)
23LIBBB_DIR:=$(TOPDIR)libbb/
24endif
25
26LIBBB_SRC:= \
27 ask_confirmation.c chomp.c concat_path_file.c copy_file.c \
28 copy_file_chunk.c dump.c libc5.c device_open.c error_msg.c \
29 error_msg_and_die.c fgets_str.c find_mount_point.c find_pid_by_name.c \
30 find_root_device.c full_read.c full_write.c get_console.c \
31 get_last_path_component.c get_line_from_file.c gz_open.c human_readable.c \
32 isdirectory.c kernel_version.c loop.c mode_string.c module_syscalls.c mtab.c \
33 mtab_file.c my_getgrnam.c my_getgrgid.c my_getpwnam.c my_getpwnamegid.c \
34 my_getpwuid.c parse_mode.c parse_number.c perror_msg.c perror_msg_and_die.c \
35 print_file.c process_escape_sequence.c read_package_field.c recursive_action.c \
36 safe_read.c safe_strncpy.c syscalls.c syslog_msg_with_name.c time_string.c \
37 trim.c unzip.c vdprintf.c verror_msg.c vperror_msg.c wfopen.c xfuncs.c \
38 xgetcwd.c xreadlink.c xregcomp.c interface.c remove_file.c last_char_is.c \
39 copyfd.c vherror_msg.c herror_msg.c herror_msg_and_die.c xgethostbyname.c \
40 dirname.c make_directory.c create_icmp_socket.c u_signal_names.c arith.c \
41 simplify_path.c inet_common.c inode_hash.c
42LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC))
43
44LIBBB_MSRC:=$(LIBBB_DIR)messages.c
45LIBBB_MOBJ:=full_version.o name_too_long.o omitting_directory.o not_a_directory.o \
46 memory_exhausted.o invalid_date.o invalid_option.o io_error.o dash_dash_help.o \
47 write_error.o too_few_args.o name_longer_than_foo.o unknown.o can_not_create_raw_socket.o
48LIBBB_MOBJS=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ))
49
50libraries-y+=$(LIBBB_DIR)$(LIBBB_AR)
51
52$(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS)
53 $(AR) -ro $@ $(LIBBB_OBJS) $(LIBBB_MOBJS)
54
55$(LIBBB_MOBJS): $(LIBBB_MSRC)
56 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
57
58$(LIBBB_DIR)loop.o: $(LIBBB_DIR)loop.h
59
60$(LIBBB_DIR)loop.h: $(LIBBB_DIR)mk_loop_h.sh
61 @ $(SHELL) $< > $@
62
63
diff --git a/miscutils/Makefile b/miscutils/Makefile
index 3a4d1b659..b1765f627 100644
--- a/miscutils/Makefile
+++ b/miscutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,30 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := miscutils.a 21MISCUTILS_DIR:=./
22EXTRA_CFLAGS = -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"' 22include $(TOPDIR).config
23 23include $(TOPDIR)Rules.mak
24obj-y := 24include Makefile.in
25obj-n := 25all: $(libraries-y)
26obj- := 26-include $(TOPDIR).depend
27
28
29obj-$(CONFIG_ADJTIMEX) += adjtimex.o
30obj-$(CONFIG_DC) += dc.o
31obj-$(CONFIG_DUTMP) += dutmp.o
32obj-$(CONFIG_MAKEDEVS) += makedevs.o
33obj-$(CONFIG_MKTEMP) += mktemp.o
34obj-$(CONFIG_MT) += mt.o
35obj-$(CONFIG_READLINK) += readlink.o
36obj-$(CONFIG_TIME) += time.o
37obj-$(CONFIG_UPDATE) += update.o
38obj-$(CONFIG_WATCHDOG) += watchdog.o
39
40
41# Hand off to toplevel Rules.mak
42include $(TOPDIR)/Rules.mak
43 27
44clean: 28clean:
45 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
46 30
diff --git a/miscutils/Makefile.in b/miscutils/Makefile.in
new file mode 100644
index 000000000..078f87001
--- /dev/null
+++ b/miscutils/Makefile.in
@@ -0,0 +1,42 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20MISCUTILS_AR:=miscutils.a
21ifndef $(MISCUTILS_DIR)
22MISCUTILS_DIR:=$(TOPDIR)miscutils/
23endif
24
25
26MISCUTILS-y:=
27MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
28MISCUTILS-$(CONFIG_DC) += dc.o
29MISCUTILS-$(CONFIG_DUTMP) += dutmp.o
30MISCUTILS-$(CONFIG_MAKEDEVS) += makedevs.o
31MISCUTILS-$(CONFIG_MKTEMP) += mktemp.o
32MISCUTILS-$(CONFIG_MT) += mt.o
33MISCUTILS-$(CONFIG_READLINK) += readlink.o
34MISCUTILS-$(CONFIG_TIME) += time.o
35MISCUTILS-$(CONFIG_UPDATE) += update.o
36MISCUTILS-$(CONFIG_WATCHDOG) += watchdog.o
37
38libraries-y+=$(MISCUTILS_DIR)$(MISCUTILS_AR)
39
40$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
41 $(AR) -ro $@ $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
42
diff --git a/modutils/Makefile b/modutils/Makefile
index 7a8d4664e..e8246cee7 100644
--- a/modutils/Makefile
+++ b/modutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,23 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := modutils.a 21MODUTILS_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27
28obj-$(CONFIG_INSMOD) += insmod.o
29obj-$(CONFIG_LSMOD) += lsmod.o
30obj-$(CONFIG_MODPROBE) += modprobe.o
31obj-$(CONFIG_RMMOD) += rmmod.o
32
33
34# Hand off to toplevel Rules.mak
35include $(TOPDIR)/Rules.mak
36 27
37clean: 28clean:
38 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
39 30
diff --git a/modutils/Makefile.in b/modutils/Makefile.in
new file mode 100644
index 000000000..6ad9582fd
--- /dev/null
+++ b/modutils/Makefile.in
@@ -0,0 +1,35 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20MODUTILS_AR:=modutils.a
21ifndef $(MODUTILS_DIR)
22MODUTILS_DIR:=$(TOPDIR)modutils/
23endif
24
25MODUTILS-y:=
26MODUTILS-$(CONFIG_INSMOD) += insmod.o
27MODUTILS-$(CONFIG_LSMOD) += lsmod.o
28MODUTILS-$(CONFIG_MODPROBE) += modprobe.o
29MODUTILS-$(CONFIG_RMMOD) += rmmod.o
30
31libraries-y+=$(MODUTILS_DIR)$(MODUTILS_AR)
32
33$(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
34 $(AR) -ro $@ $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
35
diff --git a/networking/Makefile b/networking/Makefile
index 4b522ffff..4caa18338 100644
--- a/networking/Makefile
+++ b/networking/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,30 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := networking.a 21NETWORKING_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27
28obj-$(CONFIG_HOSTNAME) += hostname.o
29obj-$(CONFIG_IFCONFIG) += ifconfig.o
30obj-$(CONFIG_NC) += nc.o
31obj-$(CONFIG_NETSTAT) += netstat.o
32obj-$(CONFIG_NSLOOKUP) += nslookup.o
33obj-$(CONFIG_PING) += ping.o
34obj-$(CONFIG_ROUTE) += route.o
35obj-$(CONFIG_TELNET) += telnet.o
36obj-$(CONFIG_TFTP) += tftp.o
37obj-$(CONFIG_TRACEROUTE) += traceroute.o
38obj-$(CONFIG_WGET) += wget.o
39
40
41# Hand off to toplevel Rules.mak
42include $(TOPDIR)/Rules.mak
43 27
44clean: 28clean:
45 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
46 30
diff --git a/networking/Makefile.in b/networking/Makefile.in
new file mode 100644
index 000000000..6f3cc2189
--- /dev/null
+++ b/networking/Makefile.in
@@ -0,0 +1,42 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20NETWORKING_AR:=networking.a
21ifndef $(NETWORKING_DIR)
22NETWORKING_DIR:=$(TOPDIR)networking/
23endif
24
25NETWORKING-y:=
26NETWORKING-$(CONFIG_HOSTNAME) += hostname.o
27NETWORKING-$(CONFIG_IFCONFIG) += ifconfig.o
28NETWORKING-$(CONFIG_NC) += nc.o
29NETWORKING-$(CONFIG_NETSTAT) += netstat.o
30NETWORKING-$(CONFIG_NSLOOKUP) += nslookup.o
31NETWORKING-$(CONFIG_PING) += ping.o
32NETWORKING-$(CONFIG_ROUTE) += route.o
33NETWORKING-$(CONFIG_TELNET) += telnet.o
34NETWORKING-$(CONFIG_TFTP) += tftp.o
35NETWORKING-$(CONFIG_TRACEROUTE) += traceroute.o
36NETWORKING-$(CONFIG_WGET) += wget.o
37
38libraries-y+=$(NETWORKING_DIR)$(NETWORKING_AR)
39
40$(NETWORKING_DIR)$(NETWORKING_AR): $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
41 $(AR) -ro $@ $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
42
diff --git a/procps/Makefile b/procps/Makefile
index 0e3bdc254..8e572aa4a 100644
--- a/procps/Makefile
+++ b/procps/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,24 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := procps.a 21PROCPS_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27obj-$(CONFIG_FREE) += free.o
28obj-$(CONFIG_KILL) += kill.o
29obj-$(CONFIG_PIDOF) += pidof.o
30obj-$(CONFIG_PS) += ps.o
31obj-$(CONFIG_RENICE) += renice.o
32obj-$(CONFIG_UPTIME) += uptime.o
33
34
35# Hand off to toplevel Rules.mak
36include $(TOPDIR)/Rules.mak
37 27
38clean: 28clean:
39 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
40 30
diff --git a/procps/Makefile.in b/procps/Makefile.in
new file mode 100644
index 000000000..1851d8953
--- /dev/null
+++ b/procps/Makefile.in
@@ -0,0 +1,37 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20PROCPS_AR:=procps.a
21ifndef $(PROCPS_DIR)
22PROCPS_DIR:=$(TOPDIR)procps/
23endif
24
25PROCPS-:=
26PROCPS-$(CONFIG_FREE) += free.o
27PROCPS-$(CONFIG_KILL) += kill.o
28PROCPS-$(CONFIG_PIDOF) += pidof.o
29PROCPS-$(CONFIG_PS) += ps.o
30PROCPS-$(CONFIG_RENICE) += renice.o
31PROCPS-$(CONFIG_UPTIME) += uptime.o
32
33libraries-y+=$(PROCPS_DIR)$(PROCPS_AR)
34
35$(PROCPS_DIR)$(PROCPS_AR): $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
36 $(AR) -ro $@ $(patsubst %,$(PROCPS_DIR)%, $(PROCPS-y))
37
diff --git a/shell/Makefile b/shell/Makefile
index e0229973e..f3b1042e6 100644
--- a/shell/Makefile
+++ b/shell/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,24 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := shell.a 21SHELL_DIR:=./
22EXTRA_CFLAGS = -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"' 22include $(TOPDIR).config
23 23include $(TOPDIR)Rules.mak
24obj-y := 24include Makefile.in
25obj-n := 25all: $(libraries-y)
26obj- := 26-include $(TOPDIR).depend
27
28obj-$(CONFIG_ASH) += ash.o
29obj-$(CONFIG_HUSH) += hush.o
30obj-$(CONFIG_LASH) += lash.o
31obj-$(CONFIG_MSH) += msh.o
32obj-$(CONFIG_FEATURE_COMMAND_EDITING) += cmdedit.o
33
34
35# Hand off to toplevel Rules.mak
36include $(TOPDIR)/Rules.mak
37 27
38clean: 28clean:
39 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
40 30
diff --git a/shell/Makefile.in b/shell/Makefile.in
new file mode 100644
index 000000000..a5778d6fd
--- /dev/null
+++ b/shell/Makefile.in
@@ -0,0 +1,36 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 by Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19
20SHELL_AR:=shell.a
21ifndef $(SHELL_DIR)
22SHELL_DIR:=$(TOPDIR)shell/
23endif
24
25SHELLT-y:=
26SHELLT-$(CONFIG_ASH) += ash.o
27SHELLT-$(CONFIG_HUSH) += hush.o
28SHELLT-$(CONFIG_LASH) += lash.o
29SHELLT-$(CONFIG_MSH) += msh.o
30SHELLT-$(CONFIG_FEATURE_COMMAND_EDITING) += cmdedit.o
31
32libraries-y+=$(SHELL_DIR)$(SHELL_AR)
33
34$(SHELL_DIR)$(SHELL_AR): $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
35 $(AR) -ro $@ $(patsubst %,$(SHELL_DIR)%, $(SHELLT-y))
36
diff --git a/sysklogd/Makefile b/sysklogd/Makefile
index 3f7da6d3c..dc2098f11 100644
--- a/sysklogd/Makefile
+++ b/sysklogd/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,23 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := sysklogd.a 21SYSKLOGD_DIR:=./
22EXTRA_CFLAGS = -DBB_VER='"$(VERSION)"' -DBB_BT='"$(BUILDTIME)"' 22include $(TOPDIR).config
23 23include $(TOPDIR)Rules.mak
24obj-y := 24include Makefile.in
25obj-n := 25all: $(libraries-y)
26obj- := 26-include $(TOPDIR).depend
27
28
29obj-$(CONFIG_KLOGD) += klogd.o
30obj-$(CONFIG_LOGGER) += logger.o
31obj-$(CONFIG_LOGREAD) += logread.o
32obj-$(CONFIG_SYSLOGD) += syslogd.o
33
34# Hand off to toplevel Rules.mak
35include $(TOPDIR)/Rules.mak
36 27
37clean: 28clean:
38 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
39 30
diff --git a/sysklogd/Makefile.in b/sysklogd/Makefile.in
new file mode 100644
index 000000000..aacb941bd
--- /dev/null
+++ b/sysklogd/Makefile.in
@@ -0,0 +1,35 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20SYSKLOGD_AR:=sysklogd.a
21ifndef $(SYSKLOGD_DIR)
22SYSKLOGD_DIR:=$(TOPDIR)sysklogd/
23endif
24
25SYSKLOGD-:=
26SYSKLOGD-$(CONFIG_KLOGD) += klogd.o
27SYSKLOGD-$(CONFIG_LOGGER) += logger.o
28SYSKLOGD-$(CONFIG_LOGREAD) += logread.o
29SYSKLOGD-$(CONFIG_SYSLOGD) += syslogd.o
30
31libraries-y+=$(SYSKLOGD_DIR)$(SYSKLOGD_AR)
32
33$(SYSKLOGD_DIR)$(SYSKLOGD_AR): $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
34 $(AR) -ro $@ $(patsubst %,$(SYSKLOGD_DIR)%, $(SYSKLOGD-y))
35
diff --git a/util-linux/Makefile b/util-linux/Makefile
index 9cd1486b6..41080a930 100644
--- a/util-linux/Makefile
+++ b/util-linux/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org> 3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -17,34 +17,14 @@
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18# 18#
19 19
20TOPDIR :=.. 20TOPDIR:= ../
21L_TARGET := util-linux.a 21UTILLINUX_DIR:=./
22 22include $(TOPDIR).config
23obj-y := 23include $(TOPDIR)Rules.mak
24obj-n := 24include Makefile.in
25obj- := 25all: $(libraries-y)
26 26-include $(TOPDIR).depend
27obj-$(CONFIG_DMESG) += dmesg.o
28obj-$(CONFIG_FBSET) += fbset.o
29obj-$(CONFIG_FDFLUSH) += fdflush.o
30obj-$(CONFIG_FREERAMDISK) += freeramdisk.o
31obj-$(CONFIG_FSCK_MINIX) += fsck_minix.o
32obj-$(CONFIG_GETOPT) += getopt.o
33obj-$(CONFIG_HEXDUMP) += hexdump.o
34obj-$(CONFIG_LOSETUP) += losetup.o
35obj-$(CONFIG_MKFS_MINIX) += mkfs_minix.o
36obj-$(CONFIG_MKSWAP) += mkswap.o
37obj-$(CONFIG_MORE) += more.o
38obj-$(CONFIG_MOUNT) += mount.o
39obj-$(CONFIG_NFSMOUNT) += nfsmount.o
40obj-$(CONFIG_PIVOT_ROOT) += pivot_root.o
41obj-$(CONFIG_RDATE) += rdate.o
42obj-$(CONFIG_SWAPONOFF) += swaponoff.o
43obj-$(CONFIG_UMOUNT) += umount.o
44
45# Hand off to toplevel Rules.mak
46include $(TOPDIR)/Rules.mak
47 27
48clean: 28clean:
49 rm -f $(L_TARGET) *.o core 29 rm -f *.o *.a $(AR_TARGET)
50 30
diff --git a/util-linux/Makefile.in b/util-linux/Makefile.in
new file mode 100644
index 000000000..fbe075ded
--- /dev/null
+++ b/util-linux/Makefile.in
@@ -0,0 +1,48 @@
1# Makefile for busybox
2#
3# Copyright (C) 1999-2002 Erik Andersen <andersee@debian.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13# General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18#
19
20UTILLINUX_AR:=util-linux.a
21ifndef $(UTILLINUX_DIR)
22UTILLINUX_DIR:=$(TOPDIR)util-linux/
23endif
24
25UTILLINUX-:=
26UTILLINUX-$(CONFIG_DMESG) += dmesg.o
27UTILLINUX-$(CONFIG_FBSET) += fbset.o
28UTILLINUX-$(CONFIG_FDFLUSH) += fdflush.o
29UTILLINUX-$(CONFIG_FREERAMDISK) += freeramdisk.o
30UTILLINUX-$(CONFIG_FSCK_MINIX) += fsck_minix.o
31UTILLINUX-$(CONFIG_GETOPT) += getopt.o
32UTILLINUX-$(CONFIG_HEXDUMP) += hexdump.o
33UTILLINUX-$(CONFIG_LOSETUP) += losetup.o
34UTILLINUX-$(CONFIG_MKFS_MINIX) += mkfs_minix.o
35UTILLINUX-$(CONFIG_MKSWAP) += mkswap.o
36UTILLINUX-$(CONFIG_MORE) += more.o
37UTILLINUX-$(CONFIG_MOUNT) += mount.o
38UTILLINUX-$(CONFIG_NFSMOUNT) += nfsmount.o
39UTILLINUX-$(CONFIG_PIVOT_ROOT) += pivot_root.o
40UTILLINUX-$(CONFIG_RDATE) += rdate.o
41UTILLINUX-$(CONFIG_SWAPONOFF) += swaponoff.o
42UTILLINUX-$(CONFIG_UMOUNT) += umount.o
43
44libraries-y+=$(UTILLINUX_DIR)$(UTILLINUX_AR)
45
46$(UTILLINUX_DIR)$(UTILLINUX_AR): $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
47 $(AR) -ro $@ $(patsubst %,$(UTILLINUX_DIR)%, $(UTILLINUX-y))
48