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
111 # The lines between the "Do-last:" line and the end of the file
112 # are executed as a /bin/sh shell script after everything else is
117 v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
118 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
119 for i in $v850_files ; do
120 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
121 if [ -n "${verbose}" ] ; then
122 echo Keeping v850e stuff in $i
127 for i in $v850_files ; do
128 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
129 if [ -n "${verbose}" ] ; then
130 echo Removing traces of \"v850e\" from $i...
133 sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
134 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
135 if [ -n "${verbose}" ] ; then
136 echo Caching $i in .Recover...
145 tx49_files="ChangeLog configure.tgt"
146 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
147 for i in $tx49_files ; do
148 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
149 if [ -n "${verbose}" ] ; then
150 echo Keeping tx49 stuff in $i
155 for i in $tx49_files ; do
156 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
157 if [ -n "${verbose}" ] ; then
158 echo Removing traces of \"tx49\" from $i...
161 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
162 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
163 if [ -n "${verbose}" ] ; then
164 echo Caching $i in .Recover...
173 r5900_files="ChangeLog configure.tgt Makefile.in Makefile.am"
174 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
175 for i in $r5900_files ; do
176 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
177 if [ -n "${verbose}" ] ; then
178 echo Keeping r5900 stuff in $i
183 for i in $r5900_files ; do
184 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
185 if [ -n "${verbose}" ] ; then
186 echo Removing traces of \"r5900\" from $i...
189 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
190 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
191 if [ -n "${verbose}" ] ; then
192 echo Caching $i in .Recover...
201 vr4320_files="ChangeLog configure.tgt"
202 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
203 for i in $vr4320_files ; do
204 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
205 if [ -n "${verbose}" ] ; then
206 echo Keeping vr4320 stuff in $i
211 for i in $vr4320_files ; do
212 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
213 if [ -n "${verbose}" ] ; then
214 echo Removing traces of \"vr4320\" from $i...
217 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
218 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
219 if [ -n "${verbose}" ] ; then
220 echo Caching $i in .Recover...
229 tic80_files="ChangeLog configure.tgt Makefile.am Makefile.in"
230 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
231 for i in $tic80_files ; do
232 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
233 if [ -n "${verbose}" ] ; then
234 echo Keeping tic80 stuff in $i
239 for i in $tic80_files ; do
240 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
241 if [ -n "${verbose}" ] ; then
242 echo Removing traces of \"tic80\" from $i...
245 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
246 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
247 if [ -n "${verbose}" ] ; then
248 echo Caching $i in .Recover...
257 sky_files="ChangeLog configure.tgt"
258 if ( echo $* | grep keep\-sky > /dev/null ) ; then
259 for i in $sky_files ; do
260 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
261 if [ -n "${verbose}" ] ; then
262 echo Keeping sky stuff in $i
267 for i in $sky_files ; do
268 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
269 if [ -n "${verbose}" ] ; then
270 echo Removing traces of \"sky\" from $i...
273 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
274 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
275 if [ -n "${verbose}" ] ; then
276 echo Caching $i in .Recover...
285 beos_files="ChangeLog Makefile.am Makefile.in configure.tgt"
286 if ( echo $* | grep keep\-beos > /dev/null ) ; then
287 for i in $beos_files ; do
288 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
289 if [ -n "${verbose}" ] ; then
290 echo Keeping beos stuff in $i
295 for i in $beos_files ; do
296 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
297 if [ -n "${verbose}" ] ; then
298 echo Removing traces of \"beos\" from $i...
301 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
302 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
303 if [ -n "${verbose}" ] ; then
304 echo Caching $i in .Recover...
314 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
315 echo '***' Some mentions of Sanitize are still left in ld/$i! 1>&2
319 for lost in .. $ld_emulparams_files; do
320 if test $lost != .. && test $lost != CVS; then
321 if test -f emulparams/$lost; then
324 lost2=`echo $lost | sed -e 's/.sh$//'`
325 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
326 if fgrep $lost2 $i >/dev/null 2>&1; then
327 echo '***' File ld/emulparams/$lost was sanitized out but is still mentioned in ld/$i 1>&2
334 for lost in .. $ld_emultempl_files; do
335 if test $lost != .. && test $lost != CVS; then
336 if test -f emultempl/$lost; then
339 lost2=`echo $lost | sed -e 's/.em$//'`
340 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
341 if fgrep $lost2 $i >/dev/null 2>&1; then
342 # There is a valid mention of beos in configure.tgt
343 if test $lost2 != "beos" || test $i != configure.tgt; then
344 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
348 if test -d emulparams; then
349 for i in emulparams/*; do
350 if fgrep $lost2 $i >/dev/null 2>&1; then
351 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
359 for lost in .. $ld_scripttempl_files; do
360 if test $lost != .. && test $lost != CVS; then
361 if test -f scripttempl/$lost; then
364 lost2=`echo $lost | sed -e 's/.sc$//'`
365 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
366 if fgrep $lost2 $i >/dev/null 2>&1; then
367 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
370 if test -d emulparams; then
371 for i in emulparams/*; do
372 if fgrep $lost2 $i >/dev/null 2>&1; then
373 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
381 # This must come after all other sanitizations. Re-sanitize the .pot
383 if [ -n "${verbose}" ]; then
384 echo Re-computing files for gettext ...
387 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
388 if [ -n "${verbose}" ]; then
389 echo Caching po/POTFILES.in in .Recover...
391 mv po/POTFILES.in po/.Recover
393 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
395 if [ -n "${safe}" -a ! -f po/.Recover/ld.pot ]; then
396 if [ -n "${verbose}" ]; then
397 echo Caching po/ld.pot in .Recover...
399 mv po/ld.pot po/.Recover
401 # If this fails, Sanitization must fail.
402 xgettext -c -C -k_ -kN_ -f po/POTFILES.in -o po/ld.pot || exit 1