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 am33_files="ChangeLog archures.c bfd-in2.h cpu-m10300.c elf-m10300.c"
303 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
304 for i in $am33_files ; do
305 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
306 if [ -n "${verbose}" ] ; then
307 echo Keeping am33 stuff in $i
312 for i in $am33_files ; do
313 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
314 if [ -n "${verbose}" ] ; then
315 echo Removing traces of \"am33\" from $i...
318 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
319 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
320 if [ -n "${verbose}" ] ; then
321 echo Caching $i in .Recover...
330 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"
331 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
332 for i in $v850_files ; do
333 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
334 if [ -n "${verbose}" ] ; then
335 echo Keeping v850e stuff in $i
340 for i in $v850_files ; do
341 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
342 if [ -n "${verbose}" ] ; then
343 echo Removing traces of \"v850e\" from $i...
346 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
347 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
348 if [ -n "${verbose}" ] ; then
349 echo Caching $i in .Recover...
358 r5900_files="ChangeLog ChangeLog-9697 config.bfd archures.c bfd-in2.h cpu-mips.c elf32-mips.c libbfd.h reloc.c"
359 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
360 for i in $r5900_files ; do
361 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
362 if [ -n "${verbose}" ] ; then
363 echo Keeping r5900 stuff in $i
368 for i in $r5900_files ; do
369 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
370 if [ -n "${verbose}" ] ; then
371 echo Removing traces of \"r5900\" from $i...
374 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
375 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
376 if [ -n "${verbose}" ] ; then
377 echo Caching $i in .Recover...
386 tx19_files="archures.c bfd-in2.h cpu-mips.c"
387 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
388 for i in $tx19_files ; do
389 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
390 if [ -n "${verbose}" ] ; then
391 echo Keeping tx19 stuff in $i
396 for i in $tx19_files ; do
397 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
398 if [ -n "${verbose}" ] ; then
399 echo Removing traces of \"tx19\" from $i...
402 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
403 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
404 if [ -n "${verbose}" ] ; then
405 echo Caching $i in .Recover...
414 tx49_files="archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
415 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
416 for i in $tx49_files ; do
417 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
418 if [ -n "${verbose}" ] ; then
419 echo Keeping tx49 stuff in $i
424 for i in $tx49_files ; do
425 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
426 if [ -n "${verbose}" ] ; then
427 echo Removing traces of \"tx49\" from $i...
430 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
431 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
432 if [ -n "${verbose}" ] ; then
433 echo Caching $i in .Recover...
442 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"
443 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
444 for i in $tic80_files ; do
445 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
446 if [ -n "${verbose}" ] ; then
447 echo Keeping tic80 stuff in $i
452 for i in $tic80_files ; do
453 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
454 if [ -n "${verbose}" ] ; then
455 echo Removing traces of \"tic80\" from $i...
458 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
459 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
460 if [ -n "${verbose}" ] ; then
461 echo Caching $i in .Recover...
470 cygnus_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
471 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
472 for i in $cygnus_files ; do
473 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
474 if [ -n "${verbose}" ] ; then
475 echo Keeping Cygnus stuff in $i
480 for i in $cygnus_files ; do
481 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
482 if [ -n "${verbose}" ] ; then
483 echo Removing traces of \"cygnus\" from $i...
486 sed '/start\-sanitize\-cygnus/,/end\-sanitize\-cygnus/d' < $i > new
487 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
488 if [ -n "${verbose}" ] ; then
489 echo Caching $i in .Recover...
498 vr4320_files="ChangeLog archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
499 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
500 for i in $vr4320_files ; do
501 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
502 if [ -n "${verbose}" ] ; then
503 echo Keeping vr4320 stuff in $i
508 for i in $vr4320_files ; do
509 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
510 if [ -n "${verbose}" ] ; then
511 echo Removing traces of \"vr4320\" from $i...
514 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
515 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
516 if [ -n "${verbose}" ] ; then
517 echo Caching $i in .Recover...
526 m32rx_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
527 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
528 for i in $m32rx_files ; do
529 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
530 if [ -n "${verbose}" ] ; then
531 echo Keeping m32rx stuff in $i
536 for i in $m32rx_files ; do
537 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
538 if [ -n "${verbose}" ] ; then
539 echo Removing traces of \"m32rx\" from $i...
542 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
543 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
544 if [ -n "${verbose}" ] ; then
545 echo Caching $i in .Recover...
554 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
555 if ( echo $* | grep keep\-sky > /dev/null ) ; then
556 for i in $sky_files ; do
557 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
558 if [ -n "${verbose}" ] ; then
559 echo Keeping sky stuff in $i
564 for i in $sky_files ; do
565 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
566 if [ -n "${verbose}" ] ; then
567 echo Removing traces of \"sky\" from $i...
570 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
571 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
572 if [ -n "${verbose}" ] ; then
573 echo Caching $i in .Recover...
582 beos_files="ChangeLog config.bfd"
583 if ( echo $* | grep keep\-beos > /dev/null ) ; then
584 for i in $beos_files ; do
585 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
586 if [ -n "${verbose}" ] ; then
587 echo Keeping beos stuff in $i
592 for i in $beos_files ; do
593 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
594 if [ -n "${verbose}" ] ; then
595 echo Removing traces of \"beos\" from $i...
598 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
599 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
600 if [ -n "${verbose}" ] ; then
601 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 bfd/$i! 1>&2
617 for lost in .. $lose_these_too; do
618 if test $lost != ..; then
619 for i in Makefile.am Makefile.in config.bfd configure.host configure.in configure; do
620 if fgrep $lost $i >/dev/null 2>&1; then
621 echo '***' File $lost was sanitized out but is still mentioned in bfd/$i 1>&2
627 # This must come after all other sanitizations. Re-sanitize the .pot
629 if [ -n "${verbose}" ]; then
630 echo Re-computing files for gettext ...
633 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
634 if [ -n "${verbose}" ]; then
635 echo Caching po/POTFILES.in in .Recover...
637 mv po/POTFILES.in po/.Recover
639 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
641 if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
642 if [ -n "${verbose}" ]; then
643 echo Caching po/bfd.pot in .Recover...
645 mv po/bfd.pot po/.Recover
647 # If this fails, Sanitization must fail.
648 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/bfd.pot || exit 1