1 |
#! /bin/sh |
#! /bin/sh |
2 |
|
|
3 |
# depcomp - compile a program generating dependencies as side-effects |
# depcomp - compile a program generating dependencies as side-effects |
4 |
# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. |
# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. |
5 |
|
|
6 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
7 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
207 |
;; |
;; |
208 |
|
|
209 |
icc) |
icc) |
210 |
# Must come before tru64. |
# Intel's C compiler understands `-MD -MF file'. However on |
|
|
|
|
# Intel's C compiler understands `-MD -MF file'. However |
|
211 |
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c |
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c |
212 |
# will fill foo.d with something like |
# ICC 7.0 will fill foo.d with something like |
213 |
# foo.o: sub/foo.c |
# foo.o: sub/foo.c |
214 |
# foo.o: sub/foo.h |
# foo.o: sub/foo.h |
215 |
# which is wrong. We want: |
# which is wrong. We want: |
217 |
# sub/foo.o: sub/foo.h |
# sub/foo.o: sub/foo.h |
218 |
# sub/foo.c: |
# sub/foo.c: |
219 |
# sub/foo.h: |
# sub/foo.h: |
220 |
|
# ICC 7.1 will output |
221 |
|
# foo.o: sub/foo.c sub/foo.h |
222 |
|
# and will wrap long lines using \ : |
223 |
|
# foo.o: sub/foo.c ... \ |
224 |
|
# sub/foo.h ... \ |
225 |
|
# ... |
226 |
|
|
227 |
"$@" -MD -MF "$tmpdepfile" |
"$@" -MD -MF "$tmpdepfile" |
228 |
stat=$? |
stat=$? |
232 |
exit $stat |
exit $stat |
233 |
fi |
fi |
234 |
rm -f "$depfile" |
rm -f "$depfile" |
235 |
# Each line is of the form `foo.o: dependent.h'. |
# Each line is of the form `foo.o: dependent.h', |
236 |
|
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. |
237 |
# Do two passes, one to just change these to |
# Do two passes, one to just change these to |
238 |
# `$object: dependent.h' and one to simply `dependent.h:'. |
# `$object: dependent.h' and one to simply `dependent.h:'. |
239 |
sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" |
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" |
240 |
sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" |
# Some versions of the HPUX 10.20 sed can't process this invocation |
241 |
|
# correctly. Breaking it into two sed invocations is a workaround. |
242 |
|
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | |
243 |
|
sed -e 's/$/ :/' >> "$depfile" |
244 |
rm -f "$tmpdepfile" |
rm -f "$tmpdepfile" |
245 |
;; |
;; |
246 |
|
|
278 |
fi |
fi |
279 |
if test -f "$tmpdepfile"; then |
if test -f "$tmpdepfile"; then |
280 |
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" |
281 |
# That's a space and a tab in the []. |
# That's a tab and a space in the []. |
282 |
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" |
283 |
else |
else |
284 |
echo "#dummy" > "$depfile" |
echo "#dummy" > "$depfile" |