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 v850_files="elf32-v850.c"
28 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
29 keep_these_too="cpu-v850.c ${v850_files} ${keep_these_too}"
31 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
32 keep_these_too="cpu-v850.c ${v850_files} ${keep_these_too}"
34 if ( echo $* | grep keep\-v850eq > /dev/null ) ; then
35 keep_these_too="cpu-v850.c ${v850_files} ${keep_these_too}"
37 lose_these_too="cpu-v850.c ${v850_files} ${lose_these_too}"
42 tic80_files="cpu-tic80.c coff-tic80.c"
44 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
45 keep_these_too="${tic80_files} ${keep_these_too}"
47 lose_these_too="${tic80_files} ${lose_these_too}"
50 # All files listed between the "Things-to-keep:" line and the
51 # "Files-to-sed:" line will be kept. All other files will be removed.
52 # Directories listed in this section will have their own Sanitize
53 # called. Directories not listed will be removed in their entirety
306 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"
307 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
308 for i in $d30v_files ; do
309 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
310 if [ -n "${verbose}" ] ; then
311 echo Keeping d30v stuff in $i
316 for i in $d30v_files ; do
317 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
318 if [ -n "${verbose}" ] ; then
319 echo Removing traces of \"d30v\" from $i...
322 sed '/start\-sanitize\-d30v/,/end-\sanitize\-d30v/d' < $i > new
323 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
324 if [ -n "${verbose}" ] ; then
325 echo Caching $i in .Recover...
334 v850_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 elf32-v850.c"
335 v850e_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"
336 if ( echo $* | grep keep\-v850eq > /dev/null ) ; then
337 for i in $v850_files ; do
338 if test -r $i && (grep sanitize-v850eq $i > /dev/null) ; then
339 if [ -n "${verbose}" ] ; then
340 echo Keeping v850eq stuff in $i
345 for i in $v850_files ; do
346 if test -f $i && (grep sanitize-v850eq $i > /dev/null) ; then
347 if [ -n "${verbose}" ] ; then
348 echo Removing traces of \"v850eq\" from $i...
351 sed '/start\-sanitize\-v850eq/,/end\-sanitize\-v850eq/d' < $i > new
352 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
353 if [ -n "${verbose}" ] ; then
354 echo Caching $i in .Recover...
362 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
363 for i in $v850_files ; do
364 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
365 if [ -n "${verbose}" ] ; then
366 echo Keeping v850e stuff in $i
371 for i in $v850_files ; do
372 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
373 if [ -n "${verbose}" ] ; then
374 echo Removing traces of \"v850e\" from $i...
377 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
378 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
379 if [ -n "${verbose}" ] ; then
380 echo Caching $i in .Recover...
389 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
390 for i in $v850_files ; do
391 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
392 if [ -n "${verbose}" ] ; then
393 echo Keeping v850 stuff in $i
398 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
401 if ( echo $* | grep keep\-v850eq > /dev/null ) ; then
404 for i in $v850e_files ; do
405 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
406 if [ -n "${verbose}" ] ; then
407 echo Removing traces of \"v850\" from $i...
410 sed '/start\-sanitize\-v850/,/end\-sanitize\-v850/d' < $i > new
411 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
412 if [ -n "${verbose}" ] ; then
413 echo Caching $i in .Recover...
424 r5900_files="ChangeLog config.bfd"
425 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
426 for i in $r5900_files ; do
427 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
428 if [ -n "${verbose}" ] ; then
429 echo Keeping r5900 stuff in $i
434 for i in $r5900_files ; do
435 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
436 if [ -n "${verbose}" ] ; then
437 echo Removing traces of \"r5900\" from $i...
440 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
441 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
442 if [ -n "${verbose}" ] ; then
443 echo Caching $i in .Recover...
452 sh4_files="ChangeLog config.bfd archures.c bfd-in2.h cpu-sh.c"
453 if ( echo $* | grep keep\-sh4 > /dev/null ) ; then
454 for i in $sh4_files ; do
455 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
456 if [ -n "${verbose}" ] ; then
457 echo Keeping sh4 stuff in $i
462 for i in $sh4_files ; do
463 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
464 if [ -n "${verbose}" ] ; then
465 echo Removing traces of \"sh4\" from $i...
468 sed '/start\-sanitize\-sh4/,/end-\sanitize\-sh4/d' < $i > new
469 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
470 if [ -n "${verbose}" ] ; then
471 echo Caching $i in .Recover...
480 tic80_files="ChangeLog Makefile.in Makefile.am archures.c bfd-in2.h config.bfd configure configure.in targets.c coffcode.h coffswap.h"
481 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
482 for i in $tic80_files ; do
483 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
484 if [ -n "${verbose}" ] ; then
485 echo Keeping tic80 stuff in $i
490 for i in $tic80_files ; do
491 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
492 if [ -n "${verbose}" ] ; then
493 echo Removing traces of \"tic80\" from $i...
496 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
497 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
498 if [ -n "${verbose}" ] ; then
499 echo Caching $i in .Recover...
508 gm_files="ChangeLog ChangeLog.2 config.bfd"
509 if ( echo $* | grep keep\-gm > /dev/null ) ; then
510 for i in $gm_files ; do
511 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
512 if [ -n "${verbose}" ] ; then
513 echo Keeping gm stuff in $i
518 for i in $gm_files ; do
519 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
520 if [ -n "${verbose}" ] ; then
521 echo Removing traces of \"gm\" from $i...
524 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
525 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
526 if [ -n "${verbose}" ] ; then
527 echo Caching $i in .Recover...
537 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
538 echo '***' Some mentions of Sanitize are still left in $i! 1>&2