/[bison]/bison/config/depcomp
ViewVC logotype

Diff of /bison/config/depcomp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by akim, Wed Jun 25 13:45:57 2003 UTC revision 1.8 by akim, Mon Aug 25 07:15:07 2003 UTC
# Line 1  Line 1 
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
# Line 207  aix) Line 207  aix)
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:
# Line 219  icc) Line 217  icc)
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=$?
# Line 228  icc) Line 232  icc)
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    
# Line 270  tru64) Line 278  tru64)
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"

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26