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 arc_files="cpu-arc.c elf32-arc.c"
20 if ( echo $* | grep keep\-arc > /dev/null ) ; then
21 keep_these_too="${arc_files} ${keep_these_too}"
23 lose_these_too="${arc_files} ${lose_these_too}"
26 d10v_files="cpu-d10v.c elf32-d10v.c"
28 if ( echo $* | grep keep\-d10v > /dev/null ) ; then
29 keep_these_too="${d10v_files} ${keep_these_too}"
31 lose_these_too="${d10v_files} ${lose_these_too}"
34 m32r_files="cpu-m32r.c elf32-m32r.c"
36 if ( echo $* | grep keep\-m32r > /dev/null ) ; then
37 keep_these_too="${m32r_files} ${keep_these_too}"
39 lose_these_too="${m32r_files} ${lose_these_too}"
42 v850_files="cpu-v850.c elf32-v850.c"
44 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
45 keep_these_too="${v850_files} ${keep_these_too}"
47 lose_these_too="${v850_files} ${lose_these_too}"
50 tic80_files="cpu-tic80.c coff-tic80.c"
52 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
53 keep_these_too="${tic80_files} ${keep_these_too}"
55 lose_these_too="${tic80_files} ${lose_these_too}"
58 # All files listed between the "Things-to-keep:" line and the
59 # "Files-to-sed:" line will be kept. All other files will be removed.
60 # Directories listed in this section will have their own Sanitize
61 # called. Directories not listed will be removed in their entirety
302 arc_files="ChangeLog ChangeLog.2 Makefile.in archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h"
303 if ( echo $* | grep keep\-arc > /dev/null ) ; then
304 for i in $arc_files ; do
305 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
306 if [ -n "${verbose}" ] ; then
307 echo Keeping arc stuff in $i
312 for i in $arc_files ; do
313 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
314 if [ -n "${verbose}" ] ; then
315 echo Removing traces of \"arc\" from $i...
318 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
319 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
320 if [ -n "${verbose}" ] ; then
321 echo Caching $i in .Recover...
330 d10v_files="ChangeLog ChangeLog.2 Makefile.in archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h"
331 if ( echo $* | grep keep\-d10v > /dev/null ) ; then
332 for i in $d10v_files ; do
333 if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then
334 if [ -n "${verbose}" ] ; then
335 echo Keeping d10v stuff in $i
340 for i in $d10v_files ; do
341 if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then
342 if [ -n "${verbose}" ] ; then
343 echo Removing traces of \"d10v\" from $i...
346 sed '/start\-sanitize\-d10v/,/end-\sanitize\-d10v/d' < $i > new
347 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
348 if [ -n "${verbose}" ] ; then
349 echo Caching $i in .Recover...
358 m32r_files="ChangeLog Makefile.in config.bfd configure.in configure elf.c archures.c reloc.c targets.c bfd-in2.h libbfd.h"
359 if ( echo $* | grep keep\-m32r > /dev/null ) ; then
360 for i in $m32r_files ; do
361 if test ! -d $i && (grep sanitize-m32r $i > /dev/null) ; then
362 if [ -n "${verbose}" ] ; then
363 echo Keeping m32r stuff in $i
368 for i in $m32r_files ; do
369 if test ! -d $i && (grep sanitize-m32r $i > /dev/null) ; then
370 if [ -n "${verbose}" ] ; then
371 echo Removing traces of \"m32r\" from $i...
374 sed '/start\-sanitize\-m32r/,/end-\sanitize\-m32r/d' < $i > new
375 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
376 if [ -n "${verbose}" ] ; then
377 echo Caching $i in .Recover...
386 v850_files="ChangeLog ChangeLog.2 Makefile.in archures.c reloc.c targets.c config.bfd configure.in configure bfd-in2.h elf.c libbfd.h"
387 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
388 for i in $v850_files ; do
389 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
390 if [ -n "${verbose}" ] ; then
391 echo Keeping v850 stuff in $i
396 for i in $v850_files ; do
397 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
398 if [ -n "${verbose}" ] ; then
399 echo Removing traces of \"v850\" from $i...
402 sed '/start\-sanitize\-v850/,/end-\sanitize\-v850/d' < $i > new
403 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
404 if [ -n "${verbose}" ] ; then
405 echo Caching $i in .Recover...
414 r5900_files="ChangeLog config.bfd"
415 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
416 for i in $r5900_files ; do
417 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
418 if [ -n "${verbose}" ] ; then
419 echo Keeping r5900 stuff in $i
424 for i in $r5900_files ; do
425 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
426 if [ -n "${verbose}" ] ; then
427 echo Removing traces of \"r5900\" from $i...
430 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
431 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
432 if [ -n "${verbose}" ] ; then
433 echo Caching $i in .Recover...
442 tic80_files="ChangeLog Makefile.in archures.c bfd-in2.h config.bfd configure configure.in targets.c"
443 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
444 for i in $tic80_files ; do
445 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
446 if [ -n "${verbose}" ] ; then
447 echo Keeping tic80 stuff in $i
452 for i in $tic80_files ; do
453 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
454 if [ -n "${verbose}" ] ; then
455 echo Removing traces of \"tic80\" from $i...
458 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
459 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
460 if [ -n "${verbose}" ] ; then
461 echo Caching $i in .Recover...
470 gm_files="ChangeLog ChangeLog.2 config.bfd"
471 if ( echo $* | grep keep\-gm > /dev/null ) ; then
472 for i in $gm_files ; do
473 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
474 if [ -n "${verbose}" ] ; then
475 echo Keeping gm stuff in $i
480 for i in $gm_files ; do
481 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
482 if [ -n "${verbose}" ] ; then
483 echo Removing traces of \"gm\" from $i...
486 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
487 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
488 if [ -n "${verbose}" ] ; then
489 echo Caching $i in .Recover...
499 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
500 echo '***' Some mentions of Sanitize are still left in $i! 1>&2