.Sanitize now re-computes gettext-related files
[binutils-gdb.git] / ld / .Sanitize
index e6a05ec64db848cd64fd5951a97df02ba33ba6f3..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.
@@ -30,8 +31,8 @@ NEWS
 README
 TODO
 acconfig.h
-aclocal.m4
 acinclude.m4
+aclocal.m4
 config.in
 configure
 configure.bat
@@ -41,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
@@ -74,12 +75,13 @@ lexsup.c
 mac-ld.r
 mpw-config.in
 mpw-elfmips.c
-mpw-idtmips.c
 mpw-eppcmac.c
 mpw-esh.c
+mpw-idtmips.c
 mpw-make.sed
 mri.c
 mri.h
+po
 scripttempl
 stamp-h.in
 sysdep.h
@@ -87,55 +89,31 @@ testsuite
 
 Things-to-lose:
 
-Do-last:
 
-arc_files="ChangeLog configure.tgt Makefile.am Makefile.in"
 
-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
-                       if [ -n "${verbose}" ] ; then
-                               echo Keeping arc stuff in $i
-                       fi
-               fi
-       done
-else
-       for i in $arc_files ; do
-               if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
-                       if [ -n "${verbose}" ] ; then
-                               echo Removing traces of \"arc\" from $i...
-                       fi
-                       cp $i new
-                       sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/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
+# 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.
 
-v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
+Do-last:
 
-if ( echo $* | grep keep\-v850 > /dev/null ) ; then
+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-v850 $i > /dev/null) ; then
+               if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
                        if [ -n "${verbose}" ] ; then
-                               echo Keeping v850 stuff in $i
+                               echo Keeping v850e stuff in $i
                        fi
                fi
        done
 else
        for i in $v850_files ; do
-               if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
+               if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
                        if [ -n "${verbose}" ] ; then
-                               echo Removing traces of \"v850\" from $i...
+                               echo Removing traces of \"v850e\" from $i...
                        fi
                        cp $i new
-                       sed '/start\-sanitize\-v850/,/end-\sanitize\-v850/d' < $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...
@@ -146,22 +124,24 @@ else
                fi
        done
 fi
-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
+
+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 v850e stuff in $i
+                               echo Keeping tx49 stuff in $i
                        fi
                fi
        done
 else
-       for i in $v850_files ; do
-               if test ! -d $i && (grep sanitize-v850e $i > /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 Removing traces of \"v850e\" from $i...
+                               echo Removing traces of \"tx49\" from $i...
                        fi
                        cp $i new
-                       sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $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...
@@ -172,22 +152,24 @@ else
                fi
        done
 fi
-if ( echo $* | grep keep\-v850eq > /dev/null ) ; then
-       for i in $v850_files ; do
-               if test ! -d $i && (grep sanitize-v850eq $i > /dev/null) ; then
+
+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 v850eq stuff in $i
+                               echo Keeping r5900 stuff in $i
                        fi
                fi
        done
 else
-       for i in $v850_files ; do
-               if test ! -d $i && (grep sanitize-v850eq $i > /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 Removing traces of \"v850eq\" from $i...
+                               echo Removing traces of \"r5900\" from $i...
                        fi
                        cp $i new
-                       sed '/start\-sanitize\-v850eq/,/end-\sanitize\-v850eq/d' < $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...
@@ -199,24 +181,23 @@ else
        done
 fi
 
-r5900_files="ChangeLog configure.tgt"
-
-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
+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 r5900 stuff in $i
+                               echo Keeping vr4320 stuff in $i
                        fi
                fi
        done
 else
-       for i in $r5900_files ; do
-               if test ! -d $i && (grep sanitize-r5900 $i > /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 Removing traces of \"r5900\" from $i...
+                               echo Removing traces of \"vr4320\" from $i...
                        fi
                        cp $i new
-                       sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $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...
@@ -229,7 +210,6 @@ else
 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
@@ -258,7 +238,6 @@ else
 fi
 
 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
@@ -286,11 +265,60 @@ else
        done
 fi
 
+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 sky stuff in $i
+                       fi
+               fi
+       done
+else
+       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 \"sky\" from $i...
+                       fi
+                       cp $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...
+                               fi
+                               mv $i .Recover
+                       fi
+                       mv new $i
+               fi
+       done
+fi
+
 for i in * ; do
        if test ! -d $i && (grep sanitize $i > /dev/null) ; then
                echo '***' Some mentions of Sanitize are still left in $i! 1>&2
        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