* Test case for PR 18452.
[binutils-gdb.git] / opcodes / .Sanitize
blob49b8a025f3afe17f310df6b7c76322cd0230a729
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
10 # out.
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.
16 Do-first:
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}"
22 else
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}"
30 else
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}"
38 else
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}"
46 else
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
54 # with rm -rf.
56 Things-to-keep:
58 ChangeLog
59 Makefile.am
60 Makefile.in
61 acconfig.h
62 acinclude.m4
63 aclocal.m4
64 alpha-dis.c
65 alpha-opc.c
66 arc-dis.c
67 arc-opc.c
68 arm-dis.c
69 arm-opc.h
70 a29k-dis.c
71 cgen-asm.c
72 cgen-dis.c
73 cgen-opc.c
74 config.in
75 configure
76 configure.bat
77 configure.in
78 d10v-dis.c
79 d10v-opc.c
80 d30v-dis.c
81 d30v-opc.c
82 dep-in.sed
83 dis-buf.c
84 disassemble.c
85 h8300-dis.c
86 h8500-dis.c
87 h8500-opc.h
88 hppa-dis.c
89 i386-dis.c
90 i960-dis.c
91 i960c-asm.c
92 i960c-dis.c
93 i960c-opc.c
94 i960c-opc.h
95 m32r-asm.c
96 m32r-dis.c
97 m32r-opc.c
98 m32r-opc.h
99 m68k-dis.c
100 m68k-opc.c
101 m88k-dis.c
102 makefile.vms
103 mips-dis.c
104 mips-opc.c
105 mips16-opc.c
106 m10200-dis.c
107 m10200-opc.c
108 m10300-dis.c
109 m10300-opc.c
110 mpw-config.in
111 mpw-make.sed
112 ns32k-dis.c
113 opintl.h
115 ppc-dis.c
116 ppc-opc.c
117 sh-opc.h
118 sh-dis.c
119 sparc-dis.c
120 sparc-opc.c
121 stamp-h.in
122 sysdep.h
123 tic30-dis.c
124 vax-dis.c
125 w65-dis.c
126 w65-opc.h
127 v850-opc.c
128 v850-dis.c
129 z8k-dis.c
130 z8k-opc.h
131 z8kgen.c
133 Things-to-lose:
135 Do-last:
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
143                         fi
144                 fi
145         done
146 else
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...
151                         fi
152                         cp $i new
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...
157                                 fi
158                                 mv $i .Recover
159                         fi
160                         mv new $i
161                 fi
162         done
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
171                         fi
172                 fi
173         done
174 else
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...
179                         fi
180                         cp $i new
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...
185                                 fi
186                                 mv $i .Recover
187                         fi
188                         mv new $i
189                 fi
190         done
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
200                         fi
201                 fi
202         done
203 else
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...
208                         fi
209                         cp $i new
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...
214                                 fi
215                                 mv $i .Recover
216                         fi
217                         mv new $i
218                 fi
219         done
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
229                         fi
230                 fi
231         done
232 else
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...
237                         fi
238                         cp $i new
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...
243                                 fi
244                                 mv $i .Recover
245                         fi
246                         mv new $i
247                 fi
248         done
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
257                         fi
258                 fi
259         done
260 else
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...
265                         fi
266                         cp $i new
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...
271                                 fi
272                                 mv $i .Recover
273                         fi
274                         mv new $i
275                 fi
276         done
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
285                         fi
286                 fi
287         done
288 else
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...
293                         fi
294                         cp $i new
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...
299                                 fi
300                                 mv $i .Recover
301                         fi
302                         mv new $i
303                 fi
304         done
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
313                         fi
314                 fi
315         done
316 else
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...
321                         fi
322                         cp $i new
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...
327                                 fi
328                                 mv $i .Recover
329                         fi
330                         mv new $i
331                 fi
332         done
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
341                         fi
342                 fi
343         done
344 else
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...
349                         fi
350                         cp $i new
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...
355                                 fi
356                                 mv $i .Recover
357                         fi
358                         mv new $i
359                 fi
360         done
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
369                         fi
370                 fi
371         done
372 else
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...
377                         fi
378                         cp $i new
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...
383                                 fi
384                                 mv $i .Recover
385                         fi
386                         mv new $i
387                 fi
388         done
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
397                         fi
398                 fi
399         done
400 else
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...
405                         fi
406                         cp $i new
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...
411                                 fi
412                                 mv $i .Recover
413                         fi
414                         mv new $i
415                 fi
416         done
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
425                         fi
426                 fi
427         done
428 else
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...
433                         fi
434                         cp $i new
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...
439                                 fi
440                                 mv $i .Recover
441                         fi
442                         mv new $i
443                 fi
444         done
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
453                         fi
454                 fi
455         done
456 else
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...
461                         fi
462                         cp $i new
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...
467                                 fi
468                                 mv $i .Recover
469                         fi
470                         mv new $i
471                 fi
472         done
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
481                         fi
482                 fi
483         done
484 else
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...
489                         fi
490                         cp $i new
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...
497                                 fi
498                                 mv $i .Recover
499                         fi
500                         mv new $i
501                 fi
502         done
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
511                         fi
512                 fi
513         done
514 else
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...
519                         fi
520                         cp $i new
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...
527                                 fi
528                                 mv $i .Recover
529                         fi
530                         mv new $i
531                 fi
532         done
535 for i in *; do
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
538   fi
539 done
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
546       fi
547     done
548   fi
549 done
551 # This must come after all other sanitizations.  Re-sanitize the .pot
552 # file.
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...
560    fi
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...
569    fi
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
576 # End of file.