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
130 cygnus_files="ChangeLog Makefile.am Makefile.in configure.in configure"
131 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
132 for i in $cygnus_files ; do
133 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
134 if [ -n "${verbose}" ] ; then
135 echo Keeping cygnus stuff in $i
140 for i in $cygnus_files ; do
141 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
142 if [ -n "${verbose}" ] ; then
143 echo Removing traces of \"cygnus\" from $i...
146 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
147 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
148 if [ -n "${verbose}" ] ; then
149 echo Caching $i in .Recover...
158 am33_files="ChangeLog m10300-opc.c m10300-dis.c"
159 if ( echo $* | grep keep\-am33 > /dev/null ) ; then
160 for i in $am33_files ; do
161 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
162 if [ -n "${verbose}" ] ; then
163 echo Keeping am33 stuff in $i
168 for i in $am33_files ; do
169 if test ! -d $i && (grep sanitize-am33 $i > /dev/null) ; then
170 if [ -n "${verbose}" ] ; then
171 echo Removing traces of \"am33\" from $i...
174 sed '/start\-sanitize\-am33/,/end-\sanitize\-am33/d' < $i > new
175 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
176 if [ -n "${verbose}" ] ; then
177 echo Caching $i in .Recover...
187 v850e_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c v850-opc.c v850-dis.c"
188 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
189 for i in $v850e_files ; do
190 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
191 if [ -n "${verbose}" ] ; then
192 echo Keeping v850e stuff in $i
197 for i in $v850e_files ; do
198 if test -f $i && (grep sanitize-v850e $i > /dev/null) ; then
199 if [ -n "${verbose}" ] ; then
200 echo Removing traces of \"v850e\" from $i...
203 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
204 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
205 if [ -n "${verbose}" ] ; then
206 echo Caching $i in .Recover...
216 r5900_files="ChangeLog mips-opc.c mips-dis.c Makefile.am Makefile.in"
217 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
218 for i in $r5900_files ; do
219 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
220 if [ -n "${verbose}" ] ; then
221 echo Keeping r5900 stuff in $i
226 for i in $r5900_files ; do
227 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
228 if [ -n "${verbose}" ] ; then
229 echo Removing traces of \"r5900\" from $i...
232 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
233 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
234 if [ -n "${verbose}" ] ; then
235 echo Caching $i in .Recover...
244 vr4320_files="ChangeLog mips-opc.c mips-dis.c"
245 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
246 for i in $vr4320_files ; do
247 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
248 if [ -n "${verbose}" ] ; then
249 echo Keeping vr4320 stuff in $i
254 for i in $vr4320_files ; do
255 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
256 if [ -n "${verbose}" ] ; then
257 echo Removing traces of \"vr4320\" from $i...
260 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
261 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
262 if [ -n "${verbose}" ] ; then
263 echo Caching $i in .Recover...
272 cygnus_files="ChangeLog mips-opc.c mips-dis.c"
273 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
274 for i in $cygnus_files ; do
275 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
276 if [ -n "${verbose}" ] ; then
277 echo Keeping cygnus stuff in $i
282 for i in $cygnus_files ; do
283 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
284 if [ -n "${verbose}" ] ; then
285 echo Removing traces of \"cygnus\" from $i...
288 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
289 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
290 if [ -n "${verbose}" ] ; then
291 echo Caching $i in .Recover...
300 tx19_files="ChangeLog mips16-opc.c mips-dis.c"
301 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
302 for i in $tx19_files ; do
303 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
304 if [ -n "${verbose}" ] ; then
305 echo Keeping tx19 stuff in $i
310 for i in $tx19_files ; do
311 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
312 if [ -n "${verbose}" ] ; then
313 echo Removing traces of \"tx19\" from $i...
316 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
317 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
318 if [ -n "${verbose}" ] ; then
319 echo Caching $i in .Recover...
328 tx49_files="ChangeLog mips-opc.c mips-dis.c"
329 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
330 for i in $tx49_files ; do
331 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
332 if [ -n "${verbose}" ] ; then
333 echo Keeping tx49 stuff in $i
338 for i in $tx49_files ; do
339 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
340 if [ -n "${verbose}" ] ; then
341 echo Removing traces of \"tx49\" from $i...
344 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
345 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
346 if [ -n "${verbose}" ] ; then
347 echo Caching $i in .Recover...
356 tic80_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c"
357 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
358 for i in $tic80_files ; do
359 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
360 if [ -n "${verbose}" ] ; then
361 echo Keeping tic80 stuff in $i
366 for i in $tic80_files ; do
367 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
368 if [ -n "${verbose}" ] ; then
369 echo Removing traces of \"tic80\" from $i...
372 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
373 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
374 if [ -n "${verbose}" ] ; then
375 echo Caching $i in .Recover...
384 coldfire_files="ChangeLog m68k-opc.c"
385 if ( echo $* | grep keep\-coldfire > /dev/null ) ; then
386 for i in $coldfire_files ; do
387 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
388 if [ -n "${verbose}" ] ; then
389 echo Keeping coldfire stuff in $i
394 for i in $coldfire_files ; do
395 if test ! -d $i && (grep sanitize-coldfire $i > /dev/null) ; then
396 if [ -n "${verbose}" ] ; then
397 echo Removing traces of \"coldfire\" from $i...
400 sed '/start\-sanitize\-coldfire/,/end-\sanitize\-coldfire/d' < $i > new
401 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
402 if [ -n "${verbose}" ] ; then
403 echo Caching $i in .Recover...
412 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure disassemble.c mips-dis.c"
413 if ( echo $* | grep keep\-sky > /dev/null ) ; then
414 for i in $sky_files ; do
415 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
416 if [ -n "${verbose}" ] ; then
417 echo Keeping sky stuff in $i
422 for i in $sky_files ; do
423 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
424 if [ -n "${verbose}" ] ; then
425 echo Removing traces of \"sky\" from $i...
428 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
429 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
430 if [ -n "${verbose}" ] ; then
431 echo Caching $i in .Recover...
440 m32rx_files="ChangeLog m32r-opc.c m32r-opc.h m32r-dis.c m32r-asm.c"
441 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
442 for i in $m32rx_files ; do
443 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
444 if [ -n "${verbose}" ] ; then
445 echo Keeping m32rx stuff in $i
450 for i in $m32rx_files ; do
451 if test -f $i && (grep sanitize-m32rx $i > /dev/null) ; then
452 if [ -n "${verbose}" ] ; then
453 echo Removing traces of \"m32rx\" from $i...
456 # The PIPE sanitization will be much cleaner with redact.
457 sed -e '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' \
458 -e 's/, PIPE_[A-Z]*//g' < $i > new
459 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
460 if [ -n "${verbose}" ] ; then
461 echo Caching $i in .Recover...
470 nortel_ppc750_files="ChangeLog ppc-opc.c"
471 if ( echo $* | grep keep\-nortel-ppc750 > /dev/null ) ; then
472 for i in $nortel_ppc750_files ; do
473 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
474 if [ -n "${verbose}" ] ; then
475 echo Keeping nortel-ppc750 stuff in $i
480 for i in $nortel_ppc750_files ; do
481 if test -f $i && (grep sanitize-nortel-ppc750 $i > /dev/null) ; then
482 if [ -n "${verbose}" ] ; then
483 echo Removing traces of \"nortel-ppc750\" from $i...
486 # The PIPE sanitization will be much cleaner with redact.
487 sed -e '/start\-sanitize\-nortel-ppc750/,/end\-sanitize\-nortel-ppc750/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 opcodes/$i! 1>&2
506 for lost in .. $lose_these_too; do
507 if test $lost != ..; then
508 for i in Makefile.am Makefile.in configure.in configure; do
509 if fgrep $lost $i >/dev/null 2>&1; then
510 echo '***' File $lost was sanitized out but is still mentioned in opcodes/$i 1>&2
516 # This must come after all other sanitizations. Re-sanitize the .pot
518 if [ -n "${verbose}" ]; then
519 echo Re-computing files for gettext ...
522 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
523 if [ -n "${verbose}" ]; then
524 echo Caching po/POTFILES.in in .Recover...
526 mv po/POTFILES.in po/.Recover
529 ls -1 *.[ch] cg*.in 2>/dev/null | sed -e 's,^\./,,' > po/POTFILES.in
531 if [ -n "${safe}" -a ! -f po/.Recover/opcodes.pot ]; then
532 if [ -n "${verbose}" ]; then
533 echo Caching po/opcodes.pot in .Recover...
535 mv po/opcodes.pot po/.Recover
538 # If this fails, Sanitization must fail.
539 xgettext -C -c -k_ -kN_ -f po/POTFILES.in -o po/opcodes.pot || exit 1