1 # .Sanitize for devo/opcodes.
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 cygnus_files="cgen.sh cgen-asm.in cgen-dis.in cgen-opc.in"
20 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
21 keep_these_too="${cygnus_files} ${keep_these_too}"
23 lose_these_too="${cygnus_files} ${lose_these_too}"
26 fr30_files="fr30-opc.h fr30-opc.c fr30-asm.c fr30-dis.c"
28 if ( echo $* | grep keep\-fr30 > /dev/null ) ; then
29 keep_these_too="${fr30_files} ${keep_these_too}"
31 lose_these_too="${fr30_files} ${lose_these_too}"
34 tic80_files="tic80-opc.c tic80-dis.c"
36 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
37 keep_these_too="${tic80_files} ${keep_these_too}"
39 lose_these_too="${tic80_files} ${lose_these_too}"
42 sky_files="dvp-opc.c dvp-dis.c"
44 if ( echo $* | grep keep\-sky > /dev/null ) ; then
45 keep_these_too="${sky_files} ${keep_these_too}"
47 lose_these_too="${sky_files} ${lose_these_too}"
50 # All files listed between the "Things-to-keep:" line and the
51 # "Files-to-sed:" line will be kept. All other files will be removed.
52 # Directories listed in this section will have their own Sanitize
53 # called. Directories not listed will be removed in their entirety
133 cygnus_files="ChangeLog Makefile.am Makefile.in configure.in configure"
134 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
135 for i in $cygnus_files ; do
136 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
137 if [ -n "${verbose}" ] ; then
138 echo Keeping cygnus stuff in $i
143 for i in $cygnus_files ; do
144 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
145 if [ -n "${verbose}" ] ; then
146 echo Removing traces of \"cygnus\" from $i...
149 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
150 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
151 if [ -n "${verbose}" ] ; then
152 echo Caching $i in .Recover...
161 am33_files="ChangeLog m10300-opc.c m10300-dis.c"
162 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
163 for i in $am33_files ; do
164 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
165 if [ -n "${verbose}" ] ; then
166 echo Keeping am33 stuff in $i
171 for i in $am33_files ; do
172 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
173 if [ -n "${verbose}" ] ; then
174 echo Removing traces of \"am33\" from $i...
177 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
178 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
179 if [ -n "${verbose}" ] ; then
180 echo Caching $i in .Recover...
190 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
191 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
192 for i in $v850e_files ; do
193 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
194 if [ -n "${verbose}" ] ; then
195 echo Keeping v850e stuff in $i
200 for i in $v850e_files ; do
201 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
202 if [ -n "${verbose}" ] ; then
203 echo Removing traces of \"v850e\" from $i...
206 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
207 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
208 if [ -n "${verbose}" ] ; then
209 echo Caching $i in .Recover...
219 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
220 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
221 for i in $r5900_files ; do
222 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
223 if [ -n "${verbose}" ] ; then
224 echo Keeping r5900 stuff in $i
229 for i in $r5900_files ; do
230 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
231 if [ -n "${verbose}" ] ; then
232 echo Removing traces of \"r5900\" from $i...
235 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
236 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
237 if [ -n "${verbose}" ] ; then
238 echo Caching $i in .Recover...
247 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
248 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
249 for i in $vr4320_files ; do
250 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
251 if [ -n "${verbose}" ] ; then
252 echo Keeping vr4320 stuff in $i
257 for i in $vr4320_files ; do
258 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
259 if [ -n "${verbose}" ] ; then
260 echo Removing traces of \"vr4320\" from $i...
263 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
264 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
265 if [ -n "${verbose}" ] ; then
266 echo Caching $i in .Recover...
275 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
276 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
277 for i in $cygnus_files ; do
278 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
279 if [ -n "${verbose}" ] ; then
280 echo Keeping cygnus stuff in $i
285 for i in $cygnus_files ; do
286 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
287 if [ -n "${verbose}" ] ; then
288 echo Removing traces of \"cygnus\" from $i...
291 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
292 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
293 if [ -n "${verbose}" ] ; then
294 echo Caching $i in .Recover...
303 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
304 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
305 for i in $tx19_files ; do
306 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
307 if [ -n "${verbose}" ] ; then
308 echo Keeping tx19 stuff in $i
313 for i in $tx19_files ; do
314 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
315 if [ -n "${verbose}" ] ; then
316 echo Removing traces of \"tx19\" from $i...
319 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
320 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
321 if [ -n "${verbose}" ] ; then
322 echo Caching $i in .Recover...
331 tx49_files="ChangeLog mips-opc.c mips-dis.c"
332 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
333 for i in $tx49_files ; do
334 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
335 if [ -n "${verbose}" ] ; then
336 echo Keeping tx49 stuff in $i
341 for i in $tx49_files ; do
342 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
343 if [ -n "${verbose}" ] ; then
344 echo Removing traces of \"tx49\" from $i...
347 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
348 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
349 if [ -n "${verbose}" ] ; then
350 echo Caching $i in .Recover...
359 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
360 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
361 for i in $tic80_files ; do
362 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
363 if [ -n "${verbose}" ] ; then
364 echo Keeping tic80 stuff in $i
369 for i in $tic80_files ; do
370 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
371 if [ -n "${verbose}" ] ; then
372 echo Removing traces of \"tic80\" from $i...
375 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
376 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
377 if [ -n "${verbose}" ] ; then
378 echo Caching $i in .Recover...
387 fr30_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
388 if ( echo $* | grep keep\-fr30 > /dev/null ) ; then
389 for i in $fr30_files ; do
390 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
391 if [ -n "${verbose}" ] ; then
392 echo Keeping fr30 stuff in $i
397 for i in $fr30_files ; do
398 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
399 if [ -n "${verbose}" ] ; then
400 echo Removing traces of \"fr30\" from $i...
403 sed '/start\-sanitize\-fr30/,/end-\sanitize\-fr30/d' < $i > new
404 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
405 if [ -n "${verbose}" ] ; then
406 echo Caching $i in .Recover...
415 coldfire_files="ChangeLog m68k-opc.c"
416 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
417 for i in $coldfire_files ; do
418 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
419 if [ -n "${verbose}" ] ; then
420 echo Keeping coldfire stuff in $i
425 for i in $coldfire_files ; do
426 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
427 if [ -n "${verbose}" ] ; then
428 echo Removing traces of \"coldfire\" from $i...
431 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
432 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
433 if [ -n "${verbose}" ] ; then
434 echo Caching $i in .Recover...
443 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
444 if ( echo $* | grep keep\-sky > /dev/null ) ; then
445 for i in $sky_files ; do
446 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
447 if [ -n "${verbose}" ] ; then
448 echo Keeping sky stuff in $i
453 for i in $sky_files ; do
454 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
455 if [ -n "${verbose}" ] ; then
456 echo Removing traces of \"sky\" from $i...
459 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
460 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
461 if [ -n "${verbose}" ] ; then
462 echo Caching $i in .Recover...
471 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
472 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
473 for i in $m32rx_files ; do
474 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
475 if [ -n "${verbose}" ] ; then
476 echo Keeping m32rx stuff in $i
481 for i in $m32rx_files ; do
482 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
483 if [ -n "${verbose}" ] ; then
484 echo Removing traces of \"m32rx\" from $i...
487 # The PIPE sanitization will be much cleaner with redact.
488 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
489 -e 's/, PIPE_[A-Z]*//g' < $i > new
490 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
491 if [ -n "${verbose}" ] ; then
492 echo Caching $i in .Recover...
501 nortel_ppc750_files="ChangeLog ppc-opc.c"
502 if ( echo $* | grep keep\-nortel-ppc750 > /dev/null ) ; then
503 for i in $nortel_ppc750_files ; do
504 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
505 if [ -n "${verbose}" ] ; then
506 echo Keeping nortel-ppc750 stuff in $i
511 for i in $nortel_ppc750_files ; do
512 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
513 if [ -n "${verbose}" ] ; then
514 echo Removing traces of \"nortel-ppc750\" from $i...
517 # The PIPE sanitization will be much cleaner with redact.
518 sed -e '/start\-sanitize\-nortel-ppc750/,/end\-sanitize\-nortel-ppc750/d' \
519 -e 's/, PIPE_[A-Z]*//g' < $i > new
520 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
521 if [ -n "${verbose}" ] ; then
522 echo Caching $i in .Recover...
532 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
533 echo '***' Some mentions of Sanitize are still left in opcodes/$i! 1>&2
537 for lost in .. $lose_these_too; do
538 if test $lost != ..; then
539 for i in Makefile.am Makefile.in configure.in configure; do
540 if fgrep $lost $i >/dev/null 2>&1; then
541 echo '***' File $lost was sanitized out but is still mentioned in opcodes/$i 1>&2
547 # This must come after all other sanitizations. Re-sanitize the .pot
549 if [ -n "${verbose}" ]; then
550 echo Re-computing files for gettext ...
553 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
554 if [ -n "${verbose}" ]; then
555 echo Caching po/POTFILES.in in .Recover...
557 mv po/POTFILES.in po/.Recover
560 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
562 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
563 if [ -n "${verbose}" ]; then
564 echo Caching po/opcodes.pot in .Recover...
566 mv po/opcodes.pot po/.Recover
569 # If this fails, Sanitization must fail.
570 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1