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
293 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"
294 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
295 for i in $d30v_files ; do
296 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
297 if [ -n "${verbose}" ] ; then
298 echo Keeping d30v stuff in $i
303 for i in $d30v_files ; do
304 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
305 if [ -n "${verbose}" ] ; then
306 echo Removing traces of \"d30v\" from $i...
309 sed '/start\-sanitize\-d30v/,/end-\sanitize\-d30v/d' < $i > new
310 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
311 if [ -n "${verbose}" ] ; then
312 echo Caching $i in .Recover...
321 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"
322 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
323 for i in $v850_files ; do
324 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
325 if [ -n "${verbose}" ] ; then
326 echo Keeping v850e stuff in $i
331 for i in $v850_files ; do
332 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
333 if [ -n "${verbose}" ] ; then
334 echo Removing traces of \"v850e\" from $i...
337 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
338 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
339 if [ -n "${verbose}" ] ; then
340 echo Caching $i in .Recover...
349 r5900_files="ChangeLog config.bfd archures.c bfd-in2.h cpu-mips.c"
350 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
351 for i in $r5900_files ; do
352 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
353 if [ -n "${verbose}" ] ; then
354 echo Keeping r5900 stuff in $i
359 for i in $r5900_files ; do
360 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
361 if [ -n "${verbose}" ] ; then
362 echo Removing traces of \"r5900\" from $i...
365 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
366 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
367 if [ -n "${verbose}" ] ; then
368 echo Caching $i in .Recover...
377 tx19_files="archures.c bfd-in2.h cpu-mips.c"
378 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
379 for i in $tx19_files ; do
380 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
381 if [ -n "${verbose}" ] ; then
382 echo Keeping tx19 stuff in $i
387 for i in $tx19_files ; do
388 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
389 if [ -n "${verbose}" ] ; then
390 echo Removing traces of \"tx19\" from $i...
393 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
394 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
395 if [ -n "${verbose}" ] ; then
396 echo Caching $i in .Recover...
405 tx49_files="archures.c bfd-in2.h cpu-mips.c"
406 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
407 for i in $tx49_files ; do
408 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
409 if [ -n "${verbose}" ] ; then
410 echo Keeping tx49 stuff in $i
415 for i in $tx49_files ; do
416 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
417 if [ -n "${verbose}" ] ; then
418 echo Removing traces of \"tx49\" from $i...
421 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
422 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
423 if [ -n "${verbose}" ] ; then
424 echo Caching $i in .Recover...
433 sh4_files="ChangeLog config.bfd archures.c bfd-in2.h cpu-sh.c"
434 if ( echo $* | grep keep\-sh4 > /dev/null ) ; then
435 for i in $sh4_files ; do
436 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
437 if [ -n "${verbose}" ] ; then
438 echo Keeping sh4 stuff in $i
443 for i in $sh4_files ; do
444 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
445 if [ -n "${verbose}" ] ; then
446 echo Removing traces of \"sh4\" from $i...
449 sed '/start\-sanitize\-sh4/,/end-\sanitize\-sh4/d' < $i > new
450 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
451 if [ -n "${verbose}" ] ; then
452 echo Caching $i in .Recover...
461 tic80_files="ChangeLog Makefile.in Makefile.am archures.c bfd-in2.h config.bfd configure configure.in targets.c coffcode.h coffswap.h"
462 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
463 for i in $tic80_files ; do
464 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
465 if [ -n "${verbose}" ] ; then
466 echo Keeping tic80 stuff in $i
471 for i in $tic80_files ; do
472 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
473 if [ -n "${verbose}" ] ; then
474 echo Removing traces of \"tic80\" from $i...
477 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
478 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
479 if [ -n "${verbose}" ] ; then
480 echo Caching $i in .Recover...
489 gm_files="ChangeLog ChangeLog.2 config.bfd"
490 if ( echo $* | grep keep\-gm > /dev/null ) ; then
491 for i in $gm_files ; do
492 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
493 if [ -n "${verbose}" ] ; then
494 echo Keeping gm stuff in $i
499 for i in $gm_files ; do
500 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
501 if [ -n "${verbose}" ] ; then
502 echo Removing traces of \"gm\" from $i...
505 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
506 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
507 if [ -n "${verbose}" ] ; then
508 echo Caching $i in .Recover...
517 vr5400_files="ChangeLog archures.c bfd-in2.h bfd-in.h cpu-mips.c"
518 if ( echo $* | grep keep\-vr5400 > /dev/null ) ; then
519 for i in $vr5400_files ; do
520 if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
521 if [ -n "${verbose}" ] ; then
522 echo Keeping vr5400 stuff in $i
527 for i in $vr5400_files ; do
528 if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
529 if [ -n "${verbose}" ] ; then
530 echo Removing traces of \"vr5400\" from $i...
533 sed '/start\-sanitize\-vr5400/,/end-\sanitize\-vr5400/d' < $i > new
534 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
535 if [ -n "${verbose}" ] ; then
536 echo Caching $i in .Recover...
545 m32rx_files="ChangeLog archures.c bfd-in2.h elf32-m32r.c cpu-m32r.c"
546 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
547 for i in $m32rx_files ; do
548 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
549 if [ -n "${verbose}" ] ; then
550 echo Keeping m32rx stuff in $i
555 for i in $m32rx_files ; do
556 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
557 if [ -n "${verbose}" ] ; then
558 echo Removing traces of \"m32rx\" from $i...
561 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
562 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
563 if [ -n "${verbose}" ] ; then
564 echo Caching $i in .Recover...
573 sky_files="ChangeLog archures.c elf32-mips.c reloc.c cpu-mips.c config.bfd configure.in configure bfd-in2.h libbfd.h"
574 if ( echo $* | grep keep\-sky > /dev/null ) ; then
575 for i in $sky_files ; do
576 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
577 if [ -n "${verbose}" ] ; then
578 echo Keeping sky stuff in $i
583 for i in $sky_files ; do
584 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
585 if [ -n "${verbose}" ] ; then
586 echo Removing traces of \"sky\" from $i...
589 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
590 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
591 if [ -n "${verbose}" ] ; then
592 echo Caching $i in .Recover...
602 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
603 echo '***' Some mentions of Sanitize are still left in $i! 1>&2