blob: b60b6a405203963afe825c90d9065ab6d52eea8f [file] [log] [blame]
Eric Andersenc4996011999-10-20 22:08:37 +00001# Makefile for busybox
2#
Eric Andersenbdfd0d72001-10-24 05:00:29 +00003# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
Erik Andersen9ffdaa62000-02-11 21:55:04 +00004#
Eric Andersenc4996011999-10-20 22:08:37 +00005# 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
Erik Andersen7c4b2f32000-02-29 21:49:22 +000020PROG := busybox
Eric Andersend36cdd22001-08-22 04:16:36 +000021VERSION := 0.61.pre
Matt Kraai6ba1a802001-04-12 20:11:55 +000022BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
Eric Andersenbdfd0d72001-10-24 05:00:29 +000023TOPDIR := ${shell /bin/pwd}
24HOSTCC := gcc
25HOSTCFLAGS:= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
26
27
28# What OS are you compiling busybox for? This allows you to include
29# OS specific things, syscall overrides, etc.
30TARGET_OS := linux
Eric Andersencc8ed391999-10-05 16:24:54 +000031
Eric Andersen20ea5c32000-11-29 22:08:35 +000032# 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:
Eric Andersenbdfd0d72001-10-24 05:00:29 +000035# make CROSS=powerpc-linux- CONFIG_SRC_DIR=$HOME/busybox PREFIX=/mnt/app
Eric Andersen20ea5c32000-11-29 22:08:35 +000036
Eric Andersen0d5a08e2001-01-22 01:05:04 +000037# 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
Eric Andersen51154ba2000-07-20 21:57:11 +000042# If you want a static binary, turn this on.
43DOSTATIC = false
44
Erik Andersenfac10d72000-02-07 05:29:42 +000045# Set the following to `true' to make a debuggable build.
46# Leave this set to `false' for production use.
Randolph Chung1e1d9d12000-12-07 03:56:10 +000047DODEBUG = false
Eric Andersen21943ce1999-10-13 18:04:51 +000048
Eric Andersen1d255be2000-07-19 17:33:54 +000049# 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=0x14f47d83,inter=100,log=logfile`
54# Do not enable this for production builds...
55DODMALLOC = false
56
Eric Andersen06070532001-04-04 19:32:00 +000057# Electric-fence is another very useful malloc debugging library.
Eric Andersen24073c72001-04-03 22:53:19 +000058# Do not enable this for production builds...
59DOEFENCE = false
60
Eric Andersen8a2e56c2000-09-21 02:23:30 +000061# If you want large file summit support, turn this on.
62# This has no effect if you don't have a kernel with lfs
63# support, and a system with libc-2.1.3 or later.
64# Some of the programs that can benefit from lfs support
65# are dd, gzip, mount, tar, and mkfs_minix.
66# LFS allows you to use the above programs for files
67# larger than 2GB!
68DOLFS = false
69
Eric Andersenbdfd0d72001-10-24 05:00:29 +000070# If you have a "pristine" source directory, point CONFIG_SRC_DIR to it.
Eric Andersen09a34e52000-12-01 19:40:18 +000071# Experimental and incomplete; tell the mailing list
72# <busybox@opensource.lineo.com> if you do or don't like it so far.
Eric Andersenbdfd0d72001-10-24 05:00:29 +000073CONFIG_SRC_DIR =
Eric Andersen8a2e56c2000-09-21 02:23:30 +000074
Eric Andersenbdfd0d72001-10-24 05:00:29 +000075# If you are running a cross compiler, you may want to set CROSS
76# to something more interesting, like "arm-linux-".
Eric Andersen20ea5c32000-11-29 22:08:35 +000077CROSS =
Eric Andersenbdfd0d72001-10-24 05:00:29 +000078CC = $(CROSS)gcc
79AR = $(CROSS)ar
80AS = $(CROSS)as
81LD = $(CROSS)ld
82NM = $(CROSS)nm
83STRIP = $(CROSS)strip
84CPP = $(CC) -E
85MAKEFILES = $(TOPDIR)/.config
86export VERSION BUILDTIME TOPDIR HOSTCC HOSTCFLAGS CROSS CC AR AS LD NM STRIP CPP
87
Eric Andersen1d255be2000-07-19 17:33:54 +000088
Eric Andersened3ef502001-01-27 08:24:39 +000089# To compile vs uClibc, just use the compiler wrapper built by uClibc...
Eric Andersen54eceff2001-08-20 17:48:17 +000090# Everything should compile and work as expected these days...
Eric Andersen74400cc2001-10-18 04:11:39 +000091#CC = /usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
Eric Andersened3ef502001-01-27 08:24:39 +000092
93# To compile vs some other alternative libc, you may need to use/adjust
94# the following lines to meet your needs...
Eric Andersen47cdcdd2001-03-05 17:08:52 +000095#
96# If you are using Red Hat 6.x with the compatible RPMs (for developing under
97# Red Hat 5.x and glibc 2.0) uncomment the following. Be sure to read about
98# using the compatible RPMs (compat-*) at http://www.redhat.com !
99#LIBCDIR=/usr/i386-glibc20-linux
100#
101# The following is used for libc5 (if you install altgcc and libc5-altdev
102# on a Debian system).
Mark Whitley4f76bb62001-02-27 19:53:48 +0000103#LIBCDIR=/usr/i486-linuxlibc1
Eric Andersen47cdcdd2001-03-05 17:08:52 +0000104#
105# For other libraries, you are on your own...
Eric Andersen28c88a92000-06-20 21:03:24 +0000106#LDFLAGS+=-nostdlib
Mark Whitley4f76bb62001-02-27 19:53:48 +0000107#LIBRARIES = $(LIBCDIR)/lib/libc.a -lgcc
Eric Andersen4d4b3b12000-12-12 23:23:32 +0000108#CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
109#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
Erik Andersen499f65f2000-05-16 20:07:38 +0000110
Erik Andersen3d427ac2000-05-12 19:38:40 +0000111# use '-Os' optimization if available, else use -O2
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000112OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null \
113 >/dev/null 2>&1; then echo "-Os"; else echo "-O2" ; fi}
Erik Andersenfac10d72000-02-07 05:29:42 +0000114
Eric Andersen74400cc2001-10-18 04:11:39 +0000115WARNINGS=-Wall -Wstrict-prototypes -Wshadow
Eric Andersenca38a292001-10-24 06:48:42 +0000116CFLAGS = -I $(TOPDIR)/include
Eric Andersenb183dfa2001-03-19 19:24:06 +0000117ARFLAGS = -r
118
Eric Andersen19f86202001-02-17 00:42:47 +0000119#
120#--------------------------------------------------------
121# If you're going to do a lot of builds with a non-vanilla configuration,
122# it makes sense to adjust parameters above, so you can type "make"
123# by itself, instead of following it by the same half-dozen overrides
124# every time. The stuff below, on the other hand, is probably less
125# prone to casual user adjustment.
126#
127
Mark Whitley76c5e602001-02-02 01:07:17 +0000128ifeq ($(strip $(DOLFS)),true)
Eric Andersen8a2e56c2000-09-21 02:23:30 +0000129 # For large file summit support
Eric Andersen5c721042001-10-02 07:58:23 +0000130 CFLAGS+=-D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64
Eric Andersen8a2e56c2000-09-21 02:23:30 +0000131endif
Mark Whitley76c5e602001-02-02 01:07:17 +0000132ifeq ($(strip $(DODMALLOC)),true)
Eric Andersen1d255be2000-07-19 17:33:54 +0000133 # For testing mem leaks with dmalloc
134 CFLAGS+=-DDMALLOC
135 LIBRARIES = -ldmalloc
136 # Force debug=true, since this is useless when not debugging...
137 DODEBUG = true
Eric Andersen24073c72001-04-03 22:53:19 +0000138else
139 ifeq ($(strip $(DOEFENCE)),true)
140 LIBRARIES = -lefence
141 # Force debug=true, since this is useless when not debugging...
142 DODEBUG = true
143 endif
Erik Andersen9ffdaa62000-02-11 21:55:04 +0000144endif
Mark Whitley76c5e602001-02-02 01:07:17 +0000145ifeq ($(strip $(DODEBUG)),true)
Eric Andersen9962cd92000-12-11 16:20:40 +0000146 CFLAGS += $(WARNINGS) -g -D_GNU_SOURCE
147 LDFLAGS += -Wl,-warn-common
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000148 STRIPCMD =
Eric Andersen17d49ef1999-10-06 20:25:32 +0000149else
Eric Andersen6cf47a72001-10-31 10:24:36 +0000150 CFLAGS += $(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer -mpreferred-stack-boundary=2 -D_GNU_SOURCE
Eric Andersen9962cd92000-12-11 16:20:40 +0000151 LDFLAGS += -s -Wl,-warn-common
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000152 STRIPCMD = $(STRIP) --remove-section=.note --remove-section=.comment $(PROG)
Eric Andersen2c1faec2000-09-21 22:26:02 +0000153endif
Mark Whitley76c5e602001-02-02 01:07:17 +0000154ifeq ($(strip $(DOSTATIC)),true)
Eric Andersen2c1faec2000-09-21 22:26:02 +0000155 LDFLAGS += --static
Eric Andersen17d49ef1999-10-06 20:25:32 +0000156endif
157
Eric Anderseneded54b1999-11-12 08:03:23 +0000158ifndef $(PREFIX)
Erik Andersenfac10d72000-02-07 05:29:42 +0000159 PREFIX = `pwd`/_install
Eric Andersen17d49ef1999-10-06 20:25:32 +0000160endif
Eric Andersen17d49ef1999-10-06 20:25:32 +0000161
Eric Andersen09a34e52000-12-01 19:40:18 +0000162# Additional complications due to support for pristine source dir.
Eric Andersen19f86202001-02-17 00:42:47 +0000163# Include files in the build directory should take precedence over
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000164# the copy in CONFIG_SRC_DIR, both during the compilation phase and the
Eric Andersen09a34e52000-12-01 19:40:18 +0000165# shell script that finds the list of object files.
Eric Andersen09a34e52000-12-01 19:40:18 +0000166# Work in progress by <ldoolitt@recycle.lbl.gov>.
Eric Andersen19f86202001-02-17 00:42:47 +0000167#
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000168ifneq ($(strip $(CONFIG_SRC_DIR)),)
169 VPATH = $(CONFIG_SRC_DIR)
Eric Andersen09a34e52000-12-01 19:40:18 +0000170endif
Eric Andersen19f86202001-02-17 00:42:47 +0000171
Eric Andersen04095e52001-04-25 05:39:18 +0000172OBJECTS = $(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
Eric Andersen93a8e2e2001-01-31 01:38:05 +0000173CFLAGS += $(CROSS_CFLAGS)
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000174ifdef CONFIG_INIT_SCRIPT
175 CFLAGS += -DINIT_SCRIPT='"$(CONFIG_INIT_SCRIPT)"'
Erik Andersend387d011999-12-21 02:55:11 +0000176endif
177
Eric Andersen0d5a08e2001-01-22 01:05:04 +0000178# Put user-supplied flags at the end, where they
179# have a chance of winning.
180CFLAGS += $(CFLAGS_EXTRA)
Eric Andersen624cc772000-09-21 02:04:51 +0000181
Eric Andersenab050f52001-01-27 06:01:43 +0000182.EXPORT_ALL_VARIABLES:
183
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000184all: do-it-all
Eric Andersen00814662001-04-26 23:29:10 +0000185
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000186#
187# Make "config" the default target if there is no configuration file or
188# "depend" the target if there is no top-level dependency information.
189ifeq (.config,$(wildcard .config))
190include .config
191ifeq (.depend,$(wildcard .depend))
192include .depend
193do-it-all: busybox busybox.links doc
194else
195CONFIGURATION = depend
196do-it-all: depend
197endif
198else
199CONFIGURATION = menuconfig
200do-it-all: menuconfig
201endif
Erik Andersen0a704e82000-05-03 03:19:06 +0000202
Eric Andersen3cd27602001-10-24 07:58:02 +0000203
Glenn L McGrath95ebf612001-10-25 14:18:08 +0000204SUBDIRS =applets archival archival/libunarchive console-tools editors \
205 fileutils findutils init miscutils modutils networking procps \
206 pwd_grp shell shellutils sysklogd textutils util-linux libbb
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000207
208bbsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
209
210$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/config/MARKER
211 $(MAKE) CFLAGS="$(CFLAGS)" -C $(patsubst _dir_%, %, $@)
212
Eric Andersen3cd27602001-10-24 07:58:02 +0000213busybox: config.h depend bbsubdirs
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000214 $(CC) $(LDFLAGS) -o $@ $(shell find $(SUBDIRS) -name \*.a) $(LIBCONFIG_LIB) $(LIBRARIES)
215 $(STRIPCMD)
216
217busybox.links: applets/busybox.mkll
218 - $(SHELL) $^ >$@
219
220install: applets/install.sh busybox busybox.links
221 $(SHELL) $< $(PREFIX)
222
223install-hardlinks: applets/install.sh busybox busybox.links
224 $(SHELL) $< $(PREFIX) --hardlinks
225
226
227# Documentation Targets
Eric Andersen67536ff2000-07-06 22:53:22 +0000228doc: olddoc
Eric Andersen53310252000-07-04 19:42:23 +0000229
230# Old Docs...
John Beppu94e50542001-04-05 19:42:03 +0000231olddoc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
232
Eric Andersen1552ff72001-10-31 11:07:12 +0000233docs/busybox.pod : docs/busybox_header.pod include/usage.h docs/busybox_footer.pod
John Beppu94e50542001-04-05 19:42:03 +0000234 - ( cat docs/busybox_header.pod; \
Eric Andersen1552ff72001-10-31 11:07:12 +0000235 docs/autodocifier.pl include/usage.h; \
John Beppu94e50542001-04-05 19:42:03 +0000236 cat docs/busybox_footer.pod ) > docs/busybox.pod
Eric Andersen53310252000-07-04 19:42:23 +0000237
Eric Andersen67536ff2000-07-06 22:53:22 +0000238docs/BusyBox.txt: docs/busybox.pod
Eric Andersen53310252000-07-04 19:42:23 +0000239 @echo
240 @echo BusyBox Documentation
241 @echo
Eric Andersen29be79c2000-12-01 22:57:44 +0000242 -mkdir -p docs
Eric Andersen19f86202001-02-17 00:42:47 +0000243 -pod2text $< > $@
Eric Andersen53310252000-07-04 19:42:23 +0000244
Eric Andersen67536ff2000-07-06 22:53:22 +0000245docs/BusyBox.1: docs/busybox.pod
Eric Andersen09a34e52000-12-01 19:40:18 +0000246 - mkdir -p docs
Eric Andersen29be79c2000-12-01 22:57:44 +0000247 - pod2man --center=BusyBox --release="version $(VERSION)" \
Eric Andersen19f86202001-02-17 00:42:47 +0000248 $< > $@
Eric Andersen53310252000-07-04 19:42:23 +0000249
Eric Andersen67536ff2000-07-06 22:53:22 +0000250docs/BusyBox.html: docs/busybox.lineo.com/BusyBox.html
Eric Andersen1cf81662001-02-17 15:55:15 +0000251 - mkdir -p docs
Eric Andersene2f6e122000-12-01 19:55:04 +0000252 -@ rm -f docs/BusyBox.html
Eric Andersenb8b8d812000-12-01 20:26:30 +0000253 -@ ln -s busybox.lineo.com/BusyBox.html docs/BusyBox.html
Eric Andersen53310252000-07-04 19:42:23 +0000254
Eric Andersen67536ff2000-07-06 22:53:22 +0000255docs/busybox.lineo.com/BusyBox.html: docs/busybox.pod
Eric Andersene2f6e122000-12-01 19:55:04 +0000256 -@ mkdir -p docs/busybox.lineo.com
Eric Andersen19f86202001-02-17 00:42:47 +0000257 - pod2html --noindex $< > \
Eric Andersen29be79c2000-12-01 22:57:44 +0000258 docs/busybox.lineo.com/BusyBox.html
Eric Andersen36763742001-04-24 21:46:07 +0000259 -@ rm -f pod2htm*
Erik Andersen0a704e82000-05-03 03:19:06 +0000260
Eric Andersen67536ff2000-07-06 22:53:22 +0000261
262# New docs based on DOCBOOK SGML
Eric Andersen488aac22000-09-24 02:42:48 +0000263newdoc: docs/busybox.txt docs/busybox.pdf docs/busybox/busyboxdocumentation.html
Eric Andersen67536ff2000-07-06 22:53:22 +0000264
265docs/busybox.txt: docs/busybox.sgml
266 @echo
267 @echo BusyBox Documentation
268 @echo
Eric Andersen09a34e52000-12-01 19:40:18 +0000269 - mkdir -p docs
Eric Andersen868c0572000-12-02 00:44:48 +0000270 (cd docs; sgmltools -b txt busybox.sgml)
Eric Andersen67536ff2000-07-06 22:53:22 +0000271
272docs/busybox.dvi: docs/busybox.sgml
Eric Andersen09a34e52000-12-01 19:40:18 +0000273 - mkdir -p docs
Eric Andersen868c0572000-12-02 00:44:48 +0000274 (cd docs; sgmltools -b dvi busybox.sgml)
Eric Andersen67536ff2000-07-06 22:53:22 +0000275
Eric Andersena2c83d82000-07-07 20:52:56 +0000276docs/busybox.ps: docs/busybox.sgml
Eric Andersen09a34e52000-12-01 19:40:18 +0000277 - mkdir -p docs
Eric Andersen868c0572000-12-02 00:44:48 +0000278 (cd docs; sgmltools -b ps busybox.sgml)
Eric Andersen67536ff2000-07-06 22:53:22 +0000279
Eric Andersena2c83d82000-07-07 20:52:56 +0000280docs/busybox.pdf: docs/busybox.ps
Eric Andersen09a34e52000-12-01 19:40:18 +0000281 - mkdir -p docs
Eric Andersen868c0572000-12-02 00:44:48 +0000282 (cd docs; ps2pdf busybox.ps)
Eric Andersen67536ff2000-07-06 22:53:22 +0000283
Eric Andersen488aac22000-09-24 02:42:48 +0000284docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
Eric Andersen09a34e52000-12-01 19:40:18 +0000285 - mkdir -p docs
Eric Andersen67536ff2000-07-06 22:53:22 +0000286 (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
287
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000288# The nifty new buildsystem stuff
289scripts/mkdep: scripts/mkdep.c
290 $(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
Eric Andersen67536ff2000-07-06 22:53:22 +0000291
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000292scripts/split-include: scripts/split-include.c
293 $(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
Erik Andersen1d1d9502000-04-21 01:26:49 +0000294
Eric Andersen3cd27602001-10-24 07:58:02 +0000295dep-files: scripts/mkdep
296 if [ ! -f .depend ] ; then \
297 rm -f .depend .hdepend; \
298 mkdir -p $(TOPDIR)/include/config; \
299 scripts/mkdep -I $(TOPDIR)/include -- \
300 `find $(TOPDIR) -name \*.c -print` >> .depend; \
301 scripts/mkdep -I $(TOPDIR)/include -- \
302 `find $(TOPDIR) -name \*.h -print` >> .hdepend; \
303 $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)" ; \
304 fi;
Eric Andersen1667fb41999-11-27 20:34:28 +0000305
Eric Andersen3cd27602001-10-24 07:58:02 +0000306
307depend dep: config.h dep-files
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000308 @ echo -e "\n\nNow run 'make' to build BusyBox\n\n"
309
310CONFIG_SHELL := ${shell if [ -x "$$BASH" ]; then echo $$BASH; \
311 else if [ -x /bin/bash ]; then echo /bin/bash; \
312 else echo sh; fi ; fi}
313
314include/config/MARKER: scripts/split-include include/config.h
315 scripts/split-include include/config.h include/config
316 @ touch include/config/MARKER
317
Eric Andersen3cd27602001-10-24 07:58:02 +0000318config.h:
319 @if [ ! -f include/config.h ] ; then \
320 make oldconfig; \
321 fi;
322
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000323menuconfig:
Eric Andersen3cd27602001-10-24 07:58:02 +0000324 mkdir -p $(TOPDIR)/include/config
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000325 $(MAKE) -C scripts/lxdialog all
326 $(CONFIG_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
327
328config:
Eric Andersen3cd27602001-10-24 07:58:02 +0000329 mkdir -p $(TOPDIR)/include/config
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000330 $(CONFIG_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
331
332oldconfig:
Eric Andersen3cd27602001-10-24 07:58:02 +0000333 mkdir -p $(TOPDIR)/include/config
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000334 $(CONFIG_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in
335
336
337ifdef CONFIGURATION
338..$(CONFIGURATION):
339 @echo
340 @echo "You have a bad or nonexistent" .$(CONFIGURATION) ": running 'make" $(CONFIGURATION)"'"
341 @echo
342 $(MAKE) $(CONFIGURATION)
343 @echo
344 @echo "Successful. Try re-making (ignore the error that follows)"
345 @echo
346 exit 1
347
348dummy:
349
Eric Andersen0b7d70c2001-08-02 20:56:16 +0000350else
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000351
352dummy:
353
Eric Andersen0b7d70c2001-08-02 20:56:16 +0000354endif
Eric Andersen19f86202001-02-17 00:42:47 +0000355
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000356include Rules.mak
Eric Andersen19f86202001-02-17 00:42:47 +0000357
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000358# Testing...
Erik Andersen9ffdaa62000-02-11 21:55:04 +0000359test tests:
Mark Whitleyd2117e92001-03-10 00:51:29 +0000360 # old way of doing it
361 #cd tests && $(MAKE) all
362 # new way of doing it
363 cd tests && ./tester.sh
Erik Andersen9ffdaa62000-02-11 21:55:04 +0000364
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000365# Cleanup
Eric Andersencc8ed391999-10-05 16:24:54 +0000366clean:
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000367 - $(MAKE) -C tests clean
368 - $(MAKE) -C scripts/lxdialog clean
Eric Andersen67536ff2000-07-06 22:53:22 +0000369 - rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
370 docs/busybox.lineo.com/BusyBox.html
Eric Andersen53310252000-07-04 19:42:23 +0000371 - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000372 docs/busybox.pdf docs/busybox.lineo.com/busybox.html \
373 docs/busybox _install pod2htm* *.gdb *.elf *~ core
374 - rm -f busybox.links libbb/loop.h .config.old .hdepend
375 - rm -f scripts/split-include scripts/mkdep .*config.log
376 - rm -rf include/config include/config.h
377 - find -name .\*.flags -o -name .depend -exec rm -f {} \;
Eric Andersena183f052001-02-20 06:22:54 +0000378 - find -name \*.o -exec rm -f {} \;
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000379 - find -name \*.a -exec rm -f {} \;
Eric Andersencc8ed391999-10-05 16:24:54 +0000380
381distclean: clean
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000382 - rm -f busybox
Erik Andersen9ffdaa62000-02-11 21:55:04 +0000383 - cd tests && $(MAKE) distclean
Eric Andersencc8ed391999-10-05 16:24:54 +0000384
Erik Andersen0a704e82000-05-03 03:19:06 +0000385dist release: distclean doc
Erik Andersenfac10d72000-02-07 05:29:42 +0000386 cd ..; \
387 rm -rf busybox-$(VERSION); \
388 cp -a busybox busybox-$(VERSION); \
389 \
390 find busybox-$(VERSION)/ -type d \
391 -name CVS \
392 -print \
Eric Andersen53b55ac2001-03-16 07:43:53 +0000393 -exec rm -rf {} \; ; \
Erik Andersenfac10d72000-02-07 05:29:42 +0000394 \
395 find busybox-$(VERSION)/ -type f \
Eric Andersenb0b732b2000-07-06 23:17:16 +0000396 -name .\#* \
397 -print \
Eric Andersen53b55ac2001-03-16 07:43:53 +0000398 -exec rm -f {} \; ; \
Eric Andersenb0b732b2000-07-06 23:17:16 +0000399 \
Erik Andersenfac10d72000-02-07 05:29:42 +0000400 tar -cvzf busybox-$(VERSION).tar.gz busybox-$(VERSION)/;
Mark Whitleydd23b8b2000-07-10 23:00:47 +0000401
Eric Andersenbdfd0d72001-10-24 05:00:29 +0000402
403
Eric Andersendefa4f92001-04-30 17:52:36 +0000404.PHONY: tags
Mark Whitleydd23b8b2000-07-10 23:00:47 +0000405tags:
406 ctags -R .