0.8.2.28:
[sbcl/lichteblau.git] / clean.sh
blobc2bf8adc83ee026c87bd4c823e0d1675517fb649
1 #!/bin/sh
3 # Remove everything in directories which are only used for output.
4 # In most cases, we can remove the directories, too.
6 # (We don't remove all the directories themselves for a stupid technical
7 # reason: "gmake clean" in the src/runtime directory gets unhappy if the
8 # output/ directory doesn't exist, because it tries to build Depends
9 # before it cleans itself, and src/c-runtime/sbcl.h is a symlink into
10 # the output/ directory, and it gets the gcc dependency processing gets
11 # all confused trying to figure out a header file which is a symlink
12 # into a directory which doesn't exist. We'd like to be able to run
13 # this script (including "gmake clean" in the src/runtime directory)
14 # several times in a row without failure.. so we leave the output/
15 # directory in place.)
16 rm -rf obj/* output/* doc/user-manual \
17 doc/user-manual.junk doc/DBTOHTML_OUTPUT_DIR*
18 # (The doc/user-manual.junk and doc/DBTOHTML_OUTPUT_DIR* directories
19 # are created by the Cygnus db2html script when it formats the the
20 # user manual, and since this db2html script is the one which is
21 # currently used to format the manual for the standard binary
22 # distribution, we automatically clean up after it here in the
23 # standard clean.sh file.)
25 # Ask some other directories to clean themselves up.
26 original_pwd=`pwd`
27 for d in tools-for-build; do
28 cd $d > /dev/null
29 # I hope the -s option is standard. At least GNU make and BSD make
30 # support it. It silences make, since otherwise the output from
31 # this script is just the operations done by these make's, which
32 # is misleading when this script does lotso other operations too.
33 # -- WHN
34 make -s clean
35 cd $original_pwd > /dev/null
36 done
38 # Within all directories, remove things which don't look like source
39 # files. Some explanations:
40 # (symlinks)
41 # are never in the sources, so must've been created
42 # sbcl
43 # the runtime environment, created by compiling C code
44 # sbcl.h
45 # information about Lisp code needed to build the runtime environment,
46 # created by running GENESIS
47 # Config, target
48 # architecture-dependent or OS-dependent symlinks
49 # *.htm, *.html
50 # probably machine-generated translation of DocBook (*.sgml) files
51 # core
52 # probably a Unix core dump -- not part of the sources anyway
53 # *.o, *.lib, *.nm, a.out
54 # results of C-style linking, assembling, etc.
55 # *.core, *.map
56 # looks like SBCL SAVE-LISP-AND-DIE or GENESIS output, and
57 # certainly not source
58 # *~, #*#
59 # common names for editor temporary files
60 # TAGS, tags
61 # files created by GNU etags and ctags
62 # .#*, *.orig, .*.orig, *.rej
63 # rubbish left behind by CVS updates
64 # *.htm, *.html
65 # The system doc sources are SGML, any HTML is
66 # automatically-generated output.
67 # depend
68 # made by "make depend" (or "gmake depend" or some such thing)
69 # *.lisp-obj, *.fasl, *.x86f, *.axpf, *.lbytef, *.lib
70 # typical extensions for fasl files (not just from SBCL, but
71 # from other Lisp systems which might be used as xc hosts)
72 # test-passed
73 # generated by automatic directory-test-thyself procedure
74 find . \( \
75 -type l -o \
76 -name '*~' -o \
77 -name '#*#' -o \
78 -name '.#*' -o \
79 -name '*.orig' -o \
80 -name '.*.orig' -o \
81 -name '*.rej' -o \
82 -name '?*.x86f' -o \
83 -name '?*.axpf' -o \
84 -name '?*.lbytef' -o \
85 -name '?*.fasl' -o \
86 -name 'core' -o \
87 -name '?*.core' -o \
88 -name '*.map' -o \
89 -name '*.nm' -o \
90 -name '*.host-obj' -o \
91 -name '*.lisp-obj' -o \
92 -name '*.target-obj' -o \
93 -name '*.lib' -o \
94 -name '*.tmp' -o \
95 -name '*.lisp-temp' -o \
96 -name '*.o' -o \
97 -name 'a.out' -o \
98 -name 'sbcl' -o \
99 -name 'sbcl.h' -o \
100 -name 'depend' -o \
101 -name 'TAGS' -o \
102 -name 'tags' -o \
103 -name 'test-passed' -o \
104 -name 'local-target-features.lisp-expr' \) -print | xargs rm -f
106 cd doc && sh ./clean.sh