4 # Remove everything in directories which are only used for output.
5 # In most cases, we can remove the directories, too.
7 # (We don't remove all the directories themselves for a stupid technical
8 # reason: "gmake clean" in the src/runtime directory gets unhappy if the
9 # output/ directory doesn't exist, because it tries to build Depends
10 # before it cleans itself, and src/c-runtime/sbcl.h is a symlink into
11 # the output/ directory, and it gets the gcc dependency processing gets
12 # all confused trying to figure out a header file which is a symlink
13 # into a directory which doesn't exist. We'd like to be able to run
14 # this script (including "gmake clean" in the src/runtime directory)
15 # several times in a row without failure.. so we leave the output/
16 # directory in place.)
17 rm -rf obj/* output/* src/runtime/genesis/
19 # Ensure that we know GNUMAKE.
23 # Ask some other directories to clean themselves up.
25 for d in tools-for-build; do
27 # I hope the -s option is standard. At least GNU make and BSD make
28 # support it. It silences make, since otherwise the output from
29 # this script is just the operations done by these make's, which
30 # is misleading when this script does lotso other operations too.
32 $GNUMAKE -I ../src/runtime -s clean
33 cd "$original_pwd" > /dev/null
35 ( cd ./doc ; sh ./clean.sh )
37 # Within all directories, remove things which don't look like source
38 # files. Some explanations:
40 # are never in the sources, so must've been created
42 # the runtime environment, created by compiling C code
44 # information about Lisp code needed to build the runtime environment,
45 # created by running GENESIS
47 # architecture-dependent or OS-dependent symlinks
49 # probably a Unix core dump -- not part of the sources anyway
50 # *.o, *.so, *.lib, *.nm, a.out
51 # results of C-style linking, assembling, etc.
53 # looks like SBCL SAVE-LISP-AND-DIE or GENESIS output, and
54 # certainly not source
56 # common names for editor temporary files
58 # files created by GNU etags and ctags
59 # .#*, *.orig, .*.orig, *.rej
60 # rubbish left behind by CVS updates
62 # The system doc sources are mostly texinfo, plus various odds
63 # and ends like docstrings embedded in .lisp sources; any HTML is
64 # automatically-generated output.
66 # made by "make depend" (or "gmake depend" or some such thing)
67 # *.lisp-obj, *.fasl, *.x86f, *.axpf, *.lbytef, *.lib
68 # typical extensions for fasl files (not just from SBCL, but
69 # from other Lisp systems which might be used as xc hosts)
71 # conventional names for temporary files autogenerated in
74 # generated by automatic directory-test-thyself procedure
81 -name .svn \) -type d -prune -o \
92 -name '?*.lbytef' -o \
99 -name '*.host-obj' -o \
100 -name '*.lisp-obj' -o \
101 -name '*.target-obj' -o \
104 -name '*.lisp-temp' -o \
109 -name 'test-output' -o \
110 -name 'test-lab' -o \
111 -name 'encodings.texi-temp' -o \
112 -name 'stack-alignment-offset' -o \
113 -name 'test-status.lisp-expr' -o \
120 -name 'test-passed' -o \
121 -name 'ldso-stubs.S' -o \
122 -name 'local-target-features.lisp-expr' \) -print | xargs rm -fr