.Sanitize now re-computes gettext-related files
[binutils-gdb.git] / ld / .Sanitize
index c63a6f438be1164d047a01af17a7705a2e216708..b3deef464c823064439388b5a8207ee908631ecc 100644 (file)
@@ -1,4 +1,4 @@
-# .Sanitize for devo/ld.
+# .Sanitize for devo/ld
 
 # Each directory to survive its way into a release will need a file
 # like this one called "./.Sanitize".  All keyword lines must exist,
@@ -15,8 +15,9 @@
 
 Do-first:
 
+
 # All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept.  All other files will be removed.
+# "Do-last:" line will be kept.  All other files will be removed.
 # Directories listed in this section will have their own Sanitize
 # called.  Directories not listed will be removed in their entirety
 # with rm -rf.
@@ -24,11 +25,13 @@ Do-first:
 Things-to-keep:
 
 ChangeLog
+Makefile.am
 Makefile.in
 NEWS
 README
 TODO
 acconfig.h
+acinclude.m4
 aclocal.m4
 config.in
 configure
@@ -39,10 +42,10 @@ configure.tgt
 dep-in.sed
 emulparams
 emultempl
+gen-doc.texi
 genscripts.sh
 h8-doc.texi
 ld.1
-gen-doc.texi
 ld.h
 ld.texinfo
 ldcref.c
@@ -71,38 +74,186 @@ ldwrite.h
 lexsup.c
 mac-ld.r
 mpw-config.in
-mpw-emipsidt.c
+mpw-elfmips.c
 mpw-eppcmac.c
 mpw-esh.c
+mpw-idtmips.c
 mpw-make.sed
 mri.c
 mri.h
+po
 scripttempl
+stamp-h.in
 sysdep.h
 testsuite
 
 Things-to-lose:
 
+
+
+# The lines between the "Do-last:" line and the end of the file
+# are executed as a /bin/sh shell script after everything else is
+# done.
+
 Do-last:
 
-arc_files="ChangeLog configure.in configure.tgt Makefile.in"
+v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
+if ( echo $* | grep keep\-v850e > /dev/null ) ; then
+       for i in $v850_files ; do
+               if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping v850e stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $v850_files ; do
+               if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"v850e\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
+                       if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+                               if [ -n "${verbose}" ] ; then
+                                       echo Caching $i in .Recover...
+                               fi
+                               mv $i .Recover
+                       fi
+                       mv new $i
+               fi
+       done
+fi
+
+tx49_files="ChangeLog configure.tgt"
+if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
+       for i in $tx49_files ; do
+               if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping tx49 stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $tx49_files ; do
+               if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"tx49\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
+                       if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+                               if [ -n "${verbose}" ] ; then
+                                       echo Caching $i in .Recover...
+                               fi
+                               mv $i .Recover
+                       fi
+                       mv new $i
+               fi
+       done
+fi
+
+r5900_files="ChangeLog configure.tgt Makefile.in Makefile.am"
+if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
+       for i in $r5900_files ; do
+               if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping r5900 stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $r5900_files ; do
+               if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"r5900\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
+                       if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+                               if [ -n "${verbose}" ] ; then
+                                       echo Caching $i in .Recover...
+                               fi
+                               mv $i .Recover
+                       fi
+                       mv new $i
+               fi
+       done
+fi
+
+vr4320_files="ChangeLog configure.tgt"
+if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
+       for i in $vr4320_files ; do
+               if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping vr4320 stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $vr4320_files ; do
+               if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"vr4320\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
+                       if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+                               if [ -n "${verbose}" ] ; then
+                                       echo Caching $i in .Recover...
+                               fi
+                               mv $i .Recover
+                       fi
+                       mv new $i
+               fi
+       done
+fi
+
+tic80_files="ChangeLog configure.tgt Makefile.am Makefile.in"
+if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
+       for i in $tic80_files ; do
+               if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Keeping tic80 stuff in $i
+                       fi
+               fi
+       done
+else
+       for i in $tic80_files ; do
+               if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
+                       if [ -n "${verbose}" ] ; then
+                               echo Removing traces of \"tic80\" from $i...
+                       fi
+                       cp $i new
+                       sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
+                       if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+                               if [ -n "${verbose}" ] ; then
+                                       echo Caching $i in .Recover...
+                               fi
+                               mv $i .Recover
+                       fi
+                       mv new $i
+               fi
+       done
+fi
 
-if ( echo $* | grep keep\-arc > /dev/null ) ; then
-       for i in $arc_files ; do
-               if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
+d30v_files="ChangeLog configure.tgt Makefile.am Makefile.in"
+if ( echo $* | grep keep\-d30v > /dev/null ) ; then
+       for i in $d30v_files ; do
+               if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
                        if [ -n "${verbose}" ] ; then
-                               echo Keeping arc stuff in $i
+                               echo Keeping d30v stuff in $i
                        fi
                fi
        done
 else
-       for i in $arc_files ; do
-               if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
+       for i in $d30v_files ; do
+               if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
                        if [ -n "${verbose}" ] ; then
-                               echo Removing traces of \"arc\" from $i...
+                               echo Removing traces of \"d30v\" from $i...
                        fi
                        cp $i new
-                       sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
+                       sed '/start\-sanitize\-d30v/,/end-\sanitize\-d30v/d' < $i > new
                        if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
                                if [ -n "${verbose}" ] ; then
                                        echo Caching $i in .Recover...
@@ -114,23 +265,23 @@ else
        done
 fi
 
-h8s_files="ChangeLog Makefile.in configure.tgt"
-if ( echo $* | grep keep\-h8s > /dev/null ) ; then
-       for i in $h8s_files ; do
-               if test ! -d $i && (grep sanitize-h8s $i > /dev/null) ; then
+sky_files="ChangeLog configure.tgt"
+if ( echo $* | grep keep\-sky > /dev/null ) ; then
+       for i in $sky_files ; do
+               if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
                        if [ -n "${verbose}" ] ; then
-                               echo Keeping h8s stuff in $i
+                               echo Keeping sky stuff in $i
                        fi
                fi
        done
 else
-       for i in $h8s_files ; do
-               if test ! -d $i && (grep sanitize-h8s $i > /dev/null) ; then
+       for i in $sky_files ; do
+               if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
                        if [ -n "${verbose}" ] ; then
-                               echo Removing traces of \"h8s\" from $i...
+                               echo Removing traces of \"sky\" from $i...
                        fi
                        cp $i new
-                       sed '/start\-sanitize\-h8s/,/end-\sanitize\-h8s/d' < $i > new
+                       sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
                        if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
                                if [ -n "${verbose}" ] ; then
                                        echo Caching $i in .Recover...
@@ -148,5 +299,26 @@ for i in * ; do
        fi
 done
 
-#
-# End of file.
+# This must come after all other sanitizations.  Re-sanitize the .pot
+# file.
+if [ -n "${verbose}" ]; then
+   echo Re-computing files for gettext ...
+fi
+
+if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
+   if [ -n "${verbose}" ]; then
+      echo Caching po/POTFILES.in in .Recover...
+   fi
+   mv po/POTFILES.in po/.Recover
+fi
+find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
+
+if [ -n "${safe}" -a ! -f po/.Recover/ld.pot ]; then
+   if [ -n "${verbose}" ]; then
+      echo Caching po/ld.pot in .Recover...
+   fi
+   mv po/ld.pot po/.Recover
+fi
+xgettext `cat po/POTFILES.in` -o po/ld.pot
+
+# eof