File: clean

package info (click to toggle)
mlton 20070826-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 33,184 kB
  • ctags: 70,419
  • sloc: ansic: 16,154; lisp: 2,727; makefile: 1,635; sh: 1,234; pascal: 256; asm: 97
file content (48 lines) | stat: -rwxr-xr-x 1,189 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash

set -e

dir=`dirname "$0"`
root=`cd "$dir/.." && pwd`
bin="$root/bin"

case `"$bin/host-os"` in
cygwin|freebsd|linux)
        grepFlags='-q'
;;
sun)
        grepFlags=''
;;
esac

ignore='.ignore'
doit () {
        rm -rf '.#'* .*~ *~ *.a *.o .cm core mlmon.out svn-commit.*
        if [ -r "$ignore" ]; then
		# xargs allows us to have quoted strings for filenames
		xargs rm -rf < "$ignore"
        fi
        for f in *; do
                if [ -d "$f" ]; then
                        cd "$f"
                        if [ -r Makefile ]; then
				"$bin/mmake" clean || doit
                        else
                                doit
                        fi
                        cd ..
                fi
        done
}

doit

# This script removes all the junk files created when compiling with MLton's
# various -keep flags.

#/bin/rm -f *.basis *.chunks *.const *.core-ml *.dot *.flat *.flow      \
#       *.inline *.local-flatten *.mono *.o *.once-graph *.once-vars    \
#       *.post-useless *.raise-to-jump *.redundant *.reg *.rep *.ssa    \
#       *.sxml *.sxml.poly *.threshold[0-9] *.unused-args *.useless *.xml
#
#/bin/rm -f *~ core mlmon.out