0.6.12.3:
[sbcl.git] / clean.sh
1 #!/bin/sh
2
3 # Remove everything in directories which are only used for output.
4 # In most cases, we can remove the directories, too.
5 #
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.)
24
25 # Within other directories, remove things which don't look like source
26 # files. Some explanations:
27 #   (symlinks)
28 #     are never in the sources; they must've been created
29 #   sbcl
30 #     the runtime environment, created by compiling C code
31 #   sbcl.h 
32 #     information about Lisp code needed to build the runtime environment,
33 #     created by running GENESIS
34 #   Config, target
35 #     architecture-dependent or OS-dependent symlinks
36 #   *.htm, *.html
37 #     probably machine-generated translation of DocBook (*.sgml) files
38 #   core
39 #     probably a core dump -- not part of the sources anyway
40 #   *~, #*#, TAGS
41 #     common names for editor temporary files
42 find . \( \
43         -type l -or \
44         -name '*~' -or \
45         -name '#*#' -or \
46         -name '?*.x86f' -or \
47         -name '?*.axpf' -or \
48         -name '?*.lbytef' -or \
49         -name 'core' -or \
50         -name '?*.core' -or \
51         -name '*.map' -or \
52         -name '*.nm' -or \
53         -name '*.host-obj' -or \
54         -name '*.lisp-obj' -or \
55         -name '*.target-obj' -or \
56         -name '*.lib' -or \
57         -name '*.tmp' -or \
58         -name '*.o' -or \
59         -name 'sbcl' -or \
60         -name 'sbcl.h' -or \
61         -name 'depend' -or \
62         -name '*.htm' -or \
63         -name '*.html' -or \
64         -name 'TAGS' -or \
65         -name 'local-target-features.lisp-expr' \) -print | xargs rm -f