aeb36657a21d6a05274eb04ea83c69b756667d1f
[binutils-gdb.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 cygnus_files="cgen.sh cgen-asm.in cgen-dis.in cgen-opc.in"
19
20 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
21 keep_these_too="${cygnus_files} ${keep_these_too}"
22 else
23 lose_these_too="${cygnus_files} ${lose_these_too}"
24 fi
25
26 tic80_files="tic80-opc.c tic80-dis.c"
27
28 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
29 keep_these_too="${tic80_files} ${keep_these_too}"
30 else
31 lose_these_too="${tic80_files} ${lose_these_too}"
32 fi
33
34 sky_files="dvp-opc.c dvp-dis.c"
35
36 if ( echo $* | grep keep\-sky > /dev/null ) ; then
37 keep_these_too="${sky_files} ${keep_these_too}"
38 else
39 lose_these_too="${sky_files} ${lose_these_too}"
40 fi
41
42 # All files listed between the "Things-to-keep:" line and the
43 # "Files-to-sed:" line will be kept. All other files will be removed.
44 # Directories listed in this section will have their own Sanitize
45 # called. Directories not listed will be removed in their entirety
46 # with rm -rf.
47
48 Things-to-keep:
49
50 ChangeLog
51 Makefile.am
52 Makefile.in
53 acconfig.h
54 acinclude.m4
55 aclocal.m4
56 alpha-dis.c
57 alpha-opc.c
58 arc-dis.c
59 arc-opc.c
60 arm-dis.c
61 arm-opc.h
62 a29k-dis.c
63 cgen-asm.c
64 cgen-dis.c
65 cgen-opc.c
66 config.in
67 configure
68 configure.bat
69 configure.in
70 d10v-dis.c
71 d10v-opc.c
72 d30v-dis.c
73 d30v-opc.c
74 dep-in.sed
75 dis-buf.c
76 disassemble.c
77 h8300-dis.c
78 h8500-dis.c
79 h8500-opc.h
80 hppa-dis.c
81 i386-dis.c
82 i960-dis.c
83 m32r-asm.c
84 m32r-dis.c
85 m32r-opc.c
86 m32r-opc.h
87 m68k-dis.c
88 m68k-opc.c
89 m88k-dis.c
90 makefile.vms
91 mips-dis.c
92 mips-opc.c
93 mips16-opc.c
94 m10200-dis.c
95 m10200-opc.c
96 m10300-dis.c
97 m10300-opc.c
98 mpw-config.in
99 mpw-make.sed
100 ns32k-dis.c
101 opintl.h
102 po
103 ppc-dis.c
104 ppc-opc.c
105 sh-opc.h
106 sh-dis.c
107 sparc-dis.c
108 sparc-opc.c
109 stamp-h.in
110 sysdep.h
111 tic30-dis.c
112 vax-dis.c
113 w65-dis.c
114 w65-opc.h
115 v850-opc.c
116 v850-dis.c
117 z8k-dis.c
118 z8k-opc.h
119 z8kgen.c
120
121 Things-to-lose:
122
123 fr30-asm.c
124 fr30-dis.c
125 fr30-opc.c
126 fr30-opc.h
127
128 Do-last:
129
130 cygnus_files="ChangeLog Makefile.am Makefile.in configure.in configure"
131 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
132 for i in $cygnus_files ; do
133 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
134 if [ -n "${verbose}" ] ; then
135 echo Keeping cygnus stuff in $i
136 fi
137 fi
138 done
139 else
140 for i in $cygnus_files ; do
141 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
142 if [ -n "${verbose}" ] ; then
143 echo Removing traces of \"cygnus\" from $i...
144 fi
145 cp $i new
146 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
147 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
148 if [ -n "${verbose}" ] ; then
149 echo Caching $i in .Recover...
150 fi
151 mv $i .Recover
152 fi
153 mv new $i
154 fi
155 done
156 fi
157
158 am33_files="ChangeLog m10300-opc.c m10300-dis.c"
159 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
160 for i in $am33_files ; do
161 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
162 if [ -n "${verbose}" ] ; then
163 echo Keeping am33 stuff in $i
164 fi
165 fi
166 done
167 else
168 for i in $am33_files ; do
169 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
170 if [ -n "${verbose}" ] ; then
171 echo Removing traces of \"am33\" from $i...
172 fi
173 cp $i new
174 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
175 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
176 if [ -n "${verbose}" ] ; then
177 echo Caching $i in .Recover...
178 fi
179 mv $i .Recover
180 fi
181 mv new $i
182 fi
183 done
184 fi
185
186
187 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
188 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
189 for i in $v850e_files ; do
190 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
191 if [ -n "${verbose}" ] ; then
192 echo Keeping v850e stuff in $i
193 fi
194 fi
195 done
196 else
197 for i in $v850e_files ; do
198 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
199 if [ -n "${verbose}" ] ; then
200 echo Removing traces of \"v850e\" from $i...
201 fi
202 cp $i new
203 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
204 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
205 if [ -n "${verbose}" ] ; then
206 echo Caching $i in .Recover...
207 fi
208 mv $i .Recover
209 fi
210 mv new $i
211 fi
212 done
213 fi
214
215
216 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
217 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
218 for i in $r5900_files ; do
219 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
220 if [ -n "${verbose}" ] ; then
221 echo Keeping r5900 stuff in $i
222 fi
223 fi
224 done
225 else
226 for i in $r5900_files ; do
227 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
228 if [ -n "${verbose}" ] ; then
229 echo Removing traces of \"r5900\" from $i...
230 fi
231 cp $i new
232 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
233 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
234 if [ -n "${verbose}" ] ; then
235 echo Caching $i in .Recover...
236 fi
237 mv $i .Recover
238 fi
239 mv new $i
240 fi
241 done
242 fi
243
244 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
245 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
246 for i in $vr4320_files ; do
247 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
248 if [ -n "${verbose}" ] ; then
249 echo Keeping vr4320 stuff in $i
250 fi
251 fi
252 done
253 else
254 for i in $vr4320_files ; do
255 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
256 if [ -n "${verbose}" ] ; then
257 echo Removing traces of \"vr4320\" from $i...
258 fi
259 cp $i new
260 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
261 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
262 if [ -n "${verbose}" ] ; then
263 echo Caching $i in .Recover...
264 fi
265 mv $i .Recover
266 fi
267 mv new $i
268 fi
269 done
270 fi
271
272 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
273 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
274 for i in $cygnus_files ; do
275 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
276 if [ -n "${verbose}" ] ; then
277 echo Keeping cygnus stuff in $i
278 fi
279 fi
280 done
281 else
282 for i in $cygnus_files ; do
283 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
284 if [ -n "${verbose}" ] ; then
285 echo Removing traces of \"cygnus\" from $i...
286 fi
287 cp $i new
288 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
289 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
290 if [ -n "${verbose}" ] ; then
291 echo Caching $i in .Recover...
292 fi
293 mv $i .Recover
294 fi
295 mv new $i
296 fi
297 done
298 fi
299
300 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
301 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
302 for i in $tx19_files ; do
303 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
304 if [ -n "${verbose}" ] ; then
305 echo Keeping tx19 stuff in $i
306 fi
307 fi
308 done
309 else
310 for i in $tx19_files ; do
311 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
312 if [ -n "${verbose}" ] ; then
313 echo Removing traces of \"tx19\" from $i...
314 fi
315 cp $i new
316 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
317 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
318 if [ -n "${verbose}" ] ; then
319 echo Caching $i in .Recover...
320 fi
321 mv $i .Recover
322 fi
323 mv new $i
324 fi
325 done
326 fi
327
328 tx49_files="ChangeLog mips-opc.c mips-dis.c"
329 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
330 for i in $tx49_files ; do
331 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
332 if [ -n "${verbose}" ] ; then
333 echo Keeping tx49 stuff in $i
334 fi
335 fi
336 done
337 else
338 for i in $tx49_files ; do
339 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
340 if [ -n "${verbose}" ] ; then
341 echo Removing traces of \"tx49\" from $i...
342 fi
343 cp $i new
344 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
345 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
346 if [ -n "${verbose}" ] ; then
347 echo Caching $i in .Recover...
348 fi
349 mv $i .Recover
350 fi
351 mv new $i
352 fi
353 done
354 fi
355
356 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
357 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
358 for i in $tic80_files ; do
359 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
360 if [ -n "${verbose}" ] ; then
361 echo Keeping tic80 stuff in $i
362 fi
363 fi
364 done
365 else
366 for i in $tic80_files ; do
367 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
368 if [ -n "${verbose}" ] ; then
369 echo Removing traces of \"tic80\" from $i...
370 fi
371 cp $i new
372 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
373 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
374 if [ -n "${verbose}" ] ; then
375 echo Caching $i in .Recover...
376 fi
377 mv $i .Recover
378 fi
379 mv new $i
380 fi
381 done
382 fi
383
384 coldfire_files="ChangeLog m68k-opc.c"
385 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
386 for i in $coldfire_files ; do
387 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
388 if [ -n "${verbose}" ] ; then
389 echo Keeping coldfire stuff in $i
390 fi
391 fi
392 done
393 else
394 for i in $coldfire_files ; do
395 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
396 if [ -n "${verbose}" ] ; then
397 echo Removing traces of \"coldfire\" from $i...
398 fi
399 cp $i new
400 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
401 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
402 if [ -n "${verbose}" ] ; then
403 echo Caching $i in .Recover...
404 fi
405 mv $i .Recover
406 fi
407 mv new $i
408 fi
409 done
410 fi
411
412 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
413 if ( echo $* | grep keep\-sky > /dev/null ) ; then
414 for i in $sky_files ; do
415 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
416 if [ -n "${verbose}" ] ; then
417 echo Keeping sky stuff in $i
418 fi
419 fi
420 done
421 else
422 for i in $sky_files ; do
423 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
424 if [ -n "${verbose}" ] ; then
425 echo Removing traces of \"sky\" from $i...
426 fi
427 cp $i new
428 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
429 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
430 if [ -n "${verbose}" ] ; then
431 echo Caching $i in .Recover...
432 fi
433 mv $i .Recover
434 fi
435 mv new $i
436 fi
437 done
438 fi
439
440 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
441 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
442 for i in $m32rx_files ; do
443 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
444 if [ -n "${verbose}" ] ; then
445 echo Keeping m32rx stuff in $i
446 fi
447 fi
448 done
449 else
450 for i in $m32rx_files ; do
451 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
452 if [ -n "${verbose}" ] ; then
453 echo Removing traces of \"m32rx\" from $i...
454 fi
455 cp $i new
456 # The PIPE sanitization will be much cleaner with redact.
457 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
458 -e 's/, PIPE_[A-Z]*//g' < $i > new
459 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
460 if [ -n "${verbose}" ] ; then
461 echo Caching $i in .Recover...
462 fi
463 mv $i .Recover
464 fi
465 mv new $i
466 fi
467 done
468 fi
469
470 nortel_ppc750_files="ChangeLog ppc-opc.c"
471 if ( echo $* | grep keep\-nortel-ppc750 > /dev/null ) ; then
472 for i in $nortel_ppc750_files ; do
473 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
474 if [ -n "${verbose}" ] ; then
475 echo Keeping nortel-ppc750 stuff in $i
476 fi
477 fi
478 done
479 else
480 for i in $nortel_ppc750_files ; do
481 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
482 if [ -n "${verbose}" ] ; then
483 echo Removing traces of \"nortel-ppc750\" from $i...
484 fi
485 cp $i new
486 # The PIPE sanitization will be much cleaner with redact.
487 sed -e '/start\-sanitize\-nortel-ppc750/,/end\-sanitize\-nortel-ppc750/d' \
488 -e 's/, PIPE_[A-Z]*//g' < $i > new
489 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
490 if [ -n "${verbose}" ] ; then
491 echo Caching $i in .Recover...
492 fi
493 mv $i .Recover
494 fi
495 mv new $i
496 fi
497 done
498 fi
499
500 for i in *; do
501 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
502 echo '***' Some mentions of Sanitize are still left in opcodes/$i! 1>&2
503 fi
504 done
505
506 for lost in .. $lose_these_too; do
507 if test $lost != ..; then
508 for i in Makefile.am Makefile.in configure.in configure; do
509 if fgrep $lost $i >/dev/null 2>&1; then
510 echo '***' File $lost was sanitized out but is still mentioned in opcodes/$i 1>&2
511 fi
512 done
513 fi
514 done
515
516 # This must come after all other sanitizations. Re-sanitize the .pot
517 # file.
518 if [ -n "${verbose}" ]; then
519 echo Re-computing files for gettext ...
520 fi
521
522 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
523 if [ -n "${verbose}" ]; then
524 echo Caching po/POTFILES.in in .Recover...
525 fi
526 mv po/POTFILES.in po/.Recover
527 fi
528
529 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
530
531 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
532 if [ -n "${verbose}" ]; then
533 echo Caching po/opcodes.pot in .Recover...
534 fi
535 mv po/opcodes.pot po/.Recover
536 fi
537
538 # If this fails, Sanitization must fail.
539 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1
540
541 # End of file.