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