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