fffc52466ce57013128c2c9e03dd56f28fcf9903
[platform/upstream/busybox.git] / Makefile
1 # Makefile for busybox
2 #
3 # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4 #
5 # Licensed under GPLv2, see the file LICENSE in this tarball for details.
6 #
7
8 #--------------------------------------------------------------
9 # You shouldn't need to mess with anything beyond this point...
10 #--------------------------------------------------------------
11 noconfig_targets := menuconfig config oldconfig randconfig \
12         defconfig allyesconfig allnoconfig allbareconfig \
13         clean distclean \
14         release tags
15
16 # make-3.79.1 didn't support MAKEFILE_LIST
17 # for building out-of-tree, users of make-3.79 still have to pass top_srcdir=
18 # to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox
19 ifndef MAKEFILE_LIST
20 MAKEFILE_LIST=.
21 endif
22 # the toplevel sourcedir
23 ifndef top_srcdir
24 top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)
25 endif
26 # toplevel directory of the object-tree
27 ifndef top_builddir
28 top_builddir:=$(CURDIR)
29 endif
30
31 export srctree=$(top_srcdir)
32 vpath %/Config.in $(srctree)
33
34 DIRS:=applets archival archival/libunarchive coreutils console-tools \
35         debianutils editors findutils init miscutils modutils networking \
36         networking/libiproute networking/udhcp procps loginutils shell \
37         sysklogd util-linux e2fsprogs libpwdgrp coreutils/libcoreutils libbb
38
39 SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
40
41 # That's our default target when none is given on the command line
42 .PHONY: _all
43
44 _all: all
45
46 # see if we are in verbose mode
47 ifdef VERBOSE
48   CHECK_VERBOSE := -v
49   PACKAGE_BE_VERBOSE := $(VERBOSE)
50 endif
51 ifdef V
52   CHECK_VERBOSE := -v
53   PACKAGE_BE_VERBOSE := $(V)
54 endif
55
56 ifdef O
57   ifeq ("$(origin O)", "command line")
58     PACKAGE_OUTPUTDIR := $(shell cd $(O) && pwd)
59     top_builddir := $(PACKAGE_OUTPUTDIR)
60   endif
61 else
62 # If no alternate output-dir was specified, we build in cwd
63   PACKAGE_OUTPUTDIR := $(top_builddir)
64 endif
65
66 #######################################################################
67 # Try to workaround bugs in make
68
69 # make-3.79.1 didn't understand order-only prerequisites ('|').
70 # Just treat them as normal prerequisites. Note that this will lead to
71 # spurious rebuilds.
72 ifeq ($(MAKE_VERSION),3.79.1)
73 |: ;
74 endif
75
76 # Workaround for bugs in make-3.80
77 # eval is broken if it is in a conditional
78
79 #$ cat 3.80-eval-in-cond.mak 
80 #all:: ; @echo it
81 #define Y
82 #  all:: ; @echo worked
83 #endef
84 #ifdef BAR
85 #$(eval $(Y))
86 #endif
87 #$ make -f 3.80-eval-in-cond.mak
88 #it
89 #$ make -f 3.80-eval-in-cond.mak BAR=set
90 #3.80-eval-in-cond.mak:5: *** missing `endif'.  Stop.
91
92 # This was fixed in December 2003.
93 define check_gcc
94 $(eval $(1)+=$(if $(2),$(if $(shell $(CC) $(2) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo y),$(2),$(if $(3),$(3))),$(if $(3),$(3))))
95 endef
96
97 define check_ld
98 $(eval $(1)+=$(if $(2),$(if $(shell $(LD) $(2) -o /dev/null -b binary /dev/null > /dev/null 2>&1 && echo y),$(shell echo \-Wl,$(2)),$(if $(3),$(3))),$(if $(3),$(3))))
99 endef
100
101 #######################################################################
102
103 -include $(top_srcdir)/Rules.mak
104
105 # Handle building out of tree
106 ifneq ($(top_builddir),$(top_srcdir))
107 all_tree := $(patsubst %,$(top_builddir)/%,$(DIRS) scripts scripts/config include include/config)
108 $(all_tree):
109         @mkdir -p "$@"
110
111 saved-output := $(PACKAGE_OUTPUTDIR)
112
113 $(if $(wildcard $(PACKAGE_OUTPUTDIR)),, \
114      $(error output directory "$(saved-output)" does not exist))
115
116 .PHONY: $(filter $(noconfig_targets),$(MAKECMDGOALS))
117
118 $(PACKAGE_OUTPUTDIR)/Rules.mak:
119         @echo > $@
120         @echo top_srcdir=$(top_srcdir) >> $@
121         @echo top_builddir=$(PACKAGE_OUTPUTDIR) >> $@
122         @echo include $$\(top_srcdir\)/Rules.mak >> $@
123
124 $(PACKAGE_OUTPUTDIR)/Makefile:
125         @echo > $@
126         @echo top_srcdir=$(top_srcdir) >> $@
127         @echo top_builddir=$(PACKAGE_OUTPUTDIR) >> $@
128         @echo PACKAGE_SOURCEDIR='$$(top_srcdir)' >> $@
129         @echo include '$$(PACKAGE_SOURCEDIR)'/Makefile >> $@
130
131
132 buildtree := $(all_tree) $(PACKAGE_OUTPUTDIR)/Rules.mak $(PACKAGE_OUTPUTDIR)/Makefile
133
134 # We only need a copy of the Makefile for the config targets and reuse
135 # the rest from the source directory, i.e. we do not cp ALL_MAKEFILES.
136 scripts/config/Makefile: $(top_srcdir)/scripts/config/Makefile | $(buildtree)
137         @cp $(top_srcdir)/scripts/config/Makefile $@
138
139 else
140 all_tree := include/config
141 $(all_tree):
142         @mkdir -p "$@"
143 buildtree := $(all_tree)
144 endif # ifneq ($(PACKAGE_OUTPUTDIR),$(top_srcdir))
145
146 help:
147         @echo 'Cleaning:'
148         @echo '  clean                  - delete temporary files created by build'
149         @echo '  distclean              - delete all non-source files (including .config)'
150         @echo
151         @echo 'Build:'
152         @echo '  all                    - Executable and documentation'
153         @echo '  busybox                - the swiss-army executable'
154         @echo '  doc                    - docs/BusyBox.{txt,html,1}'
155         @echo
156         @echo 'Configuration:'
157         @echo '  allnoconfig            - disable all symbols in .config'
158         @echo '  allyesconfig           - enable all symbols in .config (see defconfig)'
159         @echo '  allbareconfig          - enable all applets without any sub-features'
160         @echo '  config         - text based configurator (of last resort)'
161         @echo '  defconfig              - set .config to largest generic configuration'
162         @echo '  menuconfig             - interactive curses-based configurator'
163         @echo '  oldconfig              - resolve any unresolved symbols in .config'
164         @echo
165         @echo 'Installation:'
166         @echo '  install                - install busybox into $prefix'
167         @echo '  uninstall'
168         @echo
169         @echo 'Development:'
170         @echo '  check                  - run the test suite for all applets'
171         @echo '  randconfig             - generate a random configuration'
172         @echo '  release                - create a distribution tarball'
173         @echo '  sizes                  - show size of all enabled busybox symbols'
174         @echo
175         @echo 'Make flags:'
176         @echo '  V=<number>             - print verbose make output (default: unset)'
177         @echo '                           0 print CC invocations'
178         @echo '                           1'
179         @echo '                           2 also print when make enters a directory'
180         @echo '                           3 also verbosely print shell invocations'
181
182 ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
183 # Default target if none was requested explicitly
184 all: defconfig menuconfig ;
185
186 ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
187 # warn if no configuration exists and we are asked to build a non-config target
188 .config:
189         @echo ""
190         @echo "No $(top_builddir)/$@ found!"
191         @echo "Please refer to 'make help', section Configuration."
192         @echo ""
193         @exit 1
194 else
195 # Avoid implicit rule to kick in by using an empty command
196 .config: $(buildtree) ;
197 endif
198 endif # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
199
200
201 # configuration
202 # ---------------------------------------------------------------------------
203
204 CONFIG_CONFIG_IN = $(top_srcdir)/Config.in
205
206 scripts/config/conf: scripts/config/Makefile
207         $(Q)$(MAKE) -C scripts/config conf
208
209 scripts/config/mconf: scripts/config/Makefile
210         $(Q)$(MAKE) -C scripts/config ncurses conf mconf
211
212 menuconfig: scripts/config/mconf
213         @./scripts/config/mconf $(CONFIG_CONFIG_IN)
214
215 config: scripts/config/conf
216         @./scripts/config/conf $(CONFIG_CONFIG_IN)
217
218 oldconfig: scripts/config/conf
219         @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
220
221 randconfig: scripts/config/conf
222         @./scripts/config/conf -r $(CONFIG_CONFIG_IN)
223
224 allyesconfig: scripts/config/conf
225         @./scripts/config/conf -y $(CONFIG_CONFIG_IN)
226         @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER)=.*/# \1 is not set/" .config
227         @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
228
229 allnoconfig: scripts/config/conf
230         @./scripts/config/conf -n $(CONFIG_CONFIG_IN)
231
232 # defconfig is allyesconfig minus any features that are specialized enough
233 # or cause enough behavior change that the user really should switch them on
234 # manually if that's what they want.  Sort of "maximum sane config".
235
236 defconfig: scripts/config/conf
237         @./scripts/config/conf -y $(CONFIG_CONFIG_IN)
238         @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG.*|STATIC|SELINUX|BUILD_(AT_ONCE|LIBBUSYBOX)|FEATURE_(DEVFS|FULL_LIBBUSYBOX|SHARED_BUSYBOX|MTAB_SUPPORT|CLEAN_UP|UDHCP_DEBUG)|INSTALL_NO_USR))=.*/# \1 is not set/" .config
239         @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
240
241 allbareconfig: scripts/config/conf
242         @./scripts/config/conf -y $(CONFIG_CONFIG_IN)
243         @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config
244         @$(SED) -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config
245         @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config
246         @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
247
248 ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
249
250 # Load all Config.in
251 -include $(top_builddir)/.config.cmd
252
253 endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
254
255 # convert $(DIRS) to upper case. Use sed instead of tr since we're already
256 # depending on it.
257 DIRS_UPPER:=$(shell echo $(DIRS) | $(SED) 'h;y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/')
258
259 # First populate the variables ..._OBJ-y et al
260 $(foreach d,$(DIRS_UPPER),$(eval $(notdir $(d))-y:=))
261
262 include $(patsubst %,%/Makefile.in,$(SRC_DIRS))
263
264 # Then we need the dependencies for ..._OBJ
265 define dir_pattern.o
266 ifeq ($(os),.os)
267 $(if $($(1)_OBJ.os),$($(1)_OBJ.os:.os=.o): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c)
268 endif
269 $(if $($(1)_OBJ$(os)),$($(1)_OBJ$(os)): $(top_builddir)/$(2)/%$(os): $(top_srcdir)/$(2)/%.c)
270 $(if $($(1)_OBJ),$($(1)_OBJ): $(top_builddir)/$(2)/%.o: $(top_srcdir)/$(2)/%.c)
271 endef
272
273 # The actual directory patterns for .o*
274 $(foreach d,$(DIRS),$(eval $(call dir_pattern.o,$(subst /,_,$(d)),$(d))))
275
276 define file_lists
277 $($(1)$(2)) $($(1)$(2).o) $($(1)$(2).os)
278 endef
279 bin-obj-y:=$(subst .os,.o,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_OBJ)))
280 bin-mobj-y:=$(subst .osm,.om,$(foreach d,$(DIRS),$(call file_lists,$(subst /,_,$(d)),_MOBJ)))
281
282 ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
283 # Finally pull in the dependencies (headers and other includes) of the
284 # individual object files
285 -include $(top_builddir)/.depend
286
287 $(top_builddir)/applets/applets.o: $(top_builddir)/.config
288 # Everything is set.
289
290 all: busybox busybox.links doc ;
291
292 # Two modes of operation: legacy and IMA
293 # Legacy mode builds each object through an individual invocation of CC
294 # IMA compiles all sources at once (aka IPO aka IPA etc.)
295
296 ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
297 # We are not building .o
298 bin-obj-y:=
299 bin-mobj-y:=
300 # Which parts of the internal libs are requested?
301 # Per default we only want what was actually selected.
302 # -a denotes all while -y denotes the selected ones.
303 ifeq ($(strip $(CONFIG_FEATURE_FULL_LIBBUSYBOX)),y)
304 LIBRARY_DEFINE:=$(LIBRARY_DEFINE-a)
305 LIBRARY_SRC   :=$(LIBRARY_SRC-a)
306 else # CONFIG_FEATURE_FULL_LIBBUSYBOX
307 LIBRARY_DEFINE:=$(LIBRARY_DEFINE-y)
308 LIBRARY_SRC   :=$(LIBRARY_SRC-y)
309 endif # CONFIG_FEATURE_FULL_LIBBUSYBOX
310 APPLET_SRC:=$(APPLET_SRC-y)
311 APPLETS_DEFINE:=$(APPLETS_DEFINE-y)
312 else  # CONFIG_BUILD_AT_ONCE
313 # no --combine, build archives out of the individual .o
314 # This was the old way the binary was built.
315 libbusybox-obj:=$(archival_libunarchive_OBJ$(os)) \
316         $(networking_libiproute_OBJ$(os)) \
317         $(libpwdgrp_MOBJ$(os)) \
318         $(coreutils_libcoreutils_OBJ$(os)) \
319         $(libbb_OBJ$(os)) $(libbb_MOBJ$(os))
320
321 ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
322 # linking against libbusybox, so don't build the .o already contained in the .so
323 bin-obj-y:=$(filter-out $(libbusybox-obj) $(libbusybox-obj:.os=.o),$(bin-obj-y))
324 bin-mobj-y:=$(filter-out $(libbusybox-obj) $(libbusybox-obj:.osm=.om),$(bin-mobj-y))
325 endif # CONFIG_FEATURE_SHARED_BUSYBOX
326 endif # CONFIG_BUILD_AT_ONCE
327
328 # build an .a to keep .hash et al small
329 ifneq ($(bin-obj-y)$(bin-mobj-y),)
330   applets.a:=$(bin-obj-y) $(bin-mobj-y)
331 endif
332 ifdef applets.a
333 applets.a: $(applets.a)
334         $(Q)-rm -f $(@)
335         $(do_ar)
336
337 bin-obj.a=applets.a
338 endif
339
340 ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
341 LD_LIBBUSYBOX:=libbusybox.so
342 LIBBUSYBOX_SONAME:=$(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL_VERSION)
343 DO_INSTALL_LIBS:=$(LD_LIBBUSYBOX) \
344         $(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
345         $(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION)
346
347 endif # CONFIG_BUILD_LIBBUSYBOX
348
349 ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y)
350 ifneq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
351 # --combine but not linking against libbusybox, so compile lib*.c
352 BUSYBOX_SRC   := $(LIBRARY_SRC)
353 BUSYBOX_DEFINE:= $(LIBRARY_DEFINE)
354 endif # !CONFIG_FEATURE_SHARED_BUSYBOX
355 $(LIBBUSYBOX_SONAME): $(LIBRARY_SRC)
356 else # CONFIG_BUILD_AT_ONCE
357 $(LIBBUSYBOX_SONAME): $(libbusybox-obj)
358 endif # CONFIG_BUILD_AT_ONCE
359
360
361 ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y)
362 LDBUSYBOX:=-L$(top_builddir) -lbusybox
363 endif
364
365 ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
366 $(LIBBUSYBOX_SONAME):
367 ifndef MAJOR_VERSION
368         $(error MAJOR_VERSION needed for $@ is not defined)
369 endif
370         $(do_link) $(LIB_CFLAGS) $(LIB_LDFLAGS) $(CFLAGS_COMBINE) \
371         -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \
372         -Wl,-z,combreloc $(LIB_LDFLAGS) \
373         -o $(@) \
374         -Wl,--start-group \
375         $(LIBRARY_DEFINE) $(^) \
376         -Wl,--end-group
377         @rm -f $(DO_INSTALL_LIBS)
378         @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done
379         $(do_strip)
380
381 endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
382
383 busybox_unstripped: $(top_builddir)/.depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(bin-obj.a)
384         $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \
385         $(foreach f,$(^:.o=.c),$(CFLAGS-$(notdir $(patsubst %/$,%,$(dir $(f))))-$(notdir $(f)))) \
386         $(CFLAGS-$(@)) \
387         -o $@ -Wl,--start-group \
388         $(APPLETS_DEFINE) $(APPLET_SRC) \
389         $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) \
390         $(bin-obj.a) \
391         $(LDBUSYBOX) $(LIBRARIES) \
392         -Wl,--end-group
393
394 busybox: busybox_unstripped
395         $(Q)cp busybox_unstripped busybox
396         $(do_strip)
397
398 busybox.links: $(top_srcdir)/applets/busybox.mkll include/bb_config.h $(top_srcdir)/include/applets.h
399         $(Q)-$(SHELL) $^ >$@
400
401 install: $(top_srcdir)/applets/install.sh busybox busybox.links
402         $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
403                 $(SHELL) $< $(PREFIX) $(INSTALL_OPTS)
404 ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
405         @echo
406         @echo
407         @echo --------------------------------------------------
408         @echo You will probably need to make your busybox binary
409         @echo setuid root to ensure all configured applets will
410         @echo work properly.
411         @echo --------------------------------------------------
412         @echo
413 endif
414
415 uninstall: busybox.links
416         rm -f $(PREFIX)/bin/busybox
417         for i in `cat busybox.links` ; do rm -f $(PREFIX)$$i; done
418 ifneq ($(strip $(DO_INSTALL_LIBS)),n)
419         for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
420                 rm -f $(PREFIX)$$i; \
421         done
422 endif
423
424 check test: busybox
425         bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
426         $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE)
427
428 sizes: busybox_unstripped
429         $(NM) --size-sort $(<)
430
431 # Documentation Targets
432 doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html ;
433
434 docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/usage.h $(top_srcdir)/docs/busybox_footer.pod $(top_srcdir)/docs/autodocifier.pl
435         $(disp_doc)
436         $(Q)-mkdir -p docs
437         $(Q)-( cat $(top_srcdir)/docs/busybox_header.pod ; \
438             $(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h ; \
439             cat $(top_srcdir)/docs/busybox_footer.pod ; ) > docs/busybox.pod
440
441 docs/BusyBox.txt: docs/busybox.pod
442         $(disp_doc)
443         $(Q)-mkdir -p docs
444         $(Q)-pod2text $< > $@
445
446 docs/BusyBox.1: docs/busybox.pod
447         $(disp_doc)
448         $(Q)-mkdir -p docs
449         $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
450                 $< > $@
451
452 docs/BusyBox.html: docs/busybox.net/BusyBox.html
453         $(disp_doc)
454         $(Q)-mkdir -p docs
455         $(Q)-rm -f docs/BusyBox.html
456         $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
457
458 docs/busybox.net/BusyBox.html: docs/busybox.pod
459         $(Q)-mkdir -p docs/busybox.net
460         $(Q)-pod2html --noindex $< > \
461             docs/busybox.net/BusyBox.html
462         $(Q)-rm -f pod2htm*
463
464 # The nifty new dependency stuff
465 scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
466         $(do_link.h)
467
468 DEP_INCLUDES := include/bb_config.h
469
470 ifeq ($(strip $(CONFIG_BBCONFIG)),y)
471 DEP_INCLUDES += include/bbconfigopts.h
472
473 include/bbconfigopts.h: .config
474         $(disp_gen)
475         $(Q)$(top_srcdir)/scripts/config/mkconfigs > $@
476 endif
477
478 depend dep: $(top_builddir)/.depend ;
479 $(top_builddir)/.depend: $(buildtree) scripts/bb_mkdep $(DEP_INCLUDES)
480         $(disp_gen)
481         $(Q)rm -f .depend
482         $(Q)scripts/bb_mkdep $(MKDEP_ARGS) \
483                 -I $(top_srcdir)/include $(top_srcdir) > $@.tmp
484         $(Q)mv $@.tmp $@
485
486 include/bb_config.h: .config
487         $(disp_gen)
488         @$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
489
490 endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
491
492 clean:
493         - rm -f docs/busybox.dvi docs/busybox.ps \
494             docs/busybox.pod docs/busybox.net/busybox.html \
495             docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
496             docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
497             docs/busybox.net/BusyBox.html busybox.links \
498             libbusybox.so* \
499             .config.old busybox busybox_unstripped
500         - rm -r -f _install testsuite/links
501         - find . -name .\*.flags -exec rm -f {} \;
502         - find . -name \*.o -exec rm -f {} \;
503         - find . -name \*.om -exec rm -f {} \;
504         - find . -name \*.os -exec rm -f {} \;
505         - find . -name \*.osm -exec rm -f {} \;
506         - find . -name \*.a -exec rm -f {} \;
507
508 distclean: clean
509         - $(MAKE) -C scripts/config clean
510         - rm -f scripts/bb_mkdep
511         - rm -r -f include/config $(DEP_INCLUDES)
512         - find . -name .depend'*' -exec rm -f {} \;
513         rm -f .config .config.old .config.cmd
514
515 release: distclean #doc
516         cd ..; \
517         rm -r -f $(PROG)-$(VERSION); \
518         cp -a busybox $(PROG)-$(VERSION); \
519         \
520         find $(PROG)-$(VERSION)/ -type d \
521                 -name .svn \
522                 -print \
523                 -exec rm -r -f {} \; ; \
524         \
525         find $(PROG)-$(VERSION)/ -type f \
526                 -name .\#* \
527                 -print \
528                 -exec rm -f {} \; ; \
529         \
530         tar -cvzf $(PROG)-$(VERSION).tar.gz $(PROG)-$(VERSION)/;
531
532 tags:
533         ctags -R .
534
535 # keep these in sync with noconfig_targets above!
536 .PHONY: dummy subdirs check test depend dep buildtree \
537         menuconfig config oldconfig randconfig \
538         defconfig allyesconfig allnoconfig allbareconfig \
539         clean distclean \
540         release tags