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
137 cygnus_files="ChangeLog Makefile.am Makefile.in configure.in configure"
138 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
139 for i in $cygnus_files ; do
140 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
141 if [ -n "${verbose}" ] ; then
142 echo Keeping cygnus stuff in $i
147 for i in $cygnus_files ; do
148 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
149 if [ -n "${verbose}" ] ; then
150 echo Removing traces of \"cygnus\" from $i...
153 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
154 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
155 if [ -n "${verbose}" ] ; then
156 echo Caching $i in .Recover...
165 am33_files="ChangeLog m10300-opc.c m10300-dis.c"
166 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
167 for i in $am33_files ; do
168 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
169 if [ -n "${verbose}" ] ; then
170 echo Keeping am33 stuff in $i
175 for i in $am33_files ; do
176 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
177 if [ -n "${verbose}" ] ; then
178 echo Removing traces of \"am33\" from $i...
181 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
182 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
183 if [ -n "${verbose}" ] ; then
184 echo Caching $i in .Recover...
194 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
195 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
196 for i in $v850e_files ; do
197 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
198 if [ -n "${verbose}" ] ; then
199 echo Keeping v850e stuff in $i
204 for i in $v850e_files ; do
205 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
206 if [ -n "${verbose}" ] ; then
207 echo Removing traces of \"v850e\" from $i...
210 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
211 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
212 if [ -n "${verbose}" ] ; then
213 echo Caching $i in .Recover...
223 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
224 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
225 for i in $r5900_files ; do
226 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
227 if [ -n "${verbose}" ] ; then
228 echo Keeping r5900 stuff in $i
233 for i in $r5900_files ; do
234 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
235 if [ -n "${verbose}" ] ; then
236 echo Removing traces of \"r5900\" from $i...
239 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
240 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
241 if [ -n "${verbose}" ] ; then
242 echo Caching $i in .Recover...
251 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
252 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
253 for i in $vr4320_files ; do
254 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
255 if [ -n "${verbose}" ] ; then
256 echo Keeping vr4320 stuff in $i
261 for i in $vr4320_files ; do
262 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
263 if [ -n "${verbose}" ] ; then
264 echo Removing traces of \"vr4320\" from $i...
267 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
268 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
269 if [ -n "${verbose}" ] ; then
270 echo Caching $i in .Recover...
279 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
280 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
281 for i in $cygnus_files ; do
282 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
283 if [ -n "${verbose}" ] ; then
284 echo Keeping cygnus stuff in $i
289 for i in $cygnus_files ; do
290 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
291 if [ -n "${verbose}" ] ; then
292 echo Removing traces of \"cygnus\" from $i...
295 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
296 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
297 if [ -n "${verbose}" ] ; then
298 echo Caching $i in .Recover...
307 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
308 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
309 for i in $tx19_files ; do
310 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
311 if [ -n "${verbose}" ] ; then
312 echo Keeping tx19 stuff in $i
317 for i in $tx19_files ; do
318 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
319 if [ -n "${verbose}" ] ; then
320 echo Removing traces of \"tx19\" from $i...
323 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
324 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
325 if [ -n "${verbose}" ] ; then
326 echo Caching $i in .Recover...
335 tx49_files="ChangeLog mips-opc.c mips-dis.c"
336 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
337 for i in $tx49_files ; do
338 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
339 if [ -n "${verbose}" ] ; then
340 echo Keeping tx49 stuff in $i
345 for i in $tx49_files ; do
346 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
347 if [ -n "${verbose}" ] ; then
348 echo Removing traces of \"tx49\" from $i...
351 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
352 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
353 if [ -n "${verbose}" ] ; then
354 echo Caching $i in .Recover...
363 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
364 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
365 for i in $tic80_files ; do
366 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
367 if [ -n "${verbose}" ] ; then
368 echo Keeping tic80 stuff in $i
373 for i in $tic80_files ; do
374 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
375 if [ -n "${verbose}" ] ; then
376 echo Removing traces of \"tic80\" from $i...
379 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
380 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
381 if [ -n "${verbose}" ] ; then
382 echo Caching $i in .Recover...
391 fr30_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
392 if ( echo $* | grep keep\-fr30 > /dev/null ) ; then
393 for i in $fr30_files ; do
394 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
395 if [ -n "${verbose}" ] ; then
396 echo Keeping fr30 stuff in $i
401 for i in $fr30_files ; do
402 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
403 if [ -n "${verbose}" ] ; then
404 echo Removing traces of \"fr30\" from $i...
407 sed '/start\-sanitize\-fr30/,/end-\sanitize\-fr30/d' < $i > new
408 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
409 if [ -n "${verbose}" ] ; then
410 echo Caching $i in .Recover...
419 coldfire_files="ChangeLog m68k-opc.c"
420 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
421 for i in $coldfire_files ; do
422 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
423 if [ -n "${verbose}" ] ; then
424 echo Keeping coldfire stuff in $i
429 for i in $coldfire_files ; do
430 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
431 if [ -n "${verbose}" ] ; then
432 echo Removing traces of \"coldfire\" from $i...
435 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
436 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
437 if [ -n "${verbose}" ] ; then
438 echo Caching $i in .Recover...
447 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
448 if ( echo $* | grep keep\-sky > /dev/null ) ; then
449 for i in $sky_files ; do
450 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
451 if [ -n "${verbose}" ] ; then
452 echo Keeping sky stuff in $i
457 for i in $sky_files ; do
458 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
459 if [ -n "${verbose}" ] ; then
460 echo Removing traces of \"sky\" from $i...
463 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
464 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
465 if [ -n "${verbose}" ] ; then
466 echo Caching $i in .Recover...
475 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
476 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
477 for i in $m32rx_files ; do
478 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
479 if [ -n "${verbose}" ] ; then
480 echo Keeping m32rx stuff in $i
485 for i in $m32rx_files ; do
486 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
487 if [ -n "${verbose}" ] ; then
488 echo Removing traces of \"m32rx\" from $i...
491 # The PIPE sanitization will be much cleaner with redact.
492 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
493 -e 's/, PIPE_[A-Z]*//g' < $i > new
494 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
495 if [ -n "${verbose}" ] ; then
496 echo Caching $i in .Recover...
505 nortel_ppc750_files="ChangeLog ppc-opc.c"
506 if ( echo $* | grep keep\-nortel-ppc750 > /dev/null ) ; then
507 for i in $nortel_ppc750_files ; do
508 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
509 if [ -n "${verbose}" ] ; then
510 echo Keeping nortel-ppc750 stuff in $i
515 for i in $nortel_ppc750_files ; do
516 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
517 if [ -n "${verbose}" ] ; then
518 echo Removing traces of \"nortel-ppc750\" from $i...
521 # The PIPE sanitization will be much cleaner with redact.
522 sed -e '/start\-sanitize\-nortel-ppc750/,/end\-sanitize\-nortel-ppc750/d' \
523 -e 's/, PIPE_[A-Z]*//g' < $i > new
524 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
525 if [ -n "${verbose}" ] ; then
526 echo Caching $i in .Recover...
536 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
537 echo '***' Some mentions of Sanitize are still left in opcodes/$i! 1>&2
541 for lost in .. $lose_these_too; do
542 if test $lost != ..; then
543 for i in Makefile.am Makefile.in configure.in configure; do
544 if fgrep $lost $i >/dev/null 2>&1; then
545 echo '***' File $lost was sanitized out but is still mentioned in opcodes/$i 1>&2
551 # This must come after all other sanitizations. Re-sanitize the .pot
553 if [ -n "${verbose}" ]; then
554 echo Re-computing files for gettext ...
557 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
558 if [ -n "${verbose}" ]; then
559 echo Caching po/POTFILES.in in .Recover...
561 mv po/POTFILES.in po/.Recover
564 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
566 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
567 if [ -n "${verbose}" ]; then
568 echo Caching po/opcodes.pot in .Recover...
570 mv po/opcodes.pot po/.Recover
573 # If this fails, Sanitization must fail.
574 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1