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
293 # The lines between the "Do-last:" line and the end of the file
294 # are executed as a /bin/sh shell script after everything else is
299 am33_files="ChangeLog archures.c bfd-in2.h cpu-m10300.c elf-m10300.c"
300 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
301 for i in $am33_files ; do
302 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
303 if [ -n "${verbose}" ] ; then
304 echo Keeping am33 stuff in $i
309 for i in $am33_files ; do
310 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
311 if [ -n "${verbose}" ] ; then
312 echo Removing traces of \"am33\" from $i...
315 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
316 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
317 if [ -n "${verbose}" ] ; then
318 echo Caching $i in .Recover...
327 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"
328 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
329 for i in $v850_files ; do
330 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
331 if [ -n "${verbose}" ] ; then
332 echo Keeping v850e stuff in $i
337 for i in $v850_files ; do
338 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
339 if [ -n "${verbose}" ] ; then
340 echo Removing traces of \"v850e\" from $i...
343 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
344 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
345 if [ -n "${verbose}" ] ; then
346 echo Caching $i in .Recover...
355 r5900_files="ChangeLog ChangeLog-9697 config.bfd archures.c bfd-in2.h cpu-mips.c elf32-mips.c libbfd.h reloc.c"
356 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
357 for i in $r5900_files ; do
358 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
359 if [ -n "${verbose}" ] ; then
360 echo Keeping r5900 stuff in $i
365 for i in $r5900_files ; do
366 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
367 if [ -n "${verbose}" ] ; then
368 echo Removing traces of \"r5900\" from $i...
371 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
372 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
373 if [ -n "${verbose}" ] ; then
374 echo Caching $i in .Recover...
383 tx19_files="archures.c bfd-in2.h cpu-mips.c"
384 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
385 for i in $tx19_files ; do
386 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
387 if [ -n "${verbose}" ] ; then
388 echo Keeping tx19 stuff in $i
393 for i in $tx19_files ; do
394 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
395 if [ -n "${verbose}" ] ; then
396 echo Removing traces of \"tx19\" from $i...
399 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
400 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
401 if [ -n "${verbose}" ] ; then
402 echo Caching $i in .Recover...
411 tx49_files="archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
412 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
413 for i in $tx49_files ; do
414 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
415 if [ -n "${verbose}" ] ; then
416 echo Keeping tx49 stuff in $i
421 for i in $tx49_files ; do
422 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
423 if [ -n "${verbose}" ] ; then
424 echo Removing traces of \"tx49\" from $i...
427 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
428 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
429 if [ -n "${verbose}" ] ; then
430 echo Caching $i in .Recover...
439 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"
440 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
441 for i in $tic80_files ; do
442 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
443 if [ -n "${verbose}" ] ; then
444 echo Keeping tic80 stuff in $i
449 for i in $tic80_files ; do
450 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
451 if [ -n "${verbose}" ] ; then
452 echo Removing traces of \"tic80\" from $i...
455 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
456 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
457 if [ -n "${verbose}" ] ; then
458 echo Caching $i in .Recover...
467 cygnus_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
468 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
469 for i in $cygnus_files ; do
470 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
471 if [ -n "${verbose}" ] ; then
472 echo Keeping Cygnus stuff in $i
477 for i in $cygnus_files ; do
478 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
479 if [ -n "${verbose}" ] ; then
480 echo Removing traces of \"cygnus\" from $i...
483 sed '/start\-sanitize\-cygnus/,/end\-sanitize\-cygnus/d' < $i > new
484 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
485 if [ -n "${verbose}" ] ; then
486 echo Caching $i in .Recover...
495 vr4320_files="ChangeLog archures.c bfd-in2.h cpu-mips.c elf32-mips.c"
496 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
497 for i in $vr4320_files ; do
498 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
499 if [ -n "${verbose}" ] ; then
500 echo Keeping vr4320 stuff in $i
505 for i in $vr4320_files ; do
506 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
507 if [ -n "${verbose}" ] ; then
508 echo Removing traces of \"vr4320\" from $i...
511 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
512 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
513 if [ -n "${verbose}" ] ; then
514 echo Caching $i in .Recover...
523 m32rx_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
524 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
525 for i in $m32rx_files ; do
526 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
527 if [ -n "${verbose}" ] ; then
528 echo Keeping m32rx stuff in $i
533 for i in $m32rx_files ; do
534 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
535 if [ -n "${verbose}" ] ; then
536 echo Removing traces of \"m32rx\" from $i...
539 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
540 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
541 if [ -n "${verbose}" ] ; then
542 echo Caching $i in .Recover...
551 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
552 if ( echo $* | grep keep\-sky > /dev/null ) ; then
553 for i in $sky_files ; do
554 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
555 if [ -n "${verbose}" ] ; then
556 echo Keeping sky stuff in $i
561 for i in $sky_files ; do
562 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
563 if [ -n "${verbose}" ] ; then
564 echo Removing traces of \"sky\" from $i...
567 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
568 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
569 if [ -n "${verbose}" ] ; then
570 echo Caching $i in .Recover...
579 beos_files="ChangeLog config.bfd"
580 if ( echo $* | grep keep\-beos > /dev/null ) ; then
581 for i in $beos_files ; do
582 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
583 if [ -n "${verbose}" ] ; then
584 echo Keeping beos stuff in $i
589 for i in $beos_files ; do
590 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
591 if [ -n "${verbose}" ] ; then
592 echo Removing traces of \"beos\" from $i...
595 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
596 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
597 if [ -n "${verbose}" ] ; then
598 echo Caching $i in .Recover...
609 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
610 echo '***' Some mentions of Sanitize are still left in bfd/$i! 1>&2
614 for lost in .. $lose_these_too; do
615 if test $lost != ..; then
616 for i in Makefile.am Makefile.in config.bfd configure.host configure.in configure; do
617 if fgrep $lost $i >/dev/null 2>&1; then
618 echo '***' File $lost was sanitized out but is still mentioned in bfd/$i 1>&2
624 # This must come after all other sanitizations. Re-sanitize the .pot
626 if [ -n "${verbose}" ]; then
627 echo Re-computing files for gettext ...
630 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
631 if [ -n "${verbose}" ]; then
632 echo Caching po/POTFILES.in in .Recover...
634 mv po/POTFILES.in po/.Recover
636 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
638 if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
639 if [ -n "${verbose}" ]; then
640 echo Caching po/bfd.pot in .Recover...
642 mv po/bfd.pot po/.Recover
644 # If this fails, Sanitization must fail.
645 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/bfd.pot || exit 1