1 # .Sanitize for devo/bfd
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 d30v_files="cpu-d30v.c elf32-d30v.c"
20 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
21 keep_these_too="${d30v_files} ${keep_these_too}"
23 lose_these_too="${d30v_files} ${lose_these_too}"
26 tic80_files="cpu-tic80.c coff-tic80.c"
28 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
29 keep_these_too="${tic80_files} ${keep_these_too}"
31 lose_these_too="${tic80_files} ${lose_these_too}"
34 # All files listed between the "Things-to-keep:" line and the
35 # "Do-last:" 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
297 # The lines between the "Do-last:" line and the end of the file
298 # are executed as a /bin/sh shell script after everything else is
303 d30v_files="ChangeLog ChangeLog.2 Makefile.in Makefile.am archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h"
304 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
305 for i in $d30v_files ; do
306 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
307 if [ -n "${verbose}" ] ; then
308 echo Keeping d30v stuff in $i
313 for i in $d30v_files ; do
314 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
315 if [ -n "${verbose}" ] ; then
316 echo Removing traces of \"d30v\" from $i...
319 sed '/start\-sanitize\-d30v/,/end-\sanitize\-d30v/d' < $i > new
320 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
321 if [ -n "${verbose}" ] ; then
322 echo Caching $i in .Recover...
331 v850_files="ChangeLog Makefile.in Makefile.am archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h elf32-v850.c cpu-v850.c"
332 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
333 for i in $v850_files ; do
334 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
335 if [ -n "${verbose}" ] ; then
336 echo Keeping v850e stuff in $i
341 for i in $v850_files ; do
342 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
343 if [ -n "${verbose}" ] ; then
344 echo Removing traces of \"v850e\" from $i...
347 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
348 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
349 if [ -n "${verbose}" ] ; then
350 echo Caching $i in .Recover...
359 r5900_files="ChangeLog config.bfd archures.c bfd-in2.h cpu-mips.c elf32-mips.c libbfd.h reloc.c"
360 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
361 for i in $r5900_files ; do
362 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
363 if [ -n "${verbose}" ] ; then
364 echo Keeping r5900 stuff in $i
369 for i in $r5900_files ; do
370 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
371 if [ -n "${verbose}" ] ; then
372 echo Removing traces of \"r5900\" from $i...
375 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
376 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
377 if [ -n "${verbose}" ] ; then
378 echo Caching $i in .Recover...
387 tx19_files="archures.c bfd-in2.h cpu-mips.c"
388 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
389 for i in $tx19_files ; do
390 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
391 if [ -n "${verbose}" ] ; then
392 echo Keeping tx19 stuff in $i
397 for i in $tx19_files ; do
398 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
399 if [ -n "${verbose}" ] ; then
400 echo Removing traces of \"tx19\" from $i...
403 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
404 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
405 if [ -n "${verbose}" ] ; then
406 echo Caching $i in .Recover...
415 tx49_files="archures.c bfd-in2.h cpu-mips.c"
416 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
417 for i in $tx49_files ; do
418 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
419 if [ -n "${verbose}" ] ; then
420 echo Keeping tx49 stuff in $i
425 for i in $tx49_files ; do
426 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
427 if [ -n "${verbose}" ] ; then
428 echo Removing traces of \"tx49\" from $i...
431 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
432 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
433 if [ -n "${verbose}" ] ; then
434 echo Caching $i in .Recover...
443 tic80_files="ChangeLog Makefile.in Makefile.am archures.c bfd-in2.h config.bfd configure configure.in targets.c coffcode.h coffswap.h"
444 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
445 for i in $tic80_files ; do
446 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
447 if [ -n "${verbose}" ] ; then
448 echo Keeping tic80 stuff in $i
453 for i in $tic80_files ; do
454 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
455 if [ -n "${verbose}" ] ; then
456 echo Removing traces of \"tic80\" from $i...
459 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
460 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
461 if [ -n "${verbose}" ] ; then
462 echo Caching $i in .Recover...
471 gm_files="ChangeLog ChangeLog.2 config.bfd"
472 if ( echo $* | grep keep\-gm > /dev/null ) ; then
473 for i in $gm_files ; do
474 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
475 if [ -n "${verbose}" ] ; then
476 echo Keeping gm stuff in $i
481 for i in $gm_files ; do
482 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
483 if [ -n "${verbose}" ] ; then
484 echo Removing traces of \"gm\" from $i...
487 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
488 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
489 if [ -n "${verbose}" ] ; then
490 echo Caching $i in .Recover...
499 vr5400_files="ChangeLog archures.c bfd-in2.h bfd-in.h cpu-mips.c"
500 if ( echo $* | grep keep\-vr5400 > /dev/null ) ; then
501 for i in $vr5400_files ; do
502 if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
503 if [ -n "${verbose}" ] ; then
504 echo Keeping vr5400 stuff in $i
509 for i in $vr5400_files ; do
510 if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
511 if [ -n "${verbose}" ] ; then
512 echo Removing traces of \"vr5400\" from $i...
515 sed '/start\-sanitize\-vr5400/,/end-\sanitize\-vr5400/d' < $i > new
516 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
517 if [ -n "${verbose}" ] ; then
518 echo Caching $i in .Recover...
527 vr4320_files="ChangeLog archures.c bfd-in2.h cpu-mips.c"
528 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
529 for i in $vr4320_files ; do
530 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
531 if [ -n "${verbose}" ] ; then
532 echo Keeping vr4320 stuff in $i
537 for i in $vr4320_files ; do
538 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
539 if [ -n "${verbose}" ] ; then
540 echo Removing traces of \"vr4320\" from $i...
543 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
544 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
545 if [ -n "${verbose}" ] ; then
546 echo Caching $i in .Recover...
555 m32rx_files="ChangeLog archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
556 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
557 for i in $m32rx_files ; do
558 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
559 if [ -n "${verbose}" ] ; then
560 echo Keeping m32rx stuff in $i
565 for i in $m32rx_files ; do
566 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
567 if [ -n "${verbose}" ] ; then
568 echo Removing traces of \"m32rx\" from $i...
571 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
572 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
573 if [ -n "${verbose}" ] ; then
574 echo Caching $i in .Recover...
583 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
584 if ( echo $* | grep keep\-sky > /dev/null ) ; then
585 for i in $sky_files ; do
586 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
587 if [ -n "${verbose}" ] ; then
588 echo Keeping sky stuff in $i
593 for i in $sky_files ; do
594 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
595 if [ -n "${verbose}" ] ; then
596 echo Removing traces of \"sky\" from $i...
599 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
600 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
601 if [ -n "${verbose}" ] ; then
602 echo Caching $i in .Recover...
612 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
613 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
618 # This must come after all other sanitizations. Re-sanitize the .pot
620 if [ -n "${verbose}" ]; then
621 echo Re-computing files for gettext ...
624 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
625 if [ -n "${verbose}" ]; then
626 echo Caching po/POTFILES.in in .Recover...
628 mv po/POTFILES.in po/.Recover
630 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
632 if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
633 if [ -n "${verbose}" ]; then
634 echo Caching po/bfd.pot in .Recover...
636 mv po/bfd.pot po/.Recover
638 # If this fails, Sanitization must fail.
639 xgettext -c -k _ -k N_ -f po/POTFILES.in -o po/bfd.pot || exit 1