ed1a58a4e2ed69721cf52275ec721c440172d843
[external/binutils.git] / opcodes / .Sanitize
1 # .Sanitize for devo/opcodes.
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 arc_files="arc-dis.c arc-opc.c"
19
20 if ( echo $* | grep keep\-arc > /dev/null ) ; then
21         keep_these_too="${arc_files} ${keep_these_too}"
22 else
23         lose_these_too="${arc_files} ${lose_these_too}"
24 fi
25
26 d10v_files="d10v-dis.c d10v-opc.c"
27
28 if ( echo $* | grep keep\-d10v > /dev/null ) ; then
29         keep_these_too="${d10v_files} ${keep_these_too}"
30 else
31         lose_these_too="${d10v_files} ${lose_these_too}"
32 fi
33
34 v850_files="v850-opc.c v850-dis.c"
35
36 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
37         keep_these_too="${v850_files} ${keep_these_too}"
38 else
39         lose_these_too="${v850_files} ${lose_these_too}"
40 fi
41
42 tic80_files="tic80-opc.c tic80-dis.c"
43
44 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
45         keep_these_too="${tic80_files} ${keep_these_too}"
46 else
47         lose_these_too="${tic80_files} ${lose_these_too}"
48 fi
49
50
51 # All files listed between the "Things-to-keep:" line and the
52 # "Files-to-sed:" line will be kept.  All other files will be removed.
53 # Directories listed in this section will have their own Sanitize
54 # called.  Directories not listed will be removed in their entirety
55 # with rm -rf.
56
57 Things-to-keep:
58
59 ChangeLog
60 Makefile.in
61 aclocal.m4
62 alpha-dis.c
63 alpha-opc.c
64 arm-dis.c
65 arm-opc.h
66 a29k-dis.c
67 config.in
68 configure
69 configure.bat
70 configure.in
71 dis-buf.c
72 disassemble.c
73 h8300-dis.c
74 h8500-dis.c
75 h8500-opc.h
76 hppa-dis.c
77 i386-dis.c
78 i960-dis.c
79 m68k-dis.c
80 m68k-opc.c
81 m88k-dis.c
82 makefile.vms
83 mips-dis.c
84 mips-opc.c
85 mips16-opc.c
86 mn10200-dis.c
87 mn10200-opc.c
88 mn10300-dis.c
89 mn10300-opc.c
90 mpw-config.in
91 mpw-make.sed
92 ns32k-dis.c
93 ppc-dis.c
94 ppc-opc.c
95 sh-opc.h
96 sh-dis.c
97 sparc-dis.c
98 sparc-opc.c
99 sysdep.h
100 w65-dis.c
101 w65-opc.h
102 z8k-dis.c
103 z8k-opc.h
104 z8kgen.c
105
106 Things-to-lose:
107
108 Do-last:
109
110 arc_files="ChangeLog Makefile.in configure.in configure disassemble.c"
111 if ( echo $* | grep keep\-arc > /dev/null ) ; then
112         for i in $arc_files ; do
113                 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
114                         if [ -n "${verbose}" ] ; then
115                                 echo Keeping arc stuff in $i
116                         fi
117                 fi
118         done
119 else
120         for i in $arc_files ; do
121                 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
122                         if [ -n "${verbose}" ] ; then
123                                 echo Removing traces of \"arc\" from $i...
124                         fi
125                         cp $i new
126                         sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
127                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
128                                 if [ -n "${verbose}" ] ; then
129                                         echo Caching $i in .Recover...
130                                 fi
131                                 mv $i .Recover
132                         fi
133                         mv new $i
134                 fi
135         done
136 fi
137
138 d10v_files="ChangeLog Makefile.in configure.in configure disassemble.c"
139 if ( echo $* | grep keep\-d10v > /dev/null ) ; then
140         for i in $d10v_files ; do
141                 if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then
142                         if [ -n "${verbose}" ] ; then
143                                 echo Keeping d10v stuff in $i
144                         fi
145                 fi
146         done
147 else
148         for i in $d10v_files ; do
149                 if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then
150                         if [ -n "${verbose}" ] ; then
151                                 echo Removing traces of \"d10v\" from $i...
152                         fi
153                         cp $i new
154                         sed '/start\-sanitize\-d10v/,/end-\sanitize\-d10v/d' < $i > new
155                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
156                                 if [ -n "${verbose}" ] ; then
157                                         echo Caching $i in .Recover...
158                                 fi
159                                 mv $i .Recover
160                         fi
161                         mv new $i
162                 fi
163         done
164 fi
165
166 v850_files="ChangeLog Makefile.in configure.in configure disassemble.c"
167 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
168         for i in $v850_files ; do
169                 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
170                         if [ -n "${verbose}" ] ; then
171                                 echo Keeping v850 stuff in $i
172                         fi
173                 fi
174         done
175 else
176         for i in $v850_files ; do
177                 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
178                         if [ -n "${verbose}" ] ; then
179                                 echo Removing traces of \"v850\" from $i...
180                         fi
181                         cp $i new
182                         sed '/start\-sanitize\-v850/,/end-\sanitize\-v850/d' < $i > new
183                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
184                                 if [ -n "${verbose}" ] ; then
185                                         echo Caching $i in .Recover...
186                                 fi
187                                 mv $i .Recover
188                         fi
189                         mv new $i
190                 fi
191         done
192 fi
193
194 tic80_files="ChangeLog Makefile.in configure.in configure disassemble.c"
195 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
196         for i in $tic80_files ; do
197                 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
198                         if [ -n "${verbose}" ] ; then
199                                 echo Keeping tic80 stuff in $i
200                         fi
201                 fi
202         done
203 else
204         for i in $tic80_files ; do
205                 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
206                         if [ -n "${verbose}" ] ; then
207                                 echo Removing traces of \"tic80\" from $i...
208                         fi
209                         cp $i new
210                         sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
211                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
212                                 if [ -n "${verbose}" ] ; then
213                                         echo Caching $i in .Recover...
214                                 fi
215                                 mv $i .Recover
216                         fi
217                         mv new $i
218                 fi
219         done
220 fi
221
222
223 for i in * ; do
224         if test ! -d $i && (grep sanitize $i > /dev/null) ; then
225                 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
226         fi
227 done
228
229 # End of file.