Mercurial > urweb
comparison depcomp @ 1806:40557fb08e98
New release
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 07 Aug 2012 09:41:02 -0400 |
parents | 27d68ccb2c9e |
children | 6a621a625b04 |
comparison
equal
deleted
inserted
replaced
1805:d12192c7aa3e | 1806:40557fb08e98 |
---|---|
1 #! /bin/sh | 1 #! /bin/sh |
2 # depcomp - compile a program generating dependencies as side-effects | 2 # depcomp - compile a program generating dependencies as side-effects |
3 | 3 |
4 scriptversion=2011-12-04.11; # UTC | 4 scriptversion=2012-03-27.16; # UTC |
5 | 5 |
6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, | 6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, |
7 # 2011 Free Software Foundation, Inc. | 7 # 2011, 2012 Free Software Foundation, Inc. |
8 | 8 |
9 # This program is free software; you can redistribute it and/or modify | 9 # This program is free software; you can redistribute it and/or modify |
10 # it under the terms of the GNU General Public License as published by | 10 # it under the terms of the GNU General Public License as published by |
11 # the Free Software Foundation; either version 2, or (at your option) | 11 # the Free Software Foundation; either version 2, or (at your option) |
12 # any later version. | 12 # any later version. |
26 | 26 |
27 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. | 27 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. |
28 | 28 |
29 case $1 in | 29 case $1 in |
30 '') | 30 '') |
31 echo "$0: No command. Try \`$0 --help' for more information." 1>&2 | 31 echo "$0: No command. Try '$0 --help' for more information." 1>&2 |
32 exit 1; | 32 exit 1; |
33 ;; | 33 ;; |
34 -h | --h*) | 34 -h | --h*) |
35 cat <<\EOF | 35 cat <<\EOF |
36 Usage: depcomp [--help] [--version] PROGRAM [ARGS] | 36 Usage: depcomp [--help] [--version] PROGRAM [ARGS] |
38 Run PROGRAMS ARGS to compile a file, generating dependencies | 38 Run PROGRAMS ARGS to compile a file, generating dependencies |
39 as side-effects. | 39 as side-effects. |
40 | 40 |
41 Environment variables: | 41 Environment variables: |
42 depmode Dependency tracking mode. | 42 depmode Dependency tracking mode. |
43 source Source file read by `PROGRAMS ARGS'. | 43 source Source file read by 'PROGRAMS ARGS'. |
44 object Object file output by `PROGRAMS ARGS'. | 44 object Object file output by 'PROGRAMS ARGS'. |
45 DEPDIR directory where to store dependencies. | 45 DEPDIR directory where to store dependencies. |
46 depfile Dependency file to output. | 46 depfile Dependency file to output. |
47 tmpdepfile Temporary file to use when outputting dependencies. | 47 tmpdepfile Temporary file to use when outputting dependencies. |
48 libtool Whether libtool is used (yes/no). | 48 libtool Whether libtool is used (yes/no). |
49 | 49 |
55 echo "depcomp $scriptversion" | 55 echo "depcomp $scriptversion" |
56 exit $? | 56 exit $? |
57 ;; | 57 ;; |
58 esac | 58 esac |
59 | 59 |
60 # A tabulation character. | |
61 tab=' ' | |
62 # A newline character. | |
63 nl=' | |
64 ' | |
65 | |
60 if test -z "$depmode" || test -z "$source" || test -z "$object"; then | 66 if test -z "$depmode" || test -z "$source" || test -z "$object"; then |
61 echo "depcomp: Variables source, object and depmode must be set" 1>&2 | 67 echo "depcomp: Variables source, object and depmode must be set" 1>&2 |
62 exit 1 | 68 exit 1 |
63 fi | 69 fi |
64 | 70 |
98 # This is just like msvc7 but w/o cygpath translation. | 104 # This is just like msvc7 but w/o cygpath translation. |
99 # Just convert the backslash-escaped backslashes to single forward | 105 # Just convert the backslash-escaped backslashes to single forward |
100 # slashes to satisfy depend.m4 | 106 # slashes to satisfy depend.m4 |
101 cygpath_u='sed s,\\\\,/,g' | 107 cygpath_u='sed s,\\\\,/,g' |
102 depmode=msvc7 | 108 depmode=msvc7 |
109 fi | |
110 | |
111 if test "$depmode" = xlc; then | |
112 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. | |
113 gccflag=-qmakedep=gcc,-MF | |
114 depmode=gcc | |
103 fi | 115 fi |
104 | 116 |
105 case "$depmode" in | 117 case "$depmode" in |
106 gcc3) | 118 gcc3) |
107 ## gcc 3 implements dependency tracking that does exactly what | 119 ## gcc 3 implements dependency tracking that does exactly what |
154 echo "$object : \\" > "$depfile" | 166 echo "$object : \\" > "$depfile" |
155 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz | 167 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz |
156 ## The second -e expression handles DOS-style file names with drive letters. | 168 ## The second -e expression handles DOS-style file names with drive letters. |
157 sed -e 's/^[^:]*: / /' \ | 169 sed -e 's/^[^:]*: / /' \ |
158 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" | 170 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" |
159 ## This next piece of magic avoids the `deleted header file' problem. | 171 ## This next piece of magic avoids the "deleted header file" problem. |
160 ## The problem is that when a header file which appears in a .P file | 172 ## The problem is that when a header file which appears in a .P file |
161 ## is deleted, the dependency causes make to die (because there is | 173 ## is deleted, the dependency causes make to die (because there is |
162 ## typically no way to rebuild the header). We avoid this by adding | 174 ## typically no way to rebuild the header). We avoid this by adding |
163 ## dummy dependencies for each header file. Too bad gcc doesn't do | 175 ## dummy dependencies for each header file. Too bad gcc doesn't do |
164 ## this for us directly. | 176 ## this for us directly. |
165 tr ' ' ' | 177 tr ' ' "$nl" < "$tmpdepfile" | |
166 ' < "$tmpdepfile" | | 178 ## Some versions of gcc put a space before the ':'. On the theory |
167 ## Some versions of gcc put a space before the `:'. On the theory | |
168 ## that the space means something, we add a space to the output as | 179 ## that the space means something, we add a space to the output as |
169 ## well. hp depmode also adds that space, but also prefixes the VPATH | 180 ## well. hp depmode also adds that space, but also prefixes the VPATH |
170 ## to the object. Take care to not repeat it in the output. | 181 ## to the object. Take care to not repeat it in the output. |
171 ## Some versions of the HPUX 10.20 sed can't process this invocation | 182 ## Some versions of the HPUX 10.20 sed can't process this invocation |
172 ## correctly. Breaking it into two sed invocations is a workaround. | 183 ## correctly. Breaking it into two sed invocations is a workaround. |
201 | 212 |
202 # Clip off the initial element (the dependent). Don't try to be | 213 # Clip off the initial element (the dependent). Don't try to be |
203 # clever and replace this with sed code, as IRIX sed won't handle | 214 # clever and replace this with sed code, as IRIX sed won't handle |
204 # lines with more than a fixed number of characters (4096 in | 215 # lines with more than a fixed number of characters (4096 in |
205 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; | 216 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; |
206 # the IRIX cc adds comments like `#:fec' to the end of the | 217 # the IRIX cc adds comments like '#:fec' to the end of the |
207 # dependency line. | 218 # dependency line. |
208 tr ' ' ' | 219 tr ' ' "$nl" < "$tmpdepfile" \ |
209 ' < "$tmpdepfile" \ | |
210 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ | 220 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ |
211 tr ' | 221 tr "$nl" ' ' >> "$depfile" |
212 ' ' ' >> "$depfile" | |
213 echo >> "$depfile" | 222 echo >> "$depfile" |
214 | 223 |
215 # The second pass generates a dummy entry for each header file. | 224 # The second pass generates a dummy entry for each header file. |
216 tr ' ' ' | 225 tr ' ' "$nl" < "$tmpdepfile" \ |
217 ' < "$tmpdepfile" \ | |
218 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ | 226 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ |
219 >> "$depfile" | 227 >> "$depfile" |
220 else | 228 else |
221 # The sourcefile does not contain any dependencies, so just | 229 # The sourcefile does not contain any dependencies, so just |
222 # store a dummy comment line, to avoid errors with the Makefile | 230 # store a dummy comment line, to avoid errors with the Makefile |
224 echo "#dummy" > "$depfile" | 232 echo "#dummy" > "$depfile" |
225 fi | 233 fi |
226 rm -f "$tmpdepfile" | 234 rm -f "$tmpdepfile" |
227 ;; | 235 ;; |
228 | 236 |
237 xlc) | |
238 # This case exists only to let depend.m4 do its work. It works by | |
239 # looking at the text of this script. This case will never be run, | |
240 # since it is checked for above. | |
241 exit 1 | |
242 ;; | |
243 | |
229 aix) | 244 aix) |
230 # The C for AIX Compiler uses -M and outputs the dependencies | 245 # The C for AIX Compiler uses -M and outputs the dependencies |
231 # in a .u file. In older versions, this file always lives in the | 246 # in a .u file. In older versions, this file always lives in the |
232 # current directory. Also, the AIX compiler puts `$object:' at the | 247 # current directory. Also, the AIX compiler puts '$object:' at the |
233 # start of each line; $object doesn't have directory information. | 248 # start of each line; $object doesn't have directory information. |
234 # Version 6 uses the directory in both cases. | 249 # Version 6 uses the directory in both cases. |
235 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` | 250 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
236 test "x$dir" = "x$object" && dir= | 251 test "x$dir" = "x$object" && dir= |
237 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` | 252 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` |
257 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" | 272 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" |
258 do | 273 do |
259 test -f "$tmpdepfile" && break | 274 test -f "$tmpdepfile" && break |
260 done | 275 done |
261 if test -f "$tmpdepfile"; then | 276 if test -f "$tmpdepfile"; then |
262 # Each line is of the form `foo.o: dependent.h'. | 277 # Each line is of the form 'foo.o: dependent.h'. |
263 # Do two passes, one to just change these to | 278 # Do two passes, one to just change these to |
264 # `$object: dependent.h' and one to simply `dependent.h:'. | 279 # '$object: dependent.h' and one to simply 'dependent.h:'. |
265 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" | 280 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
266 # That's a tab and a space in the []. | 281 sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
267 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" | |
268 else | 282 else |
269 # The sourcefile does not contain any dependencies, so just | 283 # The sourcefile does not contain any dependencies, so just |
270 # store a dummy comment line, to avoid errors with the Makefile | 284 # store a dummy comment line, to avoid errors with the Makefile |
271 # "include basename.Plo" scheme. | 285 # "include basename.Plo" scheme. |
272 echo "#dummy" > "$depfile" | 286 echo "#dummy" > "$depfile" |
273 fi | 287 fi |
274 rm -f "$tmpdepfile" | 288 rm -f "$tmpdepfile" |
275 ;; | 289 ;; |
276 | 290 |
277 icc) | 291 icc) |
278 # Intel's C compiler understands `-MD -MF file'. However on | 292 # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. |
279 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c | 293 # However on |
294 # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c | |
280 # ICC 7.0 will fill foo.d with something like | 295 # ICC 7.0 will fill foo.d with something like |
281 # foo.o: sub/foo.c | 296 # foo.o: sub/foo.c |
282 # foo.o: sub/foo.h | 297 # foo.o: sub/foo.h |
283 # which is wrong. We want: | 298 # which is wrong. We want |
284 # sub/foo.o: sub/foo.c | 299 # sub/foo.o: sub/foo.c |
285 # sub/foo.o: sub/foo.h | 300 # sub/foo.o: sub/foo.h |
286 # sub/foo.c: | 301 # sub/foo.c: |
287 # sub/foo.h: | 302 # sub/foo.h: |
288 # ICC 7.1 will output | 303 # ICC 7.1 will output |
289 # foo.o: sub/foo.c sub/foo.h | 304 # foo.o: sub/foo.c sub/foo.h |
290 # and will wrap long lines using \ : | 305 # and will wrap long lines using '\': |
291 # foo.o: sub/foo.c ... \ | 306 # foo.o: sub/foo.c ... \ |
292 # sub/foo.h ... \ | 307 # sub/foo.h ... \ |
293 # ... | 308 # ... |
294 | 309 # tcc 0.9.26 (FIXME still under development at the moment of writing) |
310 # will emit a similar output, but also prepend the continuation lines | |
311 # with horizontal tabulation characters. | |
295 "$@" -MD -MF "$tmpdepfile" | 312 "$@" -MD -MF "$tmpdepfile" |
296 stat=$? | 313 stat=$? |
297 if test $stat -eq 0; then : | 314 if test $stat -eq 0; then : |
298 else | 315 else |
299 rm -f "$tmpdepfile" | 316 rm -f "$tmpdepfile" |
300 exit $stat | 317 exit $stat |
301 fi | 318 fi |
302 rm -f "$depfile" | 319 rm -f "$depfile" |
303 # Each line is of the form `foo.o: dependent.h', | 320 # Each line is of the form 'foo.o: dependent.h', |
304 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. | 321 # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. |
305 # Do two passes, one to just change these to | 322 # Do two passes, one to just change these to |
306 # `$object: dependent.h' and one to simply `dependent.h:'. | 323 # '$object: dependent.h' and one to simply 'dependent.h:'. |
307 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" | 324 sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ |
308 # Some versions of the HPUX 10.20 sed can't process this invocation | 325 < "$tmpdepfile" > "$depfile" |
309 # correctly. Breaking it into two sed invocations is a workaround. | 326 sed ' |
310 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | | 327 s/[ '"$tab"'][ '"$tab"']*/ /g |
311 sed -e 's/$/ :/' >> "$depfile" | 328 s/^ *// |
329 s/ *\\*$// | |
330 s/^[^:]*: *// | |
331 /^$/d | |
332 /:$/d | |
333 s/$/ :/ | |
334 ' < "$tmpdepfile" >> "$depfile" | |
312 rm -f "$tmpdepfile" | 335 rm -f "$tmpdepfile" |
313 ;; | 336 ;; |
314 | 337 |
315 hp2) | 338 hp2) |
316 # The "hp" stanza above does not work with aCC (C++) and HP's ia64 | 339 # The "hp" stanza above does not work with aCC (C++) and HP's ia64 |
342 do | 365 do |
343 test -f "$tmpdepfile" && break | 366 test -f "$tmpdepfile" && break |
344 done | 367 done |
345 if test -f "$tmpdepfile"; then | 368 if test -f "$tmpdepfile"; then |
346 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" | 369 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" |
347 # Add `dependent.h:' lines. | 370 # Add 'dependent.h:' lines. |
348 sed -ne '2,${ | 371 sed -ne '2,${ |
349 s/^ *// | 372 s/^ *// |
350 s/ \\*$// | 373 s/ \\*$// |
351 s/$/:/ | 374 s/$/:/ |
352 p | 375 p |
357 rm -f "$tmpdepfile" "$tmpdepfile2" | 380 rm -f "$tmpdepfile" "$tmpdepfile2" |
358 ;; | 381 ;; |
359 | 382 |
360 tru64) | 383 tru64) |
361 # The Tru64 compiler uses -MD to generate dependencies as a side | 384 # The Tru64 compiler uses -MD to generate dependencies as a side |
362 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. | 385 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. |
363 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put | 386 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put |
364 # dependencies in `foo.d' instead, so we check for that too. | 387 # dependencies in 'foo.d' instead, so we check for that too. |
365 # Subdirectories are respected. | 388 # Subdirectories are respected. |
366 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` | 389 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` |
367 test "x$dir" = "x$object" && dir= | 390 test "x$dir" = "x$object" && dir= |
368 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` | 391 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` |
369 | 392 |
405 do | 428 do |
406 test -f "$tmpdepfile" && break | 429 test -f "$tmpdepfile" && break |
407 done | 430 done |
408 if test -f "$tmpdepfile"; then | 431 if test -f "$tmpdepfile"; then |
409 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" | 432 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
410 # That's a tab and a space in the []. | 433 sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
411 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" | |
412 else | 434 else |
413 echo "#dummy" > "$depfile" | 435 echo "#dummy" > "$depfile" |
414 fi | 436 fi |
415 rm -f "$tmpdepfile" | 437 rm -f "$tmpdepfile" |
416 ;; | 438 ;; |
441 s//\1/ | 463 s//\1/ |
442 s/\\/\\\\/g | 464 s/\\/\\\\/g |
443 p | 465 p |
444 }' | $cygpath_u | sort -u | sed -n ' | 466 }' | $cygpath_u | sort -u | sed -n ' |
445 s/ /\\ /g | 467 s/ /\\ /g |
446 s/\(.*\)/ \1 \\/p | 468 s/\(.*\)/'"$tab"'\1 \\/p |
447 s/.\(.*\) \\/\1:/ | 469 s/.\(.*\) \\/\1:/ |
448 H | 470 H |
449 $ { | 471 $ { |
450 s/.*/ / | 472 s/.*/'"$tab"'/ |
451 G | 473 G |
452 p | 474 p |
453 }' >> "$depfile" | 475 }' >> "$depfile" |
454 rm -f "$tmpdepfile" | 476 rm -f "$tmpdepfile" |
455 ;; | 477 ;; |
476 shift | 498 shift |
477 done | 499 done |
478 shift | 500 shift |
479 fi | 501 fi |
480 | 502 |
481 # Remove `-o $object'. | 503 # Remove '-o $object'. |
482 IFS=" " | 504 IFS=" " |
483 for arg | 505 for arg |
484 do | 506 do |
485 case $arg in | 507 case $arg in |
486 -o) | 508 -o) |
496 ;; | 518 ;; |
497 esac | 519 esac |
498 done | 520 done |
499 | 521 |
500 test -z "$dashmflag" && dashmflag=-M | 522 test -z "$dashmflag" && dashmflag=-M |
501 # Require at least two characters before searching for `:' | 523 # Require at least two characters before searching for ':' |
502 # in the target name. This is to cope with DOS-style filenames: | 524 # in the target name. This is to cope with DOS-style filenames: |
503 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. | 525 # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. |
504 "$@" $dashmflag | | 526 "$@" $dashmflag | |
505 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" | 527 sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" |
506 rm -f "$depfile" | 528 rm -f "$depfile" |
507 cat < "$tmpdepfile" > "$depfile" | 529 cat < "$tmpdepfile" > "$depfile" |
508 tr ' ' ' | 530 tr ' ' "$nl" < "$tmpdepfile" | \ |
509 ' < "$tmpdepfile" | \ | |
510 ## Some versions of the HPUX 10.20 sed can't process this invocation | 531 ## Some versions of the HPUX 10.20 sed can't process this invocation |
511 ## correctly. Breaking it into two sed invocations is a workaround. | 532 ## correctly. Breaking it into two sed invocations is a workaround. |
512 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" | 533 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
513 rm -f "$tmpdepfile" | 534 rm -f "$tmpdepfile" |
514 ;; | 535 ;; |
560 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" | 581 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" |
561 rm -f "$depfile" | 582 rm -f "$depfile" |
562 # makedepend may prepend the VPATH from the source file name to the object. | 583 # makedepend may prepend the VPATH from the source file name to the object. |
563 # No need to regex-escape $object, excess matching of '.' is harmless. | 584 # No need to regex-escape $object, excess matching of '.' is harmless. |
564 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" | 585 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" |
565 sed '1,2d' "$tmpdepfile" | tr ' ' ' | 586 sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ |
566 ' | \ | |
567 ## Some versions of the HPUX 10.20 sed can't process this invocation | 587 ## Some versions of the HPUX 10.20 sed can't process this invocation |
568 ## correctly. Breaking it into two sed invocations is a workaround. | 588 ## correctly. Breaking it into two sed invocations is a workaround. |
569 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" | 589 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" |
570 rm -f "$tmpdepfile" "$tmpdepfile".bak | 590 rm -f "$tmpdepfile" "$tmpdepfile".bak |
571 ;; | 591 ;; |
581 shift | 601 shift |
582 done | 602 done |
583 shift | 603 shift |
584 fi | 604 fi |
585 | 605 |
586 # Remove `-o $object'. | 606 # Remove '-o $object'. |
587 IFS=" " | 607 IFS=" " |
588 for arg | 608 for arg |
589 do | 609 do |
590 case $arg in | 610 case $arg in |
591 -o) | 611 -o) |
650 done | 670 done |
651 "$@" -E 2>/dev/null | | 671 "$@" -E 2>/dev/null | |
652 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" | 672 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" |
653 rm -f "$depfile" | 673 rm -f "$depfile" |
654 echo "$object : \\" > "$depfile" | 674 echo "$object : \\" > "$depfile" |
655 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" | 675 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" |
656 echo " " >> "$depfile" | 676 echo "$tab" >> "$depfile" |
657 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" | 677 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" |
658 rm -f "$tmpdepfile" | 678 rm -f "$tmpdepfile" |
659 ;; | 679 ;; |
660 | 680 |
661 msvcmsys) | 681 msvcmsys) |