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}"
44 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
45 keep_these_too="${r5900_files} ${keep_these_too}"
47 lose_these_too="${r5900_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...
189 armelf_files="ChangeLog arm-dis.c"
190 if ( echo $* | grep keep\-armelf > /dev/null ) ; then
191 for i in $armelf_files ; do
192 if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then
193 if [ -n "${verbose}" ] ; then
194 echo Keeping armelf stuff in $i
199 for i in $armelf_files ; do
200 if test ! -d $i && (grep sanitize-armelf $i > /dev/null) ; then
201 if [ -n "${verbose}" ] ; then
202 echo Removing traces of \"armelf\" from $i...
205 sed '/start\-sanitize\-armelf/,/end-\sanitize\-armelf/d' < $i > new
206 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
207 if [ -n "${verbose}" ] ; then
208 echo Caching $i in .Recover...
217 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
218 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
219 for i in $v850e_files ; do
220 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
221 if [ -n "${verbose}" ] ; then
222 echo Keeping v850e stuff in $i
227 for i in $v850e_files ; do
228 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
229 if [ -n "${verbose}" ] ; then
230 echo Removing traces of \"v850e\" from $i...
233 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
234 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
235 if [ -n "${verbose}" ] ; then
236 echo Caching $i in .Recover...
246 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
247 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
248 for i in $r5900_files ; do
249 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
250 if [ -n "${verbose}" ] ; then
251 echo Keeping r5900 stuff in $i
256 for i in $r5900_files ; do
257 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
258 if [ -n "${verbose}" ] ; then
259 echo Removing traces of \"r5900\" from $i...
262 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
263 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
264 if [ -n "${verbose}" ] ; then
265 echo Caching $i in .Recover...
274 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
275 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
276 for i in $vr4320_files ; do
277 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
278 if [ -n "${verbose}" ] ; then
279 echo Keeping vr4320 stuff in $i
284 for i in $vr4320_files ; do
285 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
286 if [ -n "${verbose}" ] ; then
287 echo Removing traces of \"vr4320\" from $i...
290 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
291 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
292 if [ -n "${verbose}" ] ; then
293 echo Caching $i in .Recover...
302 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
303 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
304 for i in $cygnus_files ; do
305 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
306 if [ -n "${verbose}" ] ; then
307 echo Keeping cygnus stuff in $i
312 for i in $cygnus_files ; do
313 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
314 if [ -n "${verbose}" ] ; then
315 echo Removing traces of \"cygnus\" from $i...
318 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
319 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
320 if [ -n "${verbose}" ] ; then
321 echo Caching $i in .Recover...
330 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
331 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
332 for i in $tx19_files ; do
333 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
334 if [ -n "${verbose}" ] ; then
335 echo Keeping tx19 stuff in $i
340 for i in $tx19_files ; do
341 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
342 if [ -n "${verbose}" ] ; then
343 echo Removing traces of \"tx19\" from $i...
346 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
347 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
348 if [ -n "${verbose}" ] ; then
349 echo Caching $i in .Recover...
358 tx49_files="ChangeLog mips-opc.c mips-dis.c"
359 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
360 for i in $tx49_files ; do
361 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
362 if [ -n "${verbose}" ] ; then
363 echo Keeping tx49 stuff in $i
368 for i in $tx49_files ; do
369 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
370 if [ -n "${verbose}" ] ; then
371 echo Removing traces of \"tx49\" from $i...
374 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
375 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
376 if [ -n "${verbose}" ] ; then
377 echo Caching $i in .Recover...
386 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
387 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
388 for i in $tic80_files ; do
389 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
390 if [ -n "${verbose}" ] ; then
391 echo Keeping tic80 stuff in $i
396 for i in $tic80_files ; do
397 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
398 if [ -n "${verbose}" ] ; then
399 echo Removing traces of \"tic80\" from $i...
402 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
403 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
404 if [ -n "${verbose}" ] ; then
405 echo Caching $i in .Recover...
414 coldfire_files="ChangeLog m68k-opc.c"
415 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
416 for i in $coldfire_files ; do
417 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
418 if [ -n "${verbose}" ] ; then
419 echo Keeping coldfire stuff in $i
424 for i in $coldfire_files ; do
425 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
426 if [ -n "${verbose}" ] ; then
427 echo Removing traces of \"coldfire\" from $i...
430 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
431 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
432 if [ -n "${verbose}" ] ; then
433 echo Caching $i in .Recover...
442 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
443 if ( echo $* | grep keep\-sky > /dev/null ) ; then
444 for i in $sky_files ; do
445 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
446 if [ -n "${verbose}" ] ; then
447 echo Keeping sky stuff in $i
452 for i in $sky_files ; do
453 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
454 if [ -n "${verbose}" ] ; then
455 echo Removing traces of \"sky\" from $i...
458 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
459 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
460 if [ -n "${verbose}" ] ; then
461 echo Caching $i in .Recover...
470 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
471 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
472 for i in $m32rx_files ; do
473 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
474 if [ -n "${verbose}" ] ; then
475 echo Keeping m32rx stuff in $i
480 for i in $m32rx_files ; do
481 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
482 if [ -n "${verbose}" ] ; then
483 echo Removing traces of \"m32rx\" from $i...
486 # The PIPE sanitization will be much cleaner with redact.
487 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
488 -e 's/, PIPE_[A-Z]*//g' < $i > new
489 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
490 if [ -n "${verbose}" ] ; then
491 echo Caching $i in .Recover...
501 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
502 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
506 # This must come after all other sanitizations. Re-sanitize the .pot
508 if [ -n "${verbose}" ]; then
509 echo Re-computing files for gettext ...
512 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
513 if [ -n "${verbose}" ]; then
514 echo Caching po/POTFILES.in in .Recover...
516 mv po/POTFILES.in po/.Recover
519 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
521 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
522 if [ -n "${verbose}" ]; then
523 echo Caching po/opcodes.pot in .Recover...
525 mv po/opcodes.pot po/.Recover
528 # If this fails, Sanitization must fail.
529 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1