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 d30v_files="cpu-d30v.c elf32-d30v.c"
20 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
21 keep_these_too="${d30v_files} ${keep_these_too}"
23 lose_these_too="${d30v_files} ${lose_these_too}"
26 tic80_files="cpu-tic80.c coff-tic80.c"
28 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
29 keep_these_too="${tic80_files} ${keep_these_too}"
31 lose_these_too="${tic80_files} ${lose_these_too}"
34 # All files listed between the "Things-to-keep:" line and the
35 # "Files-to-sed:" 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
296 d30v_files="ChangeLog ChangeLog.2 Makefile.in Makefile.am archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h"
297 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
298 for i in $d30v_files ; do
299 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
300 if [ -n "${verbose}" ] ; then
301 echo Keeping d30v stuff in $i
306 for i in $d30v_files ; do
307 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
308 if [ -n "${verbose}" ] ; then
309 echo Removing traces of \"d30v\" from $i...
312 sed '/start\-sanitize\-d30v/,/end-\sanitize\-d30v/d' < $i > new
313 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
314 if [ -n "${verbose}" ] ; then
315 echo Caching $i in .Recover...
324 v850_files="ChangeLog 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"
325 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
326 for i in $v850_files ; do
327 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
328 if [ -n "${verbose}" ] ; then
329 echo Keeping v850e stuff in $i
334 for i in $v850_files ; do
335 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
336 if [ -n "${verbose}" ] ; then
337 echo Removing traces of \"v850e\" from $i...
340 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
341 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
342 if [ -n "${verbose}" ] ; then
343 echo Caching $i in .Recover...
352 r5900_files="ChangeLog config.bfd archures.c bfd-in2.h cpu-mips.c"
353 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
354 for i in $r5900_files ; do
355 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
356 if [ -n "${verbose}" ] ; then
357 echo Keeping r5900 stuff in $i
362 for i in $r5900_files ; do
363 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
364 if [ -n "${verbose}" ] ; then
365 echo Removing traces of \"r5900\" from $i...
368 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
369 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
370 if [ -n "${verbose}" ] ; then
371 echo Caching $i in .Recover...
380 tx19_files="archures.c bfd-in2.h cpu-mips.c"
381 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
382 for i in $tx19_files ; do
383 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
384 if [ -n "${verbose}" ] ; then
385 echo Keeping tx19 stuff in $i
390 for i in $tx19_files ; do
391 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
392 if [ -n "${verbose}" ] ; then
393 echo Removing traces of \"tx19\" from $i...
396 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
397 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
398 if [ -n "${verbose}" ] ; then
399 echo Caching $i in .Recover...
408 tx49_files="archures.c bfd-in2.h cpu-mips.c"
409 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
410 for i in $tx49_files ; do
411 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
412 if [ -n "${verbose}" ] ; then
413 echo Keeping tx49 stuff in $i
418 for i in $tx49_files ; do
419 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
420 if [ -n "${verbose}" ] ; then
421 echo Removing traces of \"tx49\" from $i...
424 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
425 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
426 if [ -n "${verbose}" ] ; then
427 echo Caching $i in .Recover...
436 sh4_files="ChangeLog config.bfd archures.c bfd-in2.h cpu-sh.c"
437 if ( echo $* | grep keep\-sh4 > /dev/null ) ; then
438 for i in $sh4_files ; do
439 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
440 if [ -n "${verbose}" ] ; then
441 echo Keeping sh4 stuff in $i
446 for i in $sh4_files ; do
447 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
448 if [ -n "${verbose}" ] ; then
449 echo Removing traces of \"sh4\" from $i...
452 sed '/start\-sanitize\-sh4/,/end-\sanitize\-sh4/d' < $i > new
453 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
454 if [ -n "${verbose}" ] ; then
455 echo Caching $i in .Recover...
464 tic80_files="ChangeLog Makefile.in Makefile.am archures.c bfd-in2.h config.bfd configure configure.in targets.c coffcode.h coffswap.h"
465 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
466 for i in $tic80_files ; do
467 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
468 if [ -n "${verbose}" ] ; then
469 echo Keeping tic80 stuff in $i
474 for i in $tic80_files ; do
475 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
476 if [ -n "${verbose}" ] ; then
477 echo Removing traces of \"tic80\" from $i...
480 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
481 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
482 if [ -n "${verbose}" ] ; then
483 echo Caching $i in .Recover...
492 gm_files="ChangeLog ChangeLog.2 config.bfd"
493 if ( echo $* | grep keep\-gm > /dev/null ) ; then
494 for i in $gm_files ; do
495 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
496 if [ -n "${verbose}" ] ; then
497 echo Keeping gm stuff in $i
502 for i in $gm_files ; do
503 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
504 if [ -n "${verbose}" ] ; then
505 echo Removing traces of \"gm\" from $i...
508 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
509 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
510 if [ -n "${verbose}" ] ; then
511 echo Caching $i in .Recover...
520 vr5400_files="ChangeLog archures.c bfd-in2.h bfd-in.h cpu-mips.c"
521 if ( echo $* | grep keep\-vr5400 > /dev/null ) ; then
522 for i in $vr5400_files ; do
523 if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
524 if [ -n "${verbose}" ] ; then
525 echo Keeping vr5400 stuff in $i
530 for i in $vr5400_files ; do
531 if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
532 if [ -n "${verbose}" ] ; then
533 echo Removing traces of \"vr5400\" from $i...
536 sed '/start\-sanitize\-vr5400/,/end-\sanitize\-vr5400/d' < $i > new
537 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
538 if [ -n "${verbose}" ] ; then
539 echo Caching $i in .Recover...
548 m32rx_files="ChangeLog archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
549 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
550 for i in $m32rx_files ; do
551 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
552 if [ -n "${verbose}" ] ; then
553 echo Keeping m32rx stuff in $i
558 for i in $m32rx_files ; do
559 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
560 if [ -n "${verbose}" ] ; then
561 echo Removing traces of \"m32rx\" from $i...
564 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
565 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
566 if [ -n "${verbose}" ] ; then
567 echo Caching $i in .Recover...
576 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
577 if ( echo $* | grep keep\-sky > /dev/null ) ; then
578 for i in $sky_files ; do
579 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
580 if [ -n "${verbose}" ] ; then
581 echo Keeping sky stuff in $i
586 for i in $sky_files ; do
587 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
588 if [ -n "${verbose}" ] ; then
589 echo Removing traces of \"sky\" from $i...
592 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
593 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
594 if [ -n "${verbose}" ] ; then
595 echo Caching $i in .Recover...
605 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
606 echo '***' Some mentions of Sanitize are still left in $i! 1>&2