0.6.12.7.flaky1:
[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 # Ask some other directories to clean themselves up.
26 pwd=`pwd`
27 for d in tools-for-build; do
28     cd $d
29     make clean
30     cd $pwd
31 done
32
33 # Within all directories, remove things which don't look like source
34 # files. Some explanations:
35 #   (symlinks)
36 #     are never in the sources; they must've been created
37 #   sbcl
38 #     the runtime environment, created by compiling C code
39 #   sbcl.h 
40 #     information about Lisp code needed to build the runtime environment,
41 #     created by running GENESIS
42 #   Config, target
43 #     architecture-dependent or OS-dependent symlinks
44 #   *.htm, *.html
45 #     probably machine-generated translation of DocBook (*.sgml) files
46 #   core
47 #     probably a Unix core dump -- not part of the sources anyway
48 #   *.o, *.lib, *.nm
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 #   *~, #*#, TAGS
54 #     common names for editor temporary files
55 #   *.htm, *.html
56 #     The system doc sources are SGML, any HTML is automatically 
57 #     generated output.
58 #   depend
59 #     made by "make depend" (or "gmake depend" or some such thing)
60 #   *.x86f, *.axpf, *.lbytef, *.fasl
61 #     typical extensions for fasl files
62 find . \( \
63         -type l -or \
64         -name '*~' -or \
65         -name '#*#' -or \
66         -name '?*.x86f' -or \
67         -name '?*.axpf' -or \
68         -name '?*.lbytef' -or \
69         -name '?*.fasl' -or \
70         -name 'core' -or \
71         -name '?*.core' -or \
72         -name '*.map' -or \
73         -name '*.nm' -or \
74         -name '*.host-obj' -or \
75         -name '*.lisp-obj' -or \
76         -name '*.target-obj' -or \
77         -name '*.lib' -or \
78         -name '*.tmp' -or \
79         -name '*.o' -or \
80         -name 'sbcl' -or \
81         -name 'sbcl.h' -or \
82         -name 'depend' -or \
83         -name '*.htm' -or \
84         -name '*.html' -or \
85         -name 'TAGS' -or \
86         -name 'local-target-features.lisp-expr' \) -print | xargs rm -f