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 armelf_files="elf32-arm.c"
27 if ( echo $* | grep keep\-armelf > /dev/null ) ; then
28 keep_these_too="${armelf_files} ${keep_these_too}"
30 lose_these_too="${armelf_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
299 # The lines between the "Do-last:" line and the end of the file
300 # are executed as a /bin/sh shell script after everything else is
305 am33_files="ChangeLog archures.c bfd-in2.h cpu-m10300.c elf-m10300.c"
306 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
307 for i in $am33_files ; do
308 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
309 if [ -n "${verbose}" ] ; then
310 echo Keeping am33 stuff in $i
315 for i in $am33_files ; do
316 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
317 if [ -n "${verbose}" ] ; then
318 echo Removing traces of \"am33\" from $i...
321 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
322 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
323 if [ -n "${verbose}" ] ; then
324 echo Caching $i in .Recover...
333 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"
334 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
335 for i in $v850_files ; do
336 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
337 if [ -n "${verbose}" ] ; then
338 echo Keeping v850e stuff in $i
343 for i in $v850_files ; do
344 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
345 if [ -n "${verbose}" ] ; then
346 echo Removing traces of \"v850e\" from $i...
349 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
350 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
351 if [ -n "${verbose}" ] ; then
352 echo Caching $i in .Recover...
361 r5900_files="ChangeLog ChangeLog-9697 config.bfd archures.c bfd-in2.h cpu-mips.c elf32-mips.c libbfd.h reloc.c"
362 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
363 for i in $r5900_files ; do
364 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
365 if [ -n "${verbose}" ] ; then
366 echo Keeping r5900 stuff in $i
371 for i in $r5900_files ; do
372 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
373 if [ -n "${verbose}" ] ; then
374 echo Removing traces of \"r5900\" from $i...
377 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
378 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
379 if [ -n "${verbose}" ] ; then
380 echo Caching $i in .Recover...
389 tx19_files="archures.c bfd-in2.h cpu-mips.c"
390 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
391 for i in $tx19_files ; do
392 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
393 if [ -n "${verbose}" ] ; then
394 echo Keeping tx19 stuff in $i
399 for i in $tx19_files ; do
400 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
401 if [ -n "${verbose}" ] ; then
402 echo Removing traces of \"tx19\" from $i...
405 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
406 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
407 if [ -n "${verbose}" ] ; then
408 echo Caching $i in .Recover...
417 tx49_files="archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
418 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
419 for i in $tx49_files ; do
420 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
421 if [ -n "${verbose}" ] ; then
422 echo Keeping tx49 stuff in $i
427 for i in $tx49_files ; do
428 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
429 if [ -n "${verbose}" ] ; then
430 echo Removing traces of \"tx49\" from $i...
433 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
434 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
435 if [ -n "${verbose}" ] ; then
436 echo Caching $i in .Recover...
445 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"
446 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
447 for i in $tic80_files ; do
448 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
449 if [ -n "${verbose}" ] ; then
450 echo Keeping tic80 stuff in $i
455 for i in $tic80_files ; do
456 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
457 if [ -n "${verbose}" ] ; then
458 echo Removing traces of \"tic80\" from $i...
461 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
462 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
463 if [ -n "${verbose}" ] ; then
464 echo Caching $i in .Recover...
473 cygnus_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
474 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
475 for i in $cygnus_files ; do
476 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
477 if [ -n "${verbose}" ] ; then
478 echo Keeping Cygnus stuff in $i
483 for i in $cygnus_files ; do
484 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
485 if [ -n "${verbose}" ] ; then
486 echo Removing traces of \"cygnus\" from $i...
489 sed '/start\-sanitize\-cygnus/,/end\-sanitize\-cygnus/d' < $i > new
490 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
491 if [ -n "${verbose}" ] ; then
492 echo Caching $i in .Recover...
501 vr4320_files="ChangeLog archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
502 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
503 for i in $vr4320_files ; do
504 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
505 if [ -n "${verbose}" ] ; then
506 echo Keeping vr4320 stuff in $i
511 for i in $vr4320_files ; do
512 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
513 if [ -n "${verbose}" ] ; then
514 echo Removing traces of \"vr4320\" from $i...
517 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
518 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
519 if [ -n "${verbose}" ] ; then
520 echo Caching $i in .Recover...
529 m32rx_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
530 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
531 for i in $m32rx_files ; do
532 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
533 if [ -n "${verbose}" ] ; then
534 echo Keeping m32rx stuff in $i
539 for i in $m32rx_files ; do
540 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
541 if [ -n "${verbose}" ] ; then
542 echo Removing traces of \"m32rx\" from $i...
545 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
546 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
547 if [ -n "${verbose}" ] ; then
548 echo Caching $i in .Recover...
557 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
558 if ( echo $* | grep keep\-sky > /dev/null ) ; then
559 for i in $sky_files ; do
560 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
561 if [ -n "${verbose}" ] ; then
562 echo Keeping sky stuff in $i
567 for i in $sky_files ; do
568 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
569 if [ -n "${verbose}" ] ; then
570 echo Removing traces of \"sky\" from $i...
573 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
574 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
575 if [ -n "${verbose}" ] ; then
576 echo Caching $i in .Recover...
585 beos_files="ChangeLog config.bfd"
586 if ( echo $* | grep keep\-beos > /dev/null ) ; then
587 for i in $beos_files ; do
588 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
589 if [ -n "${verbose}" ] ; then
590 echo Keeping beos stuff in $i
595 for i in $beos_files ; do
596 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
597 if [ -n "${verbose}" ] ; then
598 echo Removing traces of \"beos\" from $i...
601 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
602 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
603 if [ -n "${verbose}" ] ; then
604 echo Caching $i in .Recover...
613 armelf_files="ChangeLog Makefile.am Makefile.in config.bfd configure configure.in elf.c targets.c"
614 if ( echo $* | grep keep\-armelf > /dev/null ) ; then
615 for i in $armelf_files ; do
616 if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then
617 if [ -n "${verbose}" ] ; then
618 echo Keeping armelf stuff in $i
623 for i in $armelf_files ; do
624 if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then
625 if [ -n "${verbose}" ] ; then
626 echo Removing traces of \"armelf\" from $i...
629 sed '/start\-sanitize\-armelf/,/end-\sanitize\-armelf/d' < $i > new
630 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
631 if [ -n "${verbose}" ] ; then
632 echo Caching $i in .Recover...
642 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
643 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
648 # This must come after all other sanitizations. Re-sanitize the .pot
650 if [ -n "${verbose}" ]; then
651 echo Re-computing files for gettext ...
654 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
655 if [ -n "${verbose}" ]; then
656 echo Caching po/POTFILES.in in .Recover...
658 mv po/POTFILES.in po/.Recover
660 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
662 if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
663 if [ -n "${verbose}" ]; then
664 echo Caching po/bfd.pot in .Recover...
666 mv po/bfd.pot po/.Recover
668 # If this fails, Sanitization must fail.
669 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/bfd.pot || exit 1