Add MPW/GM sanitizing
[binutils-gdb.git] / ld / .Sanitize
1 # .Sanitize for devo/ld
2
3 # Each directory to survive its way into a release will need a file
4 # like this one called "./.Sanitize". All keyword lines must exist,
5 # and must exist in the order specified by this file. Each directory
6 # in the tree will be processed, top down, in the following order.
7
8 # Hash started lines like this one are comments and will be deleted
9 # before anything else is done. Blank lines will also be squashed
10 # out.
11
12 # The lines between the "Do-first:" line and the "Things-to-keep:"
13 # line are executed as a /bin/sh shell script before anything else is
14 # done in this directory.
15
16 Do-first:
17
18 if ( echo $* | grep keep\-v9 > /dev/null ) ; then
19 keep_these_too=""
20 fi
21
22 if ( echo $* | grep keep\-mpw > /dev/null ) ; then
23 keep_these_too="mpw-config.in mpw-build.in mpw-make.in ChangeLog.mpw ${keep_these_too}"
24 else
25 lose_these_too="mpw-config.in mpw-build.in mpw-make.in ChangeLog.mpw ${lose_these_too}"
26 fi
27
28 if ( echo $* | grep keep\-gm > /dev/null ) ; then
29 keep_these_too="mpw-xconfig.in mpw-em.c ChangeLog.gm ${keep_these_too}"
30 else
31 lose_these_too="mpw-xconfig.in mpw-em.c ChangeLog.gm ${lose_these_too}"
32 fi
33
34 # All files listed between the "Things-to-keep:" line and the
35 # "Files-to-sed:" line will be kept. All other files will be removed.
36 # Directories listed in this section will have their own Sanitize
37 # called. Directories not listed will be removed in their entirety
38 # with rm -rf.
39
40 Things-to-keep:
41
42 ChangeLog
43 Makefile.in
44 NEWS
45 README
46 TODO
47 cdtest-foo.cc
48 cdtest-foo.h
49 cdtest-func.cc
50 cdtest-main.cc
51 cdtest.exp
52 config
53 config.h
54 configure.bat
55 configure.in
56 dep-in.sed
57 emulparams
58 emultempl
59 genscripts.sh
60 h8-doc.texi
61 ld.1
62 gen-doc.texi
63 ld.h
64 ld.texinfo
65 ldctor.c
66 ldctor.h
67 ldemul.c
68 ldemul.h
69 ldexp.c
70 ldexp.h
71 ldfile.c
72 ldfile.h
73 ldgram.y
74 ldint.texinfo
75 ldlang.c
76 ldlang.h
77 ldlex.h
78 ldlex.l
79 ldmain.c
80 ldmain.h
81 ldmisc.c
82 ldmisc.h
83 ldver.c
84 ldver.h
85 ldwrite.c
86 ldwrite.h
87 lexsup.c
88 mri.c
89 mri.h
90 scripttempl
91
92 Things-to-lose:
93
94 Do-last:
95
96 echo Looking for signs of \"v9\"...
97
98 # Don't try to clean directories here, as the 'mv' command will fail.
99 # Also, grep fails on NFS mounted directories.
100 if ( echo $* | grep keep\-v9 > /dev/null ) ; then
101 for i in * ; do
102 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
103 echo Keeping v9 stuff in $i
104 fi
105 done
106 else
107 for i in * ; do
108 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
109 echo Cleaning the \"v9\" out of $i...
110 cp $i new
111 sed '/start\-sanitize\-v9/,/end-\sanitize\-v9/d' < $i > new
112 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
113 echo Caching $i in .Recover...
114 mv $i .Recover
115 fi
116 mv new $i
117 fi
118 done
119 fi
120
121 echo Looking for traces of \"mpw\"...
122
123 # Don't try to clean directories here, as the 'mv' command will fail.
124 # Also, grep fails on NFS mounted directories.
125 if ( echo $* | grep keep\-mpw > /dev/null ) ; then
126 for i in * ; do
127 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
128 echo Keeping mpw traces in $i
129 fi
130 done
131 else
132 for i in * ; do
133 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
134 echo Removing traces of \"mpw\" out of $i...
135 cp $i new
136 sed '/start\-sanitize\-mpw/,/end-\sanitize\-mpw/d' < $i > new
137 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
138 echo Caching $i in .Recover...
139 mv $i .Recover
140 fi
141 mv new $i
142 fi
143 done
144 fi
145
146 # End of file.