1 # .Sanitize for devo/ld
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 # Remember the current lists of files in the subdirectories from which
19 # we might remove files.
20 if test -d emulparams; then
21 ld_emulparams_files=`cd emulparams; echo *`
25 if test -d emultempl; then
26 ld_emultempl_files=`cd emultempl; echo *`
30 if test -d scripttempl; then
31 ld_scripttempl_files=`cd scripttempl; echo *`
36 # All files listed between the "Things-to-keep:" line and the
37 # "Do-last:" line will be kept. All other files will be removed.
38 # Directories listed in this section will have their own Sanitize
39 # called. Directories not listed will be removed in their entirety
114 # The lines between the "Do-last:" line and the end of the file
115 # are executed as a /bin/sh shell script after everything else is
120 v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
121 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
122 for i in $v850_files ; do
123 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
124 if [ -n "${verbose}" ] ; then
125 echo Keeping v850e stuff in $i
130 for i in $v850_files ; do
131 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
132 if [ -n "${verbose}" ] ; then
133 echo Removing traces of \"v850e\" from $i...
136 sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
137 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
138 if [ -n "${verbose}" ] ; then
139 echo Caching $i in .Recover...
148 tx49_files="ChangeLog configure.tgt"
149 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
150 for i in $tx49_files ; do
151 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
152 if [ -n "${verbose}" ] ; then
153 echo Keeping tx49 stuff in $i
158 for i in $tx49_files ; do
159 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
160 if [ -n "${verbose}" ] ; then
161 echo Removing traces of \"tx49\" from $i...
164 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
165 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
166 if [ -n "${verbose}" ] ; then
167 echo Caching $i in .Recover...
176 r5900_files="ChangeLog configure.tgt Makefile.in Makefile.am"
177 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
178 for i in $r5900_files ; do
179 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
180 if [ -n "${verbose}" ] ; then
181 echo Keeping r5900 stuff in $i
186 for i in $r5900_files ; do
187 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
188 if [ -n "${verbose}" ] ; then
189 echo Removing traces of \"r5900\" from $i...
192 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
193 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
194 if [ -n "${verbose}" ] ; then
195 echo Caching $i in .Recover...
204 vr4320_files="ChangeLog configure.tgt"
205 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
206 for i in $vr4320_files ; do
207 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
208 if [ -n "${verbose}" ] ; then
209 echo Keeping vr4320 stuff in $i
214 for i in $vr4320_files ; do
215 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
216 if [ -n "${verbose}" ] ; then
217 echo Removing traces of \"vr4320\" from $i...
220 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
221 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
222 if [ -n "${verbose}" ] ; then
223 echo Caching $i in .Recover...
232 tic80_files="ChangeLog configure.tgt Makefile.am Makefile.in"
233 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
234 for i in $tic80_files ; do
235 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
236 if [ -n "${verbose}" ] ; then
237 echo Keeping tic80 stuff in $i
242 for i in $tic80_files ; do
243 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
244 if [ -n "${verbose}" ] ; then
245 echo Removing traces of \"tic80\" from $i...
248 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
249 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
250 if [ -n "${verbose}" ] ; then
251 echo Caching $i in .Recover...
260 sky_files="ChangeLog configure.tgt"
261 if ( echo $* | grep keep\-sky > /dev/null ) ; then
262 for i in $sky_files ; do
263 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
264 if [ -n "${verbose}" ] ; then
265 echo Keeping sky stuff in $i
270 for i in $sky_files ; do
271 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
272 if [ -n "${verbose}" ] ; then
273 echo Removing traces of \"sky\" from $i...
276 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
277 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
278 if [ -n "${verbose}" ] ; then
279 echo Caching $i in .Recover...
288 beos_files="ChangeLog Makefile.am Makefile.in configure.tgt"
289 if ( echo $* | grep keep\-beos > /dev/null ) ; then
290 for i in $beos_files ; do
291 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
292 if [ -n "${verbose}" ] ; then
293 echo Keeping beos stuff in $i
298 for i in $beos_files ; do
299 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
300 if [ -n "${verbose}" ] ; then
301 echo Removing traces of \"beos\" from $i...
304 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
305 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
306 if [ -n "${verbose}" ] ; then
307 echo Caching $i in .Recover...
317 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
318 echo '***' Some mentions of Sanitize are still left in ld/$i! 1>&2
322 for lost in .. $ld_emulparams_files; do
323 if test $lost != .. && test $lost != CVS; then
324 if test -f emulparams/$lost; then
327 lost2=`echo $lost | sed -e 's/.sh$//'`
328 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
329 if fgrep $lost2 $i >/dev/null 2>&1; then
330 echo '***' File ld/emulparams/$lost was sanitized out but is still mentioned in ld/$i 1>&2
337 for lost in .. $ld_emultempl_files; do
338 if test $lost != .. && test $lost != CVS; then
339 if test -f emultempl/$lost; then
342 lost2=`echo $lost | sed -e 's/.em$//'`
343 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
344 if fgrep $lost2 $i >/dev/null 2>&1; then
345 # There is a valid mention of beos in configure.tgt
346 if test $lost2 != "beos" || test $i != configure.tgt; then
347 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
351 if test -d emulparams; then
352 for i in emulparams/*; do
353 if fgrep $lost2 $i >/dev/null 2>&1; then
354 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
362 for lost in .. $ld_scripttempl_files; do
363 if test $lost != .. && test $lost != CVS; then
364 if test -f scripttempl/$lost; then
367 lost2=`echo $lost | sed -e 's/.sc$//'`
368 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
369 if fgrep $lost2 $i >/dev/null 2>&1; then
370 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
373 if test -d emulparams; then
374 for i in emulparams/*; do
375 if fgrep $lost2 $i >/dev/null 2>&1; then
376 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
384 # This must come after all other sanitizations. Re-sanitize the .pot
386 if [ -n "${verbose}" ]; then
387 echo Re-computing files for gettext ...
390 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
391 if [ -n "${verbose}" ]; then
392 echo Caching po/POTFILES.in in .Recover...
394 mv po/POTFILES.in po/.Recover
396 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
398 if [ -n "${safe}" -a ! -f po/.Recover/ld.pot ]; then
399 if [ -n "${verbose}" ]; then
400 echo Caching po/ld.pot in .Recover...
402 mv po/ld.pot po/.Recover
404 # If this fails, Sanitization must fail.
405 xgettext -c -C -k_ -kN_ -f po/POTFILES.in -o po/ld.pot || exit 1