For top level:
[deliverable/binutils-gdb.git] / ld / .Sanitize
CommitLineData
e33bfde7 1# .Sanitize for devo/ld
86e4d6e4 2
747a47f2 3# Each directory to survive its way into a release will need a file
86e4d6e4
RP
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.
7
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.
11
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
747a47f2 14# done in this directory.
86e4d6e4
RP
15
16Do-first:
17
cbf40048
ILT
18# Remember the current lists of files in the subdirectories from which
19# we might remove files.
20if test -d emulparams; then
21 ld_emulparams_files=`cd emulparams; echo *`
22else
23 ld_emulparams_files=
24fi
25if test -d emultempl; then
26 ld_emultempl_files=`cd emultempl; echo *`
27else
28 ld_emultempl_files=
29fi
30if test -d scripttempl; then
31 ld_scripttempl_files=`cd scripttempl; echo *`
32else
33 ld_scripttempl_files=
34fi
e33bfde7 35
86e4d6e4 36# All files listed between the "Things-to-keep:" line and the
e33bfde7 37# "Do-last:" line will be kept. All other files will be removed.
86e4d6e4
RP
38# Directories listed in this section will have their own Sanitize
39# called. Directories not listed will be removed in their entirety
40# with rm -rf.
41
42Things-to-keep:
87756e15 43
5784123f 44ChangeLog
49c009b5 45Makefile.am
86e4d6e4 46Makefile.in
bc3b479c 47NEWS
c3d97ef6 48README
fbd74d07 49TODO
d66c832b 50acconfig.h
49c009b5 51acinclude.m4
e33bfde7 52aclocal.m4
ef346f1a 53config.in
d66c832b 54configure
65aa3724 55configure.bat
d66c832b 56configure.host
86e4d6e4 57configure.in
d66c832b 58configure.tgt
eb8061bf
DD
59deffile.h
60deffilep.y
f8083739 61dep-in.sed
2b63dbfe
DM
62emulparams
63emultempl
e33bfde7 64gen-doc.texi
c3d97ef6 65genscripts.sh
2412a768 66h8-doc.texi
40ab8532 67ld.1
5f1fec76
SC
68ld.h
69ld.texinfo
07acd23b 70ldcref.c
ffa057ee 71ldctor.c
1cc27b5e 72ldctor.h
c3d97ef6
PB
73ldemul.c
74ldemul.h
5f1fec76
SC
75ldexp.c
76ldexp.h
77ldfile.c
5f1fec76 78ldfile.h
5f1fec76 79ldgram.y
4b91c519 80ldint.texinfo
5f1fec76
SC
81ldlang.c
82ldlang.h
83ldlex.h
84ldlex.l
5f1fec76
SC
85ldmain.c
86ldmain.h
87ldmisc.c
88ldmisc.h
5f1fec76
SC
89ldver.c
90ldver.h
5f1fec76
SC
91ldwrite.c
92ldwrite.h
0cc6a796 93lexsup.c
aacc02d7 94mac-ld.r
36ae618c 95mpw-config.in
c6cfcb7f 96mpw-elfmips.c
aaa877b7 97mpw-eppcmac.c
aad90580 98mpw-esh.c
e33bfde7 99mpw-idtmips.c
aacc02d7 100mpw-make.sed
b11a9b28 101mri.c
a586b5bc 102mri.h
eb8061bf 103pe-dll.c
e33bfde7 104po
2b63dbfe 105scripttempl
49c009b5 106stamp-h.in
d66c832b 107sysdep.h
e2f9f0f6 108testsuite
86e4d6e4 109
87756e15
RP
110Things-to-lose:
111
e33bfde7
ILT
112
113
114# The lines between the "Do-last:" line and the end of the file
115# are executed as a /bin/sh shell script after everything else is
116# done.
117
86e4d6e4
RP
118Do-last:
119
49c009b5 120v850_files="ChangeLog configure.tgt Makefile.am Makefile.in"
ab11a82c
NC
121if ( echo $* | grep keep\-v850e > /dev/null ) ; then
122 for i in $v850_files ; do
123 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
124 if [ -n "${verbose}" ] ; then
125 echo Keeping v850e stuff in $i
126 fi
127 fi
128 done
129else
130 for i in $v850_files ; do
131 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
132 if [ -n "${verbose}" ] ; then
133 echo Removing traces of \"v850e\" from $i...
134 fi
135 cp $i new
136 sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
137 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
138 if [ -n "${verbose}" ] ; then
139 echo Caching $i in .Recover...
140 fi
141 mv $i .Recover
142 fi
143 mv new $i
144 fi
145 done
ab11a82c 146fi
276c2d7d 147
d020618a 148tx49_files="ChangeLog configure.tgt"
d020618a
GRK
149if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
150 for i in $tx49_files ; do
151 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
152 if [ -n "${verbose}" ] ; then
153 echo Keeping tx49 stuff in $i
154 fi
155 fi
156 done
157else
158 for i in $tx49_files ; do
159 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
160 if [ -n "${verbose}" ] ; then
161 echo Removing traces of \"tx49\" from $i...
162 fi
163 cp $i new
164 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
165 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
166 if [ -n "${verbose}" ] ; then
167 echo Caching $i in .Recover...
168 fi
169 mv $i .Recover
170 fi
171 mv new $i
172 fi
173 done
174fi
175
38c82baf 176r5900_files="ChangeLog configure.tgt Makefile.in Makefile.am"
276c2d7d
GRK
177if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
178 for i in $r5900_files ; do
179 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
180 if [ -n "${verbose}" ] ; then
181 echo Keeping r5900 stuff in $i
182 fi
183 fi
184 done
185else
186 for i in $r5900_files ; do
187 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
188 if [ -n "${verbose}" ] ; then
189 echo Removing traces of \"r5900\" from $i...
190 fi
191 cp $i new
192 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
193 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
194 if [ -n "${verbose}" ] ; then
04c17a75
JL
195 echo Caching $i in .Recover...
196 fi
197 mv $i .Recover
198 fi
199 mv new $i
200 fi
201 done
202fi
203
f8c41900
GRK
204vr4xxx_files="ChangeLog configure.tgt"
205if ( echo $* | grep keep\-vr4xxx > /dev/null ) ; then
206 for i in $vr4xxx_files ; do
207 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
208 if [ -n "${verbose}" ] ; then
209 echo Keeping vr4xxx stuff in $i
210 fi
211 fi
212 done
213else
214 for i in $vr4xxx_files ; do
215 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
216 if [ -n "${verbose}" ] ; then
217 echo Removing traces of \"vr4xxx\" from $i...
218 fi
219 cp $i new
220 sed '/start\-sanitize\-vr4xxx/,/end-\sanitize\-vr4xxx/d' < $i > new
221 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
222 if [ -n "${verbose}" ] ; then
223 echo Caching $i in .Recover...
224 fi
225 mv $i .Recover
226 fi
227 mv new $i
228 fi
229 done
230fi
231
7cdb3e27 232vr4320_files="ChangeLog configure.tgt"
7cdb3e27
GRK
233if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
234 for i in $vr4320_files ; do
235 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
236 if [ -n "${verbose}" ] ; then
237 echo Keeping vr4320 stuff in $i
238 fi
239 fi
240 done
241else
242 for i in $vr4320_files ; do
243 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
244 if [ -n "${verbose}" ] ; then
245 echo Removing traces of \"vr4320\" from $i...
246 fi
247 cp $i new
248 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
249 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
250 if [ -n "${verbose}" ] ; then
251 echo Caching $i in .Recover...
252 fi
253 mv $i .Recover
254 fi
255 mv new $i
256 fi
257 done
258fi
259
49c009b5 260tic80_files="ChangeLog configure.tgt Makefile.am Makefile.in"
11effa69
FF
261if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
262 for i in $tic80_files ; do
263 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
264 if [ -n "${verbose}" ] ; then
265 echo Keeping tic80 stuff in $i
266 fi
267 fi
268 done
269else
270 for i in $tic80_files ; do
271 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
272 if [ -n "${verbose}" ] ; then
273 echo Removing traces of \"tic80\" from $i...
274 fi
275 cp $i new
276 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
277 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
278 if [ -n "${verbose}" ] ; then
279 echo Caching $i in .Recover...
280 fi
281 mv $i .Recover
282 fi
283 mv new $i
284 fi
285 done
286fi
287
75aacf7a 288sky_files="ChangeLog configure.tgt"
f5870264
DE
289if ( echo $* | grep keep\-sky > /dev/null ) ; then
290 for i in $sky_files ; do
291 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
292 if [ -n "${verbose}" ] ; then
293 echo Keeping sky stuff in $i
294 fi
295 fi
296 done
297else
298 for i in $sky_files ; do
299 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
300 if [ -n "${verbose}" ] ; then
301 echo Removing traces of \"sky\" from $i...
302 fi
303 cp $i new
304 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
305 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
306 if [ -n "${verbose}" ] ; then
307 echo Caching $i in .Recover...
308 fi
309 mv $i .Recover
310 fi
311 mv new $i
312 fi
313 done
314fi
315
c86d82ee
RH
316beos_files="ChangeLog Makefile.am Makefile.in configure.tgt"
317if ( echo $* | grep keep\-beos > /dev/null ) ; then
318 for i in $beos_files ; do
319 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
320 if [ -n "${verbose}" ] ; then
321 echo Keeping beos stuff in $i
322 fi
323 fi
324 done
325else
326 for i in $beos_files ; do
327 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
328 if [ -n "${verbose}" ] ; then
329 echo Removing traces of \"beos\" from $i...
330 fi
331 cp $i new
332 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
4857ffb4
NC
333 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
334 if [ -n "${verbose}" ] ; then
335 echo Caching $i in .Recover...
336 fi
337 mv $i .Recover
338 fi
339 mv new $i
340 fi
341 done
342fi
343
43607f2c 344for i in * ; do
cbf40048
ILT
345 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
346 echo '***' Some mentions of Sanitize are still left in ld/$i! 1>&2
347 fi
348done
349
350for lost in .. $ld_emulparams_files; do
bb7835f0 351 if test $lost != .. && test $lost != CVS; then
cbf40048
ILT
352 if test -f emulparams/$lost; then
353 :
354 else
355 lost2=`echo $lost | sed -e 's/.sh$//'`
356 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
bb7835f0 357 if fgrep $lost2 $i >/dev/null 2>&1; then
cbf40048
ILT
358 echo '***' File ld/emulparams/$lost was sanitized out but is still mentioned in ld/$i 1>&2
359 fi
360 done
361 fi
362 fi
363done
364
365for lost in .. $ld_emultempl_files; do
bb7835f0 366 if test $lost != .. && test $lost != CVS; then
cbf40048
ILT
367 if test -f emultempl/$lost; then
368 :
369 else
370 lost2=`echo $lost | sed -e 's/.em$//'`
371 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
bb7835f0
ILT
372 if fgrep $lost2 $i >/dev/null 2>&1; then
373 # There is a valid mention of beos in configure.tgt
374 if test $lost2 != "beos" || test $i != configure.tgt; then
375 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
376 fi
cbf40048
ILT
377 fi
378 done
379 if test -d emulparams; then
380 for i in emulparams/*; do
bb7835f0
ILT
381 if fgrep $lost2 $i >/dev/null 2>&1; then
382 echo '***' File ld/emultempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
cbf40048
ILT
383 fi
384 done
385 fi
386 fi
387 fi
388done
389
390for lost in .. $ld_scripttempl_files; do
bb7835f0 391 if test $lost != .. && test $lost != CVS; then
cbf40048
ILT
392 if test -f scripttempl/$lost; then
393 :
394 else
395 lost2=`echo $lost | sed -e 's/.sc$//'`
396 for i in Makefile.am Makefile.in configure.host configure.tgt configure.in configure; do
bb7835f0 397 if fgrep $lost2 $i >/dev/null 2>&1; then
cbf40048
ILT
398 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
399 fi
400 done
401 if test -d emulparams; then
402 for i in emulparams/*; do
bb7835f0
ILT
403 if fgrep $lost2 $i >/dev/null 2>&1; then
404 echo '***' File ld/scripttempl/$lost was sanitized out but is still mentioned in ld/$i 1>&2
cbf40048
ILT
405 fi
406 done
407 fi
408 fi
409 fi
43607f2c
NC
410done
411
3d96e9b4
TT
412# This must come after all other sanitizations. Re-sanitize the .pot
413# file.
414if [ -n "${verbose}" ]; then
415 echo Re-computing files for gettext ...
416fi
417
418if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
419 if [ -n "${verbose}" ]; then
420 echo Caching po/POTFILES.in in .Recover...
421 fi
422 mv po/POTFILES.in po/.Recover
423fi
424find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
425
426if [ -n "${safe}" -a ! -f po/.Recover/ld.pot ]; then
427 if [ -n "${verbose}" ]; then
428 echo Caching po/ld.pot in .Recover...
429 fi
430 mv po/ld.pot po/.Recover
431fi
d6f3da9b 432# If this fails, Sanitization must fail.
f0ba99a6 433xgettext -c -C -k_ -kN_ -f po/POTFILES.in -o po/ld.pot || exit 1
e33bfde7 434# eof
This page took 0.264732 seconds and 4 git commands to generate.