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 tic80_files="tic80-opc.c tic80-dis.c"
28 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
29 keep_these_too="${tic80_files} ${keep_these_too}"
31 lose_these_too="${tic80_files} ${lose_these_too}"
34 sky_files="dvp-opc.c dvp-dis.c"
36 if ( echo $* | grep keep\-sky > /dev/null ) ; then
37 keep_these_too="${sky_files} ${keep_these_too}"
39 lose_these_too="${sky_files} ${lose_these_too}"
42 # All files listed between the "Things-to-keep:" line and the
43 # "Files-to-sed:" line will be kept. All other files will be removed.
44 # Directories listed in this section will have their own Sanitize
45 # called. Directories not listed will be removed in their entirety
125 cygnus_files="ChangeLog Makefile.am Makefile.in configure.in configure"
126 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
127 for i in $cygnus_files ; do
128 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
129 if [ -n "${verbose}" ] ; then
130 echo Keeping cygnus stuff in $i
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 Removing traces of \"cygnus\" from $i...
141 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
142 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
143 if [ -n "${verbose}" ] ; then
144 echo Caching $i in .Recover...
153 am33_files="ChangeLog m10300-opc.c m10300-dis.c"
154 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
155 for i in $am33_files ; do
156 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
157 if [ -n "${verbose}" ] ; then
158 echo Keeping am33 stuff in $i
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 Removing traces of \"am33\" from $i...
169 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
170 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
171 if [ -n "${verbose}" ] ; then
172 echo Caching $i in .Recover...
182 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
183 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
184 for i in $v850e_files ; do
185 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
186 if [ -n "${verbose}" ] ; then
187 echo Keeping v850e stuff in $i
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 Removing traces of \"v850e\" from $i...
198 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
199 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
200 if [ -n "${verbose}" ] ; then
201 echo Caching $i in .Recover...
211 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
212 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
213 for i in $r5900_files ; do
214 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
215 if [ -n "${verbose}" ] ; then
216 echo Keeping r5900 stuff in $i
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 Removing traces of \"r5900\" from $i...
227 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
228 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
229 if [ -n "${verbose}" ] ; then
230 echo Caching $i in .Recover...
239 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
240 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
241 for i in $vr4320_files ; do
242 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
243 if [ -n "${verbose}" ] ; then
244 echo Keeping vr4320 stuff in $i
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 Removing traces of \"vr4320\" from $i...
255 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
256 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
257 if [ -n "${verbose}" ] ; then
258 echo Caching $i in .Recover...
267 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
268 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
269 for i in $cygnus_files ; do
270 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
271 if [ -n "${verbose}" ] ; then
272 echo Keeping cygnus stuff in $i
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 Removing traces of \"cygnus\" from $i...
283 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
284 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
285 if [ -n "${verbose}" ] ; then
286 echo Caching $i in .Recover...
295 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
296 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
297 for i in $tx19_files ; do
298 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
299 if [ -n "${verbose}" ] ; then
300 echo Keeping tx19 stuff in $i
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 Removing traces of \"tx19\" from $i...
311 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
312 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
313 if [ -n "${verbose}" ] ; then
314 echo Caching $i in .Recover...
323 tx49_files="ChangeLog mips-opc.c mips-dis.c"
324 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
325 for i in $tx49_files ; do
326 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
327 if [ -n "${verbose}" ] ; then
328 echo Keeping tx49 stuff in $i
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 Removing traces of \"tx49\" from $i...
339 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
340 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
341 if [ -n "${verbose}" ] ; then
342 echo Caching $i in .Recover...
351 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
352 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
353 for i in $tic80_files ; do
354 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
355 if [ -n "${verbose}" ] ; then
356 echo Keeping tic80 stuff in $i
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 Removing traces of \"tic80\" from $i...
367 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
368 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
369 if [ -n "${verbose}" ] ; then
370 echo Caching $i in .Recover...
379 coldfire_files="ChangeLog m68k-opc.c"
380 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
381 for i in $coldfire_files ; do
382 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
383 if [ -n "${verbose}" ] ; then
384 echo Keeping coldfire stuff in $i
389 for i in $coldfire_files ; do
390 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
391 if [ -n "${verbose}" ] ; then
392 echo Removing traces of \"coldfire\" from $i...
395 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
396 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
397 if [ -n "${verbose}" ] ; then
398 echo Caching $i in .Recover...
407 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
408 if ( echo $* | grep keep\-sky > /dev/null ) ; then
409 for i in $sky_files ; do
410 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
411 if [ -n "${verbose}" ] ; then
412 echo Keeping sky stuff in $i
417 for i in $sky_files ; do
418 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
419 if [ -n "${verbose}" ] ; then
420 echo Removing traces of \"sky\" from $i...
423 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
424 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
425 if [ -n "${verbose}" ] ; then
426 echo Caching $i in .Recover...
435 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
436 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
437 for i in $m32rx_files ; do
438 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
439 if [ -n "${verbose}" ] ; then
440 echo Keeping m32rx stuff in $i
445 for i in $m32rx_files ; do
446 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
447 if [ -n "${verbose}" ] ; then
448 echo Removing traces of \"m32rx\" from $i...
451 # The PIPE sanitization will be much cleaner with redact.
452 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
453 -e 's/, PIPE_[A-Z]*//g' < $i > new
454 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
455 if [ -n "${verbose}" ] ; then
456 echo Caching $i in .Recover...
465 nortel_ppc750_files="ChangeLog ppc-opc.c"
466 if ( echo $* | grep keep\-nortel-ppc750 > /dev/null ) ; then
467 for i in $nortel_ppc750_files ; do
468 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
469 if [ -n "${verbose}" ] ; then
470 echo Keeping m32rx stuff in $i
475 for i in $nortel_ppc750_files ; do
476 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
477 if [ -n "${verbose}" ] ; then
478 echo Removing traces of \"m32rx\" from $i...
481 # The PIPE sanitization will be much cleaner with redact.
482 sed -e '/start\-sanitize\-nortel-ppc750/,/end\-sanitize\-nortel-ppc750/d' \
483 -e 's/, PIPE_[A-Z]*//g' < $i > new
484 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
485 if [ -n "${verbose}" ] ; then
486 echo Caching $i in .Recover...
496 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
497 echo '***' Some mentions of Sanitize are still left in opcodes/$i! 1>&2
501 for lost in .. $lose_these_too; do
502 if test $lost != ..; then
503 for i in Makefile.am Makefile.in configure.in configure; do
504 if fgrep $lost $i >/dev/null 2>&1; then
505 echo '***' File $lost was sanitized out but is still mentioned in opcodes/$i 1>&2
511 # This must come after all other sanitizations. Re-sanitize the .pot
513 if [ -n "${verbose}" ]; then
514 echo Re-computing files for gettext ...
517 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
518 if [ -n "${verbose}" ]; then
519 echo Caching po/POTFILES.in in .Recover...
521 mv po/POTFILES.in po/.Recover
524 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
526 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
527 if [ -n "${verbose}" ]; then
528 echo Caching po/opcodes.pot in .Recover...
530 mv po/opcodes.pot po/.Recover
533 # If this fails, Sanitization must fail.
534 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1