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
292 # The lines between the "Do-last:" line and the end of the file
293 # are executed as a /bin/sh shell script after everything else is
298 am33_files="ChangeLog archures.c bfd-in2.h cpu-m10300.c elf-m10300.c"
299 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
300 for i in $am33_files ; do
301 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
302 if [ -n "${verbose}" ] ; then
303 echo Keeping am33 stuff in $i
308 for i in $am33_files ; do
309 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
310 if [ -n "${verbose}" ] ; then
311 echo Removing traces of \"am33\" from $i...
314 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
315 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
316 if [ -n "${verbose}" ] ; then
317 echo Caching $i in .Recover...
326 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"
327 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
328 for i in $v850_files ; do
329 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
330 if [ -n "${verbose}" ] ; then
331 echo Keeping v850e stuff in $i
336 for i in $v850_files ; do
337 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
338 if [ -n "${verbose}" ] ; then
339 echo Removing traces of \"v850e\" from $i...
342 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
343 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
344 if [ -n "${verbose}" ] ; then
345 echo Caching $i in .Recover...
354 r5900_files="ChangeLog ChangeLog-9697 config.bfd archures.c bfd-in2.h cpu-mips.c elf32-mips.c libbfd.h reloc.c"
355 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
356 for i in $r5900_files ; do
357 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
358 if [ -n "${verbose}" ] ; then
359 echo Keeping r5900 stuff in $i
364 for i in $r5900_files ; do
365 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
366 if [ -n "${verbose}" ] ; then
367 echo Removing traces of \"r5900\" from $i...
370 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
371 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
372 if [ -n "${verbose}" ] ; then
373 echo Caching $i in .Recover...
382 tx19_files="archures.c bfd-in2.h cpu-mips.c"
383 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
384 for i in $tx19_files ; do
385 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
386 if [ -n "${verbose}" ] ; then
387 echo Keeping tx19 stuff in $i
392 for i in $tx19_files ; do
393 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
394 if [ -n "${verbose}" ] ; then
395 echo Removing traces of \"tx19\" from $i...
398 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
399 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
400 if [ -n "${verbose}" ] ; then
401 echo Caching $i in .Recover...
410 tx49_files="archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
411 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
412 for i in $tx49_files ; do
413 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
414 if [ -n "${verbose}" ] ; then
415 echo Keeping tx49 stuff in $i
420 for i in $tx49_files ; do
421 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
422 if [ -n "${verbose}" ] ; then
423 echo Removing traces of \"tx49\" from $i...
426 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
427 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
428 if [ -n "${verbose}" ] ; then
429 echo Caching $i in .Recover...
438 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"
439 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
440 for i in $tic80_files ; do
441 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
442 if [ -n "${verbose}" ] ; then
443 echo Keeping tic80 stuff in $i
448 for i in $tic80_files ; do
449 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
450 if [ -n "${verbose}" ] ; then
451 echo Removing traces of \"tic80\" from $i...
454 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
455 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
456 if [ -n "${verbose}" ] ; then
457 echo Caching $i in .Recover...
466 cygnus_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
467 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
468 for i in $cygnus_files ; do
469 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
470 if [ -n "${verbose}" ] ; then
471 echo Keeping Cygnus stuff in $i
476 for i in $cygnus_files ; do
477 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
478 if [ -n "${verbose}" ] ; then
479 echo Removing traces of \"cygnus\" from $i...
482 sed '/start\-sanitize\-cygnus/,/end\-sanitize\-cygnus/d' < $i > new
483 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
484 if [ -n "${verbose}" ] ; then
485 echo Caching $i in .Recover...
494 vr4320_files="ChangeLog archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
495 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
496 for i in $vr4320_files ; do
497 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
498 if [ -n "${verbose}" ] ; then
499 echo Keeping vr4320 stuff in $i
504 for i in $vr4320_files ; do
505 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
506 if [ -n "${verbose}" ] ; then
507 echo Removing traces of \"vr4320\" from $i...
510 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
511 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
512 if [ -n "${verbose}" ] ; then
513 echo Caching $i in .Recover...
522 m32rx_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
523 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
524 for i in $m32rx_files ; do
525 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
526 if [ -n "${verbose}" ] ; then
527 echo Keeping m32rx stuff in $i
532 for i in $m32rx_files ; do
533 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
534 if [ -n "${verbose}" ] ; then
535 echo Removing traces of \"m32rx\" from $i...
538 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
539 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
540 if [ -n "${verbose}" ] ; then
541 echo Caching $i in .Recover...
550 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
551 if ( echo $* | grep keep\-sky > /dev/null ) ; then
552 for i in $sky_files ; do
553 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
554 if [ -n "${verbose}" ] ; then
555 echo Keeping sky stuff in $i
560 for i in $sky_files ; do
561 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
562 if [ -n "${verbose}" ] ; then
563 echo Removing traces of \"sky\" from $i...
566 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
567 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
568 if [ -n "${verbose}" ] ; then
569 echo Caching $i in .Recover...
578 beos_files="ChangeLog config.bfd"
579 if ( echo $* | grep keep\-beos > /dev/null ) ; then
580 for i in $beos_files ; do
581 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
582 if [ -n "${verbose}" ] ; then
583 echo Keeping beos stuff in $i
588 for i in $beos_files ; do
589 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
590 if [ -n "${verbose}" ] ; then
591 echo Removing traces of \"beos\" from $i...
594 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
595 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
596 if [ -n "${verbose}" ] ; then
597 echo Caching $i in .Recover...
608 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
609 echo '***' Some mentions of Sanitize are still left in bfd/$i! 1>&2
613 for lost in .. $lose_these_too; do
614 if test $lost != ..; then
615 for i in Makefile.am Makefile.in config.bfd configure.host configure.in configure; do
616 if fgrep $lost $i >/dev/null 2>&1; then
617 echo '***' File $lost was sanitized out but is still mentioned in bfd/$i 1>&2
623 # This must come after all other sanitizations. Re-sanitize the .pot
625 if [ -n "${verbose}" ]; then
626 echo Re-computing files for gettext ...
629 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
630 if [ -n "${verbose}" ]; then
631 echo Caching po/POTFILES.in in .Recover...
633 mv po/POTFILES.in po/.Recover
635 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
637 if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
638 if [ -n "${verbose}" ]; then
639 echo Caching po/bfd.pot in .Recover...
641 mv po/bfd.pot po/.Recover
643 # If this fails, Sanitization must fail.
644 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/bfd.pot || exit 1