2.3.6: will be tagged as "sbcl-2.3.6"
[sbcl.git] / clean.sh
blob3b1f51d32602a5d26f59d89fa62697e1d674c402
1 #!/bin/sh
2 set -e
4 # Remove everything in directories which are only used for output.
5 # In most cases, we can remove the directories, too.
7 # Preserving the skeletons of some directories might or might not not be relevant.
8 # The supposed explanation definitely no longer holds - there is no "src/c-runtime/sbcl.h"
9 # as a symlink into "output/". The sbcl.h file is a plain file, and it's been that way
10 # for quite some time.
11 rm -rf obj/* output/* src/runtime/genesis/ src/runtime/sbcl.mk src/runtime/*.dSYM
13 # Ensure that we know GNUMAKE.
14 . ./find-gnumake.sh
15 find_gnumake
17 # Ask some other directories to clean themselves up.
18 original_pwd=`pwd`
19 for d in tools-for-build; do
20 cd ./$d > /dev/null
21 # I hope the -s option is standard. At least GNU make and BSD make
22 # support it. It silences make, since otherwise the output from
23 # this script is just the operations done by these make's, which
24 # is misleading when this script does lots of other operations too.
25 # -- WHN
26 $GNUMAKE -I ../src/runtime -s clean
27 cd "$original_pwd" > /dev/null
28 done
29 ( cd ./doc && sh ./clean.sh )
31 # Within all directories, remove things which don't look like source
32 # files. Some explanations:
33 # sbcl
34 # the runtime environment, created by compiling C code
35 # sbcl.h
36 # information about Lisp code needed to build the runtime environment,
37 # created by running GENESIS
38 # Config, target
39 # architecture-dependent or OS-dependent symlinks
40 # core
41 # probably a Unix core dump -- not part of the sources anyway
42 # *.o, *.so, *.lib, *.nm, a.out
43 # results of C-style linking, assembling, etc.
44 # *.core, *.map
45 # looks like SBCL SAVE-LISP-AND-DIE or GENESIS output, and
46 # certainly not source
47 # *~, #*#
48 # common names for editor temporary files
49 # TAGS, tags
50 # files created by GNU etags and ctags
51 # .#*, *.orig, .*.orig, *.rej
52 # rubbish left behind by CVS updates
53 # *.htm, *.html
54 # The system doc sources are mostly texinfo, plus various odds
55 # and ends like docstrings embedded in .lisp sources; any HTML is
56 # automatically-generated output.
57 # depend, *.d
58 # made by "make depend" (or "gmake depend" or some such thing)
59 # *.lisp-obj, *.fasl, *.x86f, *.axpf, *.lbytef, *.lib
60 # typical extensions for fasl files (not just from SBCL, but
61 # from other Lisp systems which might be used as xc hosts)
62 # *.tmp, *.lisp-temp
63 # conventional names for temporary files autogenerated in
64 # building or testing
65 find . \( \
66 -name _darcs -o \
67 -name '{arch}' -o \
68 -name CVS -o \
69 -name .hg -o \
70 -name .git -o \
71 -name .svn -o \
72 -name android-libs \) -type d -prune -o \
73 \( \
74 \( -type l -path ./src/runtime/\* \) -o \
75 -name '*~' -o \
76 -name '#*#' -o \
77 -name '.#*' -o \
78 -name '*.orig' -o \
79 -name '.*.orig' -o \
80 -name '*.rej' -o \
81 -name '?*.x86f' -o \
82 -name '?*.axpf' -o \
83 -name '?*.lbytef' -o \
84 -name '?*.fasl' -o \
85 -name '?*.FASL' -o \
86 -name 'core' -o \
87 -name '?*.core' -o \
88 -name '*.map' -o \
89 -name '*.host-obj' -o \
90 -name '*.lisp-obj' -o \
91 -name '*.target-obj' -o \
92 -name '*.lib' -o \
93 -name '*.tmp' -o \
94 -name '*.lisp-temp' -o \
95 -name '*.o' -o \
96 -name '*.so' -o \
97 -name '*.d' -o \
98 -name 'foo.c' -o \
99 -name 'test-lab' -o \
100 -name 'encodings.texi-temp' -o \
101 -name 'stack-alignment-offset' -o \
102 -name 'test-status.lisp-expr' -o \
103 -name 'last-random-state.lisp-expr' -o \
104 -name 'test.log' -o \
105 -name 'whitespace-stamp' -o \
106 -name 'a.out' -o \
107 -name 'sbcl' -o \
108 -name 'sbcl.h' -o \
109 -name 'ppc-linux-mcontext.h' -o \
110 -name 'depend' -o \
111 -name 'TAGS' -o \
112 -name 'tags' -o \
113 -name 'local-target-features.lisp-expr' \) -print | xargs rm -fr