1 # .Sanitize for devo/opcodes.
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.
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
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.
18 cygnus_files="cgen.sh cgen-asm.in cgen-dis.in cgen-opc.in"
20 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
21 keep_these_too="${cygnus_files} ${keep_these_too}"
23 lose_these_too="${cygnus_files} ${lose_these_too}"
26 fr30_files="fr30-opc.h fr30-opc.c fr30-asm.c fr30-dis.c"
28 if ( echo $* | grep keep\-fr30 > /dev/null ) ; then
29 keep_these_too="${fr30_files} ${keep_these_too}"
31 lose_these_too="${fr30_files} ${lose_these_too}"
34 tic80_files="tic80-opc.c tic80-dis.c"
36 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
37 keep_these_too="${tic80_files} ${keep_these_too}"
39 lose_these_too="${tic80_files} ${lose_these_too}"
42 sky_files="dvp-opc.c dvp-dis.c"
44 if ( echo $* | grep keep\-sky > /dev/null ) ; then
45 keep_these_too="${sky_files} ${keep_these_too}"
47 lose_these_too="${sky_files} ${lose_these_too}"
50 # All files listed between the "Things-to-keep:" line and the
51 # "Files-to-sed:" line will be kept. All other files will be removed.
52 # Directories listed in this section will have their own Sanitize
53 # called. Directories not listed will be removed in their entirety
136 never_files="Makefile.am Makefile.in"
137 for i in $never_files ; do
138 if test ! -d $i && (grep sanitize-cygnus-never $i > /dev/null) ; then
139 if [ -n "${verbose}" ] ; then
140 echo Removing traces of \"cygnus-never\" from $i...
143 sed '/start\-sanitize\-cygnus-never/,/end\-sanitize\-cygnus-never/d' < $i > new
144 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
145 if [ -n "${verbose}" ] ; then
146 echo Caching $i in .Recover...
154 cygnus_files="ChangeLog Makefile.am Makefile.in configure.in configure"
155 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
156 for i in $cygnus_files ; do
157 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
158 if [ -n "${verbose}" ] ; then
159 echo Keeping cygnus stuff in $i
164 for i in $cygnus_files ; do
165 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
166 if [ -n "${verbose}" ] ; then
167 echo Removing traces of \"cygnus\" from $i...
170 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
171 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
172 if [ -n "${verbose}" ] ; then
173 echo Caching $i in .Recover...
182 am33_files="ChangeLog m10300-opc.c m10300-dis.c"
183 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
184 for i in $am33_files ; do
185 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
186 if [ -n "${verbose}" ] ; then
187 echo Keeping am33 stuff in $i
192 for i in $am33_files ; do
193 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
194 if [ -n "${verbose}" ] ; then
195 echo Removing traces of \"am33\" from $i...
198 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
199 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
200 if [ -n "${verbose}" ] ; then
201 echo Caching $i in .Recover...
211 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
212 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
213 for i in $v850e_files ; do
214 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
215 if [ -n "${verbose}" ] ; then
216 echo Keeping v850e stuff in $i
221 for i in $v850e_files ; do
222 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
223 if [ -n "${verbose}" ] ; then
224 echo Removing traces of \"v850e\" from $i...
227 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
228 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
229 if [ -n "${verbose}" ] ; then
230 echo Caching $i in .Recover...
240 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
241 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
242 for i in $r5900_files ; do
243 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
244 if [ -n "${verbose}" ] ; then
245 echo Keeping r5900 stuff in $i
250 for i in $r5900_files ; do
251 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
252 if [ -n "${verbose}" ] ; then
253 echo Removing traces of \"r5900\" from $i...
256 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
257 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
258 if [ -n "${verbose}" ] ; then
259 echo Caching $i in .Recover...
268 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
269 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
270 for i in $vr4320_files ; do
271 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
272 if [ -n "${verbose}" ] ; then
273 echo Keeping vr4320 stuff in $i
278 for i in $vr4320_files ; do
279 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
280 if [ -n "${verbose}" ] ; then
281 echo Removing traces of \"vr4320\" from $i...
284 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
285 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
286 if [ -n "${verbose}" ] ; then
287 echo Caching $i in .Recover...
296 vr4xxx_files="ChangeLog mips-opc.c mips-dis.c"
297 if ( echo $* | grep keep\-vr4xxx > /dev/null ) ; then
298 for i in $vr4xxx_files ; do
299 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
300 if [ -n "${verbose}" ] ; then
301 echo Keeping vr4xxx stuff in $i
306 for i in $vr4xxx_files ; do
307 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
308 if [ -n "${verbose}" ] ; then
309 echo Removing traces of \"vr4xxx\" from $i...
312 sed '/start\-sanitize\-vr4xxx/,/end-\sanitize\-vr4xxx/d' < $i > new
313 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
314 if [ -n "${verbose}" ] ; then
315 echo Caching $i in .Recover...
324 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
325 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
326 for i in $cygnus_files ; do
327 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
328 if [ -n "${verbose}" ] ; then
329 echo Keeping cygnus stuff in $i
334 for i in $cygnus_files ; do
335 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
336 if [ -n "${verbose}" ] ; then
337 echo Removing traces of \"cygnus\" from $i...
340 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
341 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
342 if [ -n "${verbose}" ] ; then
343 echo Caching $i in .Recover...
352 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
353 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
354 for i in $tx19_files ; do
355 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
356 if [ -n "${verbose}" ] ; then
357 echo Keeping tx19 stuff in $i
362 for i in $tx19_files ; do
363 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
364 if [ -n "${verbose}" ] ; then
365 echo Removing traces of \"tx19\" from $i...
368 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
369 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
370 if [ -n "${verbose}" ] ; then
371 echo Caching $i in .Recover...
380 tx49_files="ChangeLog mips-opc.c mips-dis.c"
381 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
382 for i in $tx49_files ; do
383 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
384 if [ -n "${verbose}" ] ; then
385 echo Keeping tx49 stuff in $i
390 for i in $tx49_files ; do
391 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
392 if [ -n "${verbose}" ] ; then
393 echo Removing traces of \"tx49\" from $i...
396 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
397 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
398 if [ -n "${verbose}" ] ; then
399 echo Caching $i in .Recover...
408 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
409 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
410 for i in $tic80_files ; do
411 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
412 if [ -n "${verbose}" ] ; then
413 echo Keeping tic80 stuff in $i
418 for i in $tic80_files ; do
419 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
420 if [ -n "${verbose}" ] ; then
421 echo Removing traces of \"tic80\" from $i...
424 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
425 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
426 if [ -n "${verbose}" ] ; then
427 echo Caching $i in .Recover...
436 fr30_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
437 if ( echo $* | grep keep\-fr30 > /dev/null ) ; then
438 for i in $fr30_files ; do
439 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
440 if [ -n "${verbose}" ] ; then
441 echo Keeping fr30 stuff in $i
446 for i in $fr30_files ; do
447 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
448 if [ -n "${verbose}" ] ; then
449 echo Removing traces of \"fr30\" from $i...
452 sed '/start\-sanitize\-fr30/,/end-\sanitize\-fr30/d' < $i > new
453 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
454 if [ -n "${verbose}" ] ; then
455 echo Caching $i in .Recover...
464 coldfire_files="ChangeLog m68k-opc.c"
465 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
466 for i in $coldfire_files ; do
467 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
468 if [ -n "${verbose}" ] ; then
469 echo Keeping coldfire stuff in $i
474 for i in $coldfire_files ; do
475 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
476 if [ -n "${verbose}" ] ; then
477 echo Removing traces of \"coldfire\" from $i...
480 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
481 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
482 if [ -n "${verbose}" ] ; then
483 echo Caching $i in .Recover...
492 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
493 if ( echo $* | grep keep\-sky > /dev/null ) ; then
494 for i in $sky_files ; do
495 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
496 if [ -n "${verbose}" ] ; then
497 echo Keeping sky stuff in $i
502 for i in $sky_files ; do
503 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
504 if [ -n "${verbose}" ] ; then
505 echo Removing traces of \"sky\" from $i...
508 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
509 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
510 if [ -n "${verbose}" ] ; then
511 echo Caching $i in .Recover...
520 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
521 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
522 for i in $m32rx_files ; do
523 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
524 if [ -n "${verbose}" ] ; then
525 echo Keeping m32rx stuff in $i
530 for i in $m32rx_files ; do
531 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
532 if [ -n "${verbose}" ] ; then
533 echo Removing traces of \"m32rx\" from $i...
536 # The PIPE sanitization will be much cleaner with redact.
537 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
538 -e 's/, PIPE_[A-Z]*//g' < $i > new
539 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
540 if [ -n "${verbose}" ] ; then
541 echo Caching $i in .Recover...
550 nortel_ppc750_files="ChangeLog ppc-opc.c"
551 if ( echo $* | grep keep\-nortel-ppc750 > /dev/null ) ; then
552 for i in $nortel_ppc750_files ; do
553 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
554 if [ -n "${verbose}" ] ; then
555 echo Keeping nortel-ppc750 stuff in $i
560 for i in $nortel_ppc750_files ; do
561 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
562 if [ -n "${verbose}" ] ; then
563 echo Removing traces of \"nortel-ppc750\" from $i...
566 # The PIPE sanitization will be much cleaner with redact.
567 sed -e '/start\-sanitize\-nortel-ppc750/,/end\-sanitize\-nortel-ppc750/d' \
568 -e 's/, PIPE_[A-Z]*//g' < $i > new
569 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
570 if [ -n "${verbose}" ] ; then
571 echo Caching $i in .Recover...
581 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
582 echo '***' Some mentions of Sanitize are still left in opcodes/$i! 1>&2
586 for lost in .. $lose_these_too; do
587 if test $lost != ..; then
588 for i in Makefile.am Makefile.in configure.in configure; do
589 if fgrep $lost $i >/dev/null 2>&1; then
590 echo '***' File $lost was sanitized out but is still mentioned in opcodes/$i 1>&2
596 # This must come after all other sanitizations. Re-sanitize the .pot
598 if [ -n "${verbose}" ]; then
599 echo Re-computing files for gettext ...
602 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
603 if [ -n "${verbose}" ]; then
604 echo Caching po/POTFILES.in in .Recover...
606 mv po/POTFILES.in po/.Recover
609 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
611 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
612 if [ -n "${verbose}" ]; then
613 echo Caching po/opcodes.pot in .Recover...
615 mv po/opcodes.pot po/.Recover
618 # If this fails, Sanitization must fail.
619 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1