xref: /netbsd-src/external/gpl2/grep/dist/depcomp (revision a8fa202a6440953be7b92a8960a811bff58203f4)
1*a8fa202aSchristos#! /bin/sh
2*a8fa202aSchristos
3*a8fa202aSchristos# depcomp - compile a program generating dependencies as side-effects
4*a8fa202aSchristos# Copyright 1999, 2000 Free Software Foundation, Inc.
5*a8fa202aSchristos
6*a8fa202aSchristos# This program is free software; you can redistribute it and/or modify
7*a8fa202aSchristos# it under the terms of the GNU General Public License as published by
8*a8fa202aSchristos# the Free Software Foundation; either version 2, or (at your option)
9*a8fa202aSchristos# any later version.
10*a8fa202aSchristos
11*a8fa202aSchristos# This program is distributed in the hope that it will be useful,
12*a8fa202aSchristos# but WITHOUT ANY WARRANTY; without even the implied warranty of
13*a8fa202aSchristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*a8fa202aSchristos# GNU General Public License for more details.
15*a8fa202aSchristos
16*a8fa202aSchristos# You should have received a copy of the GNU General Public License
17*a8fa202aSchristos# along with this program; if not, write to the Free Software
18*a8fa202aSchristos# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19*a8fa202aSchristos# 02111-1307, USA.
20*a8fa202aSchristos
21*a8fa202aSchristos# As a special exception to the GNU General Public License, if you
22*a8fa202aSchristos# distribute this file as part of a program that contains a
23*a8fa202aSchristos# configuration script generated by Autoconf, you may include it under
24*a8fa202aSchristos# the same distribution terms that you use for the rest of that program.
25*a8fa202aSchristos
26*a8fa202aSchristos# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
27*a8fa202aSchristos
28*a8fa202aSchristosif test -z "$depmode" || test -z "$source" || test -z "$object"; then
29*a8fa202aSchristos  echo "depcomp: Variables source, object and depmode must be set" 1>&2
30*a8fa202aSchristos  exit 1
31*a8fa202aSchristosfi
32*a8fa202aSchristos# `libtool' can also be set to `yes' or `no'.
33*a8fa202aSchristos
34*a8fa202aSchristosdepfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
35*a8fa202aSchristostmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
36*a8fa202aSchristos
37*a8fa202aSchristosrm -f "$tmpdepfile"
38*a8fa202aSchristos
39*a8fa202aSchristos# Some modes work just like other modes, but use different flags.  We
40*a8fa202aSchristos# parameterize here, but still list the modes in the big case below,
41*a8fa202aSchristos# to make depend.m4 easier to write.  Note that we *cannot* use a case
42*a8fa202aSchristos# here, because this file can only contain one case statement.
43*a8fa202aSchristosif test "$depmode" = hp; then
44*a8fa202aSchristos  # HP compiler uses -M and no extra arg.
45*a8fa202aSchristos  gccflag=-M
46*a8fa202aSchristos  depmode=gcc
47*a8fa202aSchristosfi
48*a8fa202aSchristos
49*a8fa202aSchristosif test "$depmode" = dashXmstdout; then
50*a8fa202aSchristos   # This is just like dashmstdout with a different argument.
51*a8fa202aSchristos   dashmflag=-xM
52*a8fa202aSchristos   depmode=dashmstdout
53*a8fa202aSchristosfi
54*a8fa202aSchristos
55*a8fa202aSchristoscase "$depmode" in
56*a8fa202aSchristosgcc3)
57*a8fa202aSchristos## gcc 3 implements dependency tracking that does exactly what
58*a8fa202aSchristos## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
59*a8fa202aSchristos## it if -MD -MP comes after the -MF stuff.  Hmm.
60*a8fa202aSchristos  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
61*a8fa202aSchristos  stat=$?
62*a8fa202aSchristos  if test $stat -eq 0; then :
63*a8fa202aSchristos  else
64*a8fa202aSchristos    rm -f "$tmpdepfile"
65*a8fa202aSchristos    exit $stat
66*a8fa202aSchristos  fi
67*a8fa202aSchristos  mv "$tmpdepfile" "$depfile"
68*a8fa202aSchristos  ;;
69*a8fa202aSchristos
70*a8fa202aSchristosgcc)
71*a8fa202aSchristos## There are various ways to get dependency output from gcc.  Here's
72*a8fa202aSchristos## why we pick this rather obscure method:
73*a8fa202aSchristos## - Don't want to use -MD because we'd like the dependencies to end
74*a8fa202aSchristos##   up in a subdir.  Having to rename by hand is ugly.
75*a8fa202aSchristos##   (We might end up doing this anyway to support other compilers.)
76*a8fa202aSchristos## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
77*a8fa202aSchristos##   -MM, not -M (despite what the docs say).
78*a8fa202aSchristos## - Using -M directly means running the compiler twice (even worse
79*a8fa202aSchristos##   than renaming).
80*a8fa202aSchristos  if test -z "$gccflag"; then
81*a8fa202aSchristos    gccflag=-MD,
82*a8fa202aSchristos  fi
83*a8fa202aSchristos  "$@" -Wp,"$gccflag$tmpdepfile"
84*a8fa202aSchristos  stat=$?
85*a8fa202aSchristos  if test $stat -eq 0; then :
86*a8fa202aSchristos  else
87*a8fa202aSchristos    rm -f "$tmpdepfile"
88*a8fa202aSchristos    exit $stat
89*a8fa202aSchristos  fi
90*a8fa202aSchristos  rm -f "$depfile"
91*a8fa202aSchristos  echo "$object : \\" > "$depfile"
92*a8fa202aSchristos  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
93*a8fa202aSchristos## The second -e expression handles DOS-style file names with drive letters.
94*a8fa202aSchristos  sed -e 's/^[^:]*: / /' \
95*a8fa202aSchristos      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
96*a8fa202aSchristos## This next piece of magic avoids the `deleted header file' problem.
97*a8fa202aSchristos## The problem is that when a header file which appears in a .P file
98*a8fa202aSchristos## is deleted, the dependency causes make to die (because there is
99*a8fa202aSchristos## typically no way to rebuild the header).  We avoid this by adding
100*a8fa202aSchristos## dummy dependencies for each header file.  Too bad gcc doesn't do
101*a8fa202aSchristos## this for us directly.
102*a8fa202aSchristos  tr ' ' '
103*a8fa202aSchristos' < "$tmpdepfile" |
104*a8fa202aSchristos## Some versions of gcc put a space before the `:'.  On the theory
105*a8fa202aSchristos## that the space means something, we add a space to the output as
106*a8fa202aSchristos## well.
107*a8fa202aSchristos## Some versions of the HPUX 10.20 sed can't process this invocation
108*a8fa202aSchristos## correctly.  Breaking it into two sed invocations is a workaround.
109*a8fa202aSchristos    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
110*a8fa202aSchristos  rm -f "$tmpdepfile"
111*a8fa202aSchristos  ;;
112*a8fa202aSchristos
113*a8fa202aSchristoshp)
114*a8fa202aSchristos  # This case exists only to let depend.m4 do its work.  It works by
115*a8fa202aSchristos  # looking at the text of this script.  This case will never be run,
116*a8fa202aSchristos  # since it is checked for above.
117*a8fa202aSchristos  exit 1
118*a8fa202aSchristos  ;;
119*a8fa202aSchristos
120*a8fa202aSchristossgi)
121*a8fa202aSchristos  if test "$libtool" = yes; then
122*a8fa202aSchristos    "$@" "-Wp,-MDupdate,$tmpdepfile"
123*a8fa202aSchristos  else
124*a8fa202aSchristos    "$@" -MDupdate "$tmpdepfile"
125*a8fa202aSchristos  fi
126*a8fa202aSchristos  stat=$?
127*a8fa202aSchristos  if test $stat -eq 0; then :
128*a8fa202aSchristos  else
129*a8fa202aSchristos    rm -f "$tmpdepfile"
130*a8fa202aSchristos    exit $stat
131*a8fa202aSchristos  fi
132*a8fa202aSchristos  rm -f "$depfile"
133*a8fa202aSchristos
134*a8fa202aSchristos  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
135*a8fa202aSchristos    echo "$object : \\" > "$depfile"
136*a8fa202aSchristos
137*a8fa202aSchristos    # Clip off the initial element (the dependent).  Don't try to be
138*a8fa202aSchristos    # clever and replace this with sed code, as IRIX sed won't handle
139*a8fa202aSchristos    # lines with more than a fixed number of characters (4096 in
140*a8fa202aSchristos    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
141*a8fa202aSchristos    # the IRIX cc adds comments like `#:fec' to the end of the
142*a8fa202aSchristos    # dependency line.
143*a8fa202aSchristos    tr ' ' '
144*a8fa202aSchristos' < "$tmpdepfile" \
145*a8fa202aSchristos    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
146*a8fa202aSchristos    tr '
147*a8fa202aSchristos' ' ' >> $depfile
148*a8fa202aSchristos    echo >> $depfile
149*a8fa202aSchristos
150*a8fa202aSchristos    # The second pass generates a dummy entry for each header file.
151*a8fa202aSchristos    tr ' ' '
152*a8fa202aSchristos' < "$tmpdepfile" \
153*a8fa202aSchristos   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
154*a8fa202aSchristos   >> $depfile
155*a8fa202aSchristos  else
156*a8fa202aSchristos    # The sourcefile does not contain any dependencies, so just
157*a8fa202aSchristos    # store a dummy comment line, to avoid errors with the Makefile
158*a8fa202aSchristos    # "include basename.Plo" scheme.
159*a8fa202aSchristos    echo "#dummy" > "$depfile"
160*a8fa202aSchristos  fi
161*a8fa202aSchristos  rm -f "$tmpdepfile"
162*a8fa202aSchristos  ;;
163*a8fa202aSchristos
164*a8fa202aSchristosaix)
165*a8fa202aSchristos  # The C for AIX Compiler uses -M and outputs the dependencies
166*a8fa202aSchristos  # in a .u file.  This file always lives in the current directory.
167*a8fa202aSchristos  # Also, the AIX compiler puts `$object:' at the start of each line;
168*a8fa202aSchristos  # $object doesn't have directory information.
169*a8fa202aSchristos  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
170*a8fa202aSchristos  tmpdepfile="$stripped.u"
171*a8fa202aSchristos  outname="$stripped.o"
172*a8fa202aSchristos  if test "$libtool" = yes; then
173*a8fa202aSchristos    "$@" -Wc,-M
174*a8fa202aSchristos  else
175*a8fa202aSchristos    "$@" -M
176*a8fa202aSchristos  fi
177*a8fa202aSchristos
178*a8fa202aSchristos  stat=$?
179*a8fa202aSchristos  if test $stat -eq 0; then :
180*a8fa202aSchristos  else
181*a8fa202aSchristos    rm -f "$tmpdepfile"
182*a8fa202aSchristos    exit $stat
183*a8fa202aSchristos  fi
184*a8fa202aSchristos
185*a8fa202aSchristos  if test -f "$tmpdepfile"; then
186*a8fa202aSchristos    # Each line is of the form `foo.o: dependent.h'.
187*a8fa202aSchristos    # Do two passes, one to just change these to
188*a8fa202aSchristos    # `$object: dependent.h' and one to simply `dependent.h:'.
189*a8fa202aSchristos    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
190*a8fa202aSchristos    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
191*a8fa202aSchristos  else
192*a8fa202aSchristos    # The sourcefile does not contain any dependencies, so just
193*a8fa202aSchristos    # store a dummy comment line, to avoid errors with the Makefile
194*a8fa202aSchristos    # "include basename.Plo" scheme.
195*a8fa202aSchristos    echo "#dummy" > "$depfile"
196*a8fa202aSchristos  fi
197*a8fa202aSchristos  rm -f "$tmpdepfile"
198*a8fa202aSchristos  ;;
199*a8fa202aSchristos
200*a8fa202aSchristostru64)
201*a8fa202aSchristos   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
202*a8fa202aSchristos   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
203*a8fa202aSchristos   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
204*a8fa202aSchristos   # dependencies in `foo.d' instead, so we check for that too.
205*a8fa202aSchristos   # Subdirectories are respected.
206*a8fa202aSchristos
207*a8fa202aSchristos   tmpdepfile1="$object.d"
208*a8fa202aSchristos   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
209*a8fa202aSchristos   if test "$libtool" = yes; then
210*a8fa202aSchristos      "$@" -Wc,-MD
211*a8fa202aSchristos   else
212*a8fa202aSchristos      "$@" -MD
213*a8fa202aSchristos   fi
214*a8fa202aSchristos
215*a8fa202aSchristos   stat=$?
216*a8fa202aSchristos   if test $stat -eq 0; then :
217*a8fa202aSchristos   else
218*a8fa202aSchristos      rm -f "$tmpdepfile1" "$tmpdepfile2"
219*a8fa202aSchristos      exit $stat
220*a8fa202aSchristos   fi
221*a8fa202aSchristos
222*a8fa202aSchristos   if test -f "$tmpdepfile1"; then
223*a8fa202aSchristos      tmpdepfile="$tmpdepfile1"
224*a8fa202aSchristos   else
225*a8fa202aSchristos      tmpdepfile="$tmpdepfile2"
226*a8fa202aSchristos   fi
227*a8fa202aSchristos   if test -f "$tmpdepfile"; then
228*a8fa202aSchristos      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
229*a8fa202aSchristos      # That's a space and a tab in the [].
230*a8fa202aSchristos      sed -e 's,^.*\.[a-z]*:[ 	]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
231*a8fa202aSchristos   else
232*a8fa202aSchristos      echo "#dummy" > "$depfile"
233*a8fa202aSchristos   fi
234*a8fa202aSchristos   rm -f "$tmpdepfile"
235*a8fa202aSchristos   ;;
236*a8fa202aSchristos
237*a8fa202aSchristos#nosideeffect)
238*a8fa202aSchristos  # This comment above is used by automake to tell side-effect
239*a8fa202aSchristos  # dependency tracking mechanisms from slower ones.
240*a8fa202aSchristos
241*a8fa202aSchristosdashmstdout)
242*a8fa202aSchristos  # Important note: in order to support this mode, a compiler *must*
243*a8fa202aSchristos  # always write the proprocessed file to stdout, regardless of -o,
244*a8fa202aSchristos  # because we must use -o when running libtool.
245*a8fa202aSchristos  test -z "$dashmflag" && dashmflag=-M
246*a8fa202aSchristos  ( IFS=" "
247*a8fa202aSchristos    case " $* " in
248*a8fa202aSchristos    *" --mode=compile "*) # this is libtool, let us make it quiet
249*a8fa202aSchristos      for arg
250*a8fa202aSchristos      do # cycle over the arguments
251*a8fa202aSchristos        case "$arg" in
252*a8fa202aSchristos	"--mode=compile")
253*a8fa202aSchristos	  # insert --quiet before "--mode=compile"
254*a8fa202aSchristos	  set fnord "$@" --quiet
255*a8fa202aSchristos	  shift # fnord
256*a8fa202aSchristos	  ;;
257*a8fa202aSchristos	esac
258*a8fa202aSchristos	set fnord "$@" "$arg"
259*a8fa202aSchristos	shift # fnord
260*a8fa202aSchristos	shift # "$arg"
261*a8fa202aSchristos      done
262*a8fa202aSchristos      ;;
263*a8fa202aSchristos    esac
264*a8fa202aSchristos    "$@" $dashmflag | sed 's:^[^:]*\:[ 	]*:'"$object"'\: :' > "$tmpdepfile"
265*a8fa202aSchristos  ) &
266*a8fa202aSchristos  proc=$!
267*a8fa202aSchristos  "$@"
268*a8fa202aSchristos  stat=$?
269*a8fa202aSchristos  wait "$proc"
270*a8fa202aSchristos  if test "$stat" != 0; then exit $stat; fi
271*a8fa202aSchristos  rm -f "$depfile"
272*a8fa202aSchristos  cat < "$tmpdepfile" > "$depfile"
273*a8fa202aSchristos  tr ' ' '
274*a8fa202aSchristos' < "$tmpdepfile" | \
275*a8fa202aSchristos## Some versions of the HPUX 10.20 sed can't process this invocation
276*a8fa202aSchristos## correctly.  Breaking it into two sed invocations is a workaround.
277*a8fa202aSchristos    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
278*a8fa202aSchristos  rm -f "$tmpdepfile"
279*a8fa202aSchristos  ;;
280*a8fa202aSchristos
281*a8fa202aSchristosdashXmstdout)
282*a8fa202aSchristos  # This case only exists to satisfy depend.m4.  It is never actually
283*a8fa202aSchristos  # run, as this mode is specially recognized in the preamble.
284*a8fa202aSchristos  exit 1
285*a8fa202aSchristos  ;;
286*a8fa202aSchristos
287*a8fa202aSchristosmakedepend)
288*a8fa202aSchristos  # X makedepend
289*a8fa202aSchristos  (
290*a8fa202aSchristos    shift
291*a8fa202aSchristos    cleared=no
292*a8fa202aSchristos    for arg in "$@"; do
293*a8fa202aSchristos      case $cleared in no)
294*a8fa202aSchristos        set ""; shift
295*a8fa202aSchristos	cleared=yes
296*a8fa202aSchristos      esac
297*a8fa202aSchristos      case "$arg" in
298*a8fa202aSchristos        -D*|-I*)
299*a8fa202aSchristos	  set fnord "$@" "$arg"; shift;;
300*a8fa202aSchristos	-*)
301*a8fa202aSchristos	  ;;
302*a8fa202aSchristos	*)
303*a8fa202aSchristos	  set fnord "$@" "$arg"; shift;;
304*a8fa202aSchristos      esac
305*a8fa202aSchristos    done
306*a8fa202aSchristos    obj_suffix="`echo $object | sed 's/^.*\././'`"
307*a8fa202aSchristos    touch "$tmpdepfile"
308*a8fa202aSchristos    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
309*a8fa202aSchristos  ) &
310*a8fa202aSchristos  proc=$!
311*a8fa202aSchristos  "$@"
312*a8fa202aSchristos  stat=$?
313*a8fa202aSchristos  wait "$proc"
314*a8fa202aSchristos  if test "$stat" != 0; then exit $stat; fi
315*a8fa202aSchristos  rm -f "$depfile"
316*a8fa202aSchristos  cat < "$tmpdepfile" > "$depfile"
317*a8fa202aSchristos  tail +3 "$tmpdepfile" | tr ' ' '
318*a8fa202aSchristos' | \
319*a8fa202aSchristos## Some versions of the HPUX 10.20 sed can't process this invocation
320*a8fa202aSchristos## correctly.  Breaking it into two sed invocations is a workaround.
321*a8fa202aSchristos    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
322*a8fa202aSchristos  rm -f "$tmpdepfile" "$tmpdepfile".bak
323*a8fa202aSchristos  ;;
324*a8fa202aSchristos
325*a8fa202aSchristoscpp)
326*a8fa202aSchristos  # Important note: in order to support this mode, a compiler *must*
327*a8fa202aSchristos  # always write the proprocessed file to stdout, regardless of -o,
328*a8fa202aSchristos  # because we must use -o when running libtool.
329*a8fa202aSchristos  ( IFS=" "
330*a8fa202aSchristos    case " $* " in
331*a8fa202aSchristos    *" --mode=compile "*)
332*a8fa202aSchristos      for arg
333*a8fa202aSchristos      do # cycle over the arguments
334*a8fa202aSchristos        case $arg in
335*a8fa202aSchristos	"--mode=compile")
336*a8fa202aSchristos	  # insert --quiet before "--mode=compile"
337*a8fa202aSchristos	  set fnord "$@" --quiet
338*a8fa202aSchristos	  shift # fnord
339*a8fa202aSchristos	  ;;
340*a8fa202aSchristos	esac
341*a8fa202aSchristos	set fnord "$@" "$arg"
342*a8fa202aSchristos	shift # fnord
343*a8fa202aSchristos	shift # "$arg"
344*a8fa202aSchristos      done
345*a8fa202aSchristos      ;;
346*a8fa202aSchristos    esac
347*a8fa202aSchristos    "$@" -E |
348*a8fa202aSchristos    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
349*a8fa202aSchristos    sed '$ s: \\$::' > "$tmpdepfile"
350*a8fa202aSchristos  ) &
351*a8fa202aSchristos  proc=$!
352*a8fa202aSchristos  "$@"
353*a8fa202aSchristos  stat=$?
354*a8fa202aSchristos  wait "$proc"
355*a8fa202aSchristos  if test "$stat" != 0; then exit $stat; fi
356*a8fa202aSchristos  rm -f "$depfile"
357*a8fa202aSchristos  echo "$object : \\" > "$depfile"
358*a8fa202aSchristos  cat < "$tmpdepfile" >> "$depfile"
359*a8fa202aSchristos  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
360*a8fa202aSchristos  rm -f "$tmpdepfile"
361*a8fa202aSchristos  ;;
362*a8fa202aSchristos
363*a8fa202aSchristosmsvisualcpp)
364*a8fa202aSchristos  # Important note: in order to support this mode, a compiler *must*
365*a8fa202aSchristos  # always write the proprocessed file to stdout, regardless of -o,
366*a8fa202aSchristos  # because we must use -o when running libtool.
367*a8fa202aSchristos  ( IFS=" "
368*a8fa202aSchristos    case " $* " in
369*a8fa202aSchristos    *" --mode=compile "*)
370*a8fa202aSchristos      for arg
371*a8fa202aSchristos      do # cycle over the arguments
372*a8fa202aSchristos        case $arg in
373*a8fa202aSchristos	"--mode=compile")
374*a8fa202aSchristos	  # insert --quiet before "--mode=compile"
375*a8fa202aSchristos	  set fnord "$@" --quiet
376*a8fa202aSchristos	  shift # fnord
377*a8fa202aSchristos	  ;;
378*a8fa202aSchristos	esac
379*a8fa202aSchristos	set fnord "$@" "$arg"
380*a8fa202aSchristos	shift # fnord
381*a8fa202aSchristos	shift # "$arg"
382*a8fa202aSchristos      done
383*a8fa202aSchristos      ;;
384*a8fa202aSchristos    esac
385*a8fa202aSchristos    "$@" -E |
386*a8fa202aSchristos    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
387*a8fa202aSchristos  ) &
388*a8fa202aSchristos  proc=$!
389*a8fa202aSchristos  "$@"
390*a8fa202aSchristos  stat=$?
391*a8fa202aSchristos  wait "$proc"
392*a8fa202aSchristos  if test "$stat" != 0; then exit $stat; fi
393*a8fa202aSchristos  rm -f "$depfile"
394*a8fa202aSchristos  echo "$object : \\" > "$depfile"
395*a8fa202aSchristos  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
396*a8fa202aSchristos  echo "	" >> "$depfile"
397*a8fa202aSchristos  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
398*a8fa202aSchristos  rm -f "$tmpdepfile"
399*a8fa202aSchristos  ;;
400*a8fa202aSchristos
401*a8fa202aSchristosnone)
402*a8fa202aSchristos  exec "$@"
403*a8fa202aSchristos  ;;
404*a8fa202aSchristos
405*a8fa202aSchristos*)
406*a8fa202aSchristos  echo "Unknown depmode $depmode" 1>&2
407*a8fa202aSchristos  exit 1
408*a8fa202aSchristos  ;;
409*a8fa202aSchristosesac
410*a8fa202aSchristos
411*a8fa202aSchristosexit 0
412