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 tic80_files="cpu-tic80.c coff-tic80.c"
20 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
21 keep_these_too="${tic80_files} ${keep_these_too}"
23 lose_these_too="${tic80_files} ${lose_these_too}"
26 # All files listed between the "Things-to-keep:" line and the
27 # "Do-last:" line will be kept. All other files will be removed.
28 # Directories listed in this section will have their own Sanitize
29 # called. Directories not listed will be removed in their entirety
296 # The lines between the "Do-last:" line and the end of the file
297 # are executed as a /bin/sh shell script after everything else is
302 never_files="ChangeLog"
303 for i in $never_files ; do
304 if test ! -d $i && (grep sanitize-cygnus-never $i > /dev/null) ; then
305 if [ -n "${verbose}" ] ; then
306 echo Removing traces of \"cygnus-never\" from $i...
309 sed '/start\-sanitize\-cygnus-never/,/end\-sanitize\-cygnus-never/d' < $i > new
310 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
311 if [ -n "${verbose}" ] ; then
312 echo Caching $i in .Recover...
320 am33_files="ChangeLog archures.c bfd-in2.h cpu-m10300.c elf-m10300.c"
321 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
322 for i in $am33_files ; do
323 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
324 if [ -n "${verbose}" ] ; then
325 echo Keeping am33 stuff in $i
330 for i in $am33_files ; do
331 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
332 if [ -n "${verbose}" ] ; then
333 echo Removing traces of \"am33\" from $i...
336 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
337 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
338 if [ -n "${verbose}" ] ; then
339 echo Caching $i in .Recover...
348 v850_files="ChangeLog ChangeLog-9697 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"
349 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
350 for i in $v850_files ; do
351 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
352 if [ -n "${verbose}" ] ; then
353 echo Keeping v850e stuff in $i
358 for i in $v850_files ; do
359 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
360 if [ -n "${verbose}" ] ; then
361 echo Removing traces of \"v850e\" from $i...
364 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
365 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
366 if [ -n "${verbose}" ] ; then
367 echo Caching $i in .Recover...
376 r5900_files="ChangeLog ChangeLog-9697 config.bfd archures.c bfd-in2.h cpu-mips.c elf32-mips.c libbfd.h reloc.c"
377 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
378 for i in $r5900_files ; do
379 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
380 if [ -n "${verbose}" ] ; then
381 echo Keeping r5900 stuff in $i
386 for i in $r5900_files ; do
387 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
388 if [ -n "${verbose}" ] ; then
389 echo Removing traces of \"r5900\" from $i...
392 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
393 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
394 if [ -n "${verbose}" ] ; then
395 echo Caching $i in .Recover...
404 tx19_files="archures.c bfd-in2.h cpu-mips.c"
405 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
406 for i in $tx19_files ; do
407 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
408 if [ -n "${verbose}" ] ; then
409 echo Keeping tx19 stuff in $i
414 for i in $tx19_files ; do
415 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
416 if [ -n "${verbose}" ] ; then
417 echo Removing traces of \"tx19\" from $i...
420 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
421 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
422 if [ -n "${verbose}" ] ; then
423 echo Caching $i in .Recover...
432 tx49_files="archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
433 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
434 for i in $tx49_files ; do
435 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
436 if [ -n "${verbose}" ] ; then
437 echo Keeping tx49 stuff in $i
442 for i in $tx49_files ; do
443 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
444 if [ -n "${verbose}" ] ; then
445 echo Removing traces of \"tx49\" from $i...
448 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
449 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
450 if [ -n "${verbose}" ] ; then
451 echo Caching $i in .Recover...
460 tic80_files="ChangeLog ChangeLog-9697 Makefile.in Makefile.am archures.c bfd-in2.h config.bfd configure configure.in targets.c coffcode.h coffswap.h"
461 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
462 for i in $tic80_files ; do
463 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
464 if [ -n "${verbose}" ] ; then
465 echo Keeping tic80 stuff in $i
470 for i in $tic80_files ; do
471 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
472 if [ -n "${verbose}" ] ; then
473 echo Removing traces of \"tic80\" from $i...
476 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
477 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
478 if [ -n "${verbose}" ] ; then
479 echo Caching $i in .Recover...
488 cygnus_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
489 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
490 for i in $cygnus_files ; do
491 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
492 if [ -n "${verbose}" ] ; then
493 echo Keeping Cygnus stuff in $i
498 for i in $cygnus_files ; do
499 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
500 if [ -n "${verbose}" ] ; then
501 echo Removing traces of \"cygnus\" from $i...
504 sed '/start\-sanitize\-cygnus/,/end\-sanitize\-cygnus/d' < $i > new
505 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
506 if [ -n "${verbose}" ] ; then
507 echo Caching $i in .Recover...
516 vr4320_files="ChangeLog archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
517 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
518 for i in $vr4320_files ; do
519 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
520 if [ -n "${verbose}" ] ; then
521 echo Keeping vr4320 stuff in $i
526 for i in $vr4320_files ; do
527 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
528 if [ -n "${verbose}" ] ; then
529 echo Removing traces of \"vr4320\" from $i...
532 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
533 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
534 if [ -n "${verbose}" ] ; then
535 echo Caching $i in .Recover...
544 vr4xxx_files="ChangeLog archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
545 if ( echo $* | grep keep\-vr4xxx > /dev/null ) ; then
546 for i in $vr4xxx_files ; do
547 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
548 if [ -n "${verbose}" ] ; then
549 echo Keeping vr4xxx stuff in $i
554 for i in $vr4xxx_files ; do
555 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
556 if [ -n "${verbose}" ] ; then
557 echo Removing traces of \"vr4xxx\" from $i...
560 sed '/start\-sanitize\-vr4xxx/,/end-\sanitize\-vr4xxx/d' < $i > new
561 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
562 if [ -n "${verbose}" ] ; then
563 echo Caching $i in .Recover...
572 m32rx_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
573 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
574 for i in $m32rx_files ; do
575 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
576 if [ -n "${verbose}" ] ; then
577 echo Keeping m32rx stuff in $i
582 for i in $m32rx_files ; do
583 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
584 if [ -n "${verbose}" ] ; then
585 echo Removing traces of \"m32rx\" from $i...
588 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
589 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
590 if [ -n "${verbose}" ] ; then
591 echo Caching $i in .Recover...
600 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
601 if ( echo $* | grep keep\-sky > /dev/null ) ; then
602 for i in $sky_files ; do
603 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
604 if [ -n "${verbose}" ] ; then
605 echo Keeping sky stuff in $i
610 for i in $sky_files ; do
611 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
612 if [ -n "${verbose}" ] ; then
613 echo Removing traces of \"sky\" from $i...
616 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
617 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
618 if [ -n "${verbose}" ] ; then
619 echo Caching $i in .Recover...
628 beos_files="ChangeLog config.bfd"
629 if ( echo $* | grep keep\-beos > /dev/null ) ; then
630 for i in $beos_files ; do
631 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
632 if [ -n "${verbose}" ] ; then
633 echo Keeping beos stuff in $i
638 for i in $beos_files ; do
639 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
640 if [ -n "${verbose}" ] ; then
641 echo Removing traces of \"beos\" from $i...
644 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
645 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
646 if [ -n "${verbose}" ] ; then
647 echo Caching $i in .Recover...
658 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
659 echo '***' Some mentions of Sanitize are still left in bfd/$i! 1>&2
663 for lost in .. $lose_these_too; do
664 if test $lost != ..; then
665 for i in Makefile.am Makefile.in config.bfd configure.host configure.in configure; do
666 if fgrep $lost $i >/dev/null 2>&1; then
667 echo '***' File $lost was sanitized out but is still mentioned in bfd/$i 1>&2
673 # This must come after all other sanitizations. Re-sanitize the .pot
675 if [ -n "${verbose}" ]; then
676 echo Re-computing files for gettext ...
679 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
680 if [ -n "${verbose}" ]; then
681 echo Caching po/POTFILES.in in .Recover...
683 mv po/POTFILES.in po/.Recover
685 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
687 if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
688 if [ -n "${verbose}" ]; then
689 echo Caching po/bfd.pot in .Recover...
691 mv po/bfd.pot po/.Recover
693 # If this fails, Sanitization must fail.
694 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/bfd.pot || exit 1