annotate depcomp @ 286:701132971855 2.3

Fixed regression related to force linking a library file
author lost
date Sat, 25 Apr 2009 02:18:06 +0000
parents 2cb097e760a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
1 #! /bin/sh
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
2 # depcomp - compile a program generating dependencies as side-effects
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
3
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
4 scriptversion=2007-03-29.01
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
5
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
6 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
7 # Foundation, Inc.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
8
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
9 # This program is free software; you can redistribute it and/or modify
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
10 # it under the terms of the GNU General Public License as published by
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
11 # the Free Software Foundation; either version 2, or (at your option)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
12 # any later version.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
13
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
14 # This program is distributed in the hope that it will be useful,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
17 # GNU General Public License for more details.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
18
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
20 # along with this program; if not, write to the Free Software
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
22 # 02110-1301, USA.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
23
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
24 # As a special exception to the GNU General Public License, if you
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
25 # distribute this file as part of a program that contains a
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
26 # configuration script generated by Autoconf, you may include it under
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
27 # the same distribution terms that you use for the rest of that program.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
28
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
29 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
30
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
31 case $1 in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
32 '')
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
33 echo "$0: No command. Try \`$0 --help' for more information." 1>&2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
34 exit 1;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
35 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
36 -h | --h*)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
37 cat <<\EOF
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
38 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
39
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
40 Run PROGRAMS ARGS to compile a file, generating dependencies
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
41 as side-effects.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
42
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
43 Environment variables:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
44 depmode Dependency tracking mode.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
45 source Source file read by `PROGRAMS ARGS'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
46 object Object file output by `PROGRAMS ARGS'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
47 DEPDIR directory where to store dependencies.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
48 depfile Dependency file to output.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
49 tmpdepfile Temporary file to use when outputing dependencies.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
50 libtool Whether libtool is used (yes/no).
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
51
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
52 Report bugs to <bug-automake@gnu.org>.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
53 EOF
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
54 exit $?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
55 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
56 -v | --v*)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
57 echo "depcomp $scriptversion"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
58 exit $?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
59 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
60 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
61
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
62 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
63 echo "depcomp: Variables source, object and depmode must be set" 1>&2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
64 exit 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
65 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
66
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
67 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
68 depfile=${depfile-`echo "$object" |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
69 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
70 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
71
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
72 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
73
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
74 # Some modes work just like other modes, but use different flags. We
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
75 # parameterize here, but still list the modes in the big case below,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
76 # to make depend.m4 easier to write. Note that we *cannot* use a case
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
77 # here, because this file can only contain one case statement.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
78 if test "$depmode" = hp; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
79 # HP compiler uses -M and no extra arg.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
80 gccflag=-M
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
81 depmode=gcc
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
82 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
83
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
84 if test "$depmode" = dashXmstdout; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
85 # This is just like dashmstdout with a different argument.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
86 dashmflag=-xM
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
87 depmode=dashmstdout
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
88 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
89
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
90 case "$depmode" in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
91 gcc3)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
92 ## gcc 3 implements dependency tracking that does exactly what
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
93 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
94 ## it if -MD -MP comes after the -MF stuff. Hmm.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
95 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
96 ## the command line argument order; so add the flags where they
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
97 ## appear in depend2.am. Note that the slowdown incurred here
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
98 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
99 for arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
100 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
101 case $arg in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
102 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
103 *) set fnord "$@" "$arg" ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
104 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
105 shift # fnord
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
106 shift # $arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
107 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
108 "$@"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
109 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
110 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
111 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
112 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
113 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
114 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
115 mv "$tmpdepfile" "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
116 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
117
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
118 gcc)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
119 ## There are various ways to get dependency output from gcc. Here's
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
120 ## why we pick this rather obscure method:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
121 ## - Don't want to use -MD because we'd like the dependencies to end
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
122 ## up in a subdir. Having to rename by hand is ugly.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
123 ## (We might end up doing this anyway to support other compilers.)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
124 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
125 ## -MM, not -M (despite what the docs say).
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
126 ## - Using -M directly means running the compiler twice (even worse
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
127 ## than renaming).
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
128 if test -z "$gccflag"; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
129 gccflag=-MD,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
130 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
131 "$@" -Wp,"$gccflag$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
132 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
133 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
134 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
135 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
136 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
137 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
138 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
139 echo "$object : \\" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
140 alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
141 ## The second -e expression handles DOS-style file names with drive letters.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
142 sed -e 's/^[^:]*: / /' \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
143 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
144 ## This next piece of magic avoids the `deleted header file' problem.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
145 ## The problem is that when a header file which appears in a .P file
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
146 ## is deleted, the dependency causes make to die (because there is
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
147 ## typically no way to rebuild the header). We avoid this by adding
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
148 ## dummy dependencies for each header file. Too bad gcc doesn't do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
149 ## this for us directly.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
150 tr ' ' '
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
151 ' < "$tmpdepfile" |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
152 ## Some versions of gcc put a space before the `:'. On the theory
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
153 ## that the space means something, we add a space to the output as
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
154 ## well.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
155 ## Some versions of the HPUX 10.20 sed can't process this invocation
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
156 ## correctly. Breaking it into two sed invocations is a workaround.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
157 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
158 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
159 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
160
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
161 hp)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
162 # This case exists only to let depend.m4 do its work. It works by
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
163 # looking at the text of this script. This case will never be run,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
164 # since it is checked for above.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
165 exit 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
166 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
167
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
168 sgi)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
169 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
170 "$@" "-Wp,-MDupdate,$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
171 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
172 "$@" -MDupdate "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
173 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
174 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
175 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
176 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
177 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
178 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
179 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
180 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
181
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
182 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
183 echo "$object : \\" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
184
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
185 # Clip off the initial element (the dependent). Don't try to be
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
186 # clever and replace this with sed code, as IRIX sed won't handle
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
187 # lines with more than a fixed number of characters (4096 in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
188 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
189 # the IRIX cc adds comments like `#:fec' to the end of the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
190 # dependency line.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
191 tr ' ' '
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
192 ' < "$tmpdepfile" \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
193 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
194 tr '
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
195 ' ' ' >> $depfile
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
196 echo >> $depfile
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
197
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
198 # The second pass generates a dummy entry for each header file.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
199 tr ' ' '
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
200 ' < "$tmpdepfile" \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
201 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
202 >> $depfile
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
203 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
204 # The sourcefile does not contain any dependencies, so just
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
205 # store a dummy comment line, to avoid errors with the Makefile
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
206 # "include basename.Plo" scheme.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
207 echo "#dummy" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
208 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
209 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
210 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
211
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
212 aix)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
213 # The C for AIX Compiler uses -M and outputs the dependencies
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
214 # in a .u file. In older versions, this file always lives in the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
215 # current directory. Also, the AIX compiler puts `$object:' at the
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
216 # start of each line; $object doesn't have directory information.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
217 # Version 6 uses the directory in both cases.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
218 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
219 test "x$dir" = "x$object" && dir=
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
220 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
221 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
222 tmpdepfile1=$dir$base.u
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
223 tmpdepfile2=$base.u
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
224 tmpdepfile3=$dir.libs/$base.u
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
225 "$@" -Wc,-M
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
226 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
227 tmpdepfile1=$dir$base.u
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
228 tmpdepfile2=$dir$base.u
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
229 tmpdepfile3=$dir$base.u
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
230 "$@" -M
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
231 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
232 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
233
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
234 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
235 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
236 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
237 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
238 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
239
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
240 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
241 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
242 test -f "$tmpdepfile" && break
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
243 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
244 if test -f "$tmpdepfile"; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
245 # Each line is of the form `foo.o: dependent.h'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
246 # Do two passes, one to just change these to
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
247 # `$object: dependent.h' and one to simply `dependent.h:'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
248 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
249 # That's a tab and a space in the [].
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
250 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
251 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
252 # The sourcefile does not contain any dependencies, so just
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
253 # store a dummy comment line, to avoid errors with the Makefile
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
254 # "include basename.Plo" scheme.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
255 echo "#dummy" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
256 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
257 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
258 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
259
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
260 icc)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
261 # Intel's C compiler understands `-MD -MF file'. However on
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
262 # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
263 # ICC 7.0 will fill foo.d with something like
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
264 # foo.o: sub/foo.c
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
265 # foo.o: sub/foo.h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
266 # which is wrong. We want:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
267 # sub/foo.o: sub/foo.c
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
268 # sub/foo.o: sub/foo.h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
269 # sub/foo.c:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
270 # sub/foo.h:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
271 # ICC 7.1 will output
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
272 # foo.o: sub/foo.c sub/foo.h
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
273 # and will wrap long lines using \ :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
274 # foo.o: sub/foo.c ... \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
275 # sub/foo.h ... \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
276 # ...
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
277
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
278 "$@" -MD -MF "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
279 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
280 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
281 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
282 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
283 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
284 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
285 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
286 # Each line is of the form `foo.o: dependent.h',
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
287 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
288 # Do two passes, one to just change these to
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
289 # `$object: dependent.h' and one to simply `dependent.h:'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
290 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
291 # Some versions of the HPUX 10.20 sed can't process this invocation
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
292 # correctly. Breaking it into two sed invocations is a workaround.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
293 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
294 sed -e 's/$/ :/' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
295 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
296 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
297
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
298 hp2)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
299 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
300 # compilers, which have integrated preprocessors. The correct option
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
301 # to use with these is +Maked; it writes dependencies to a file named
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
302 # 'foo.d', which lands next to the object file, wherever that
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
303 # happens to be.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
304 # Much of this is similar to the tru64 case; see comments there.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
305 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
306 test "x$dir" = "x$object" && dir=
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
307 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
308 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
309 tmpdepfile1=$dir$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
310 tmpdepfile2=$dir.libs/$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
311 "$@" -Wc,+Maked
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
312 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
313 tmpdepfile1=$dir$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
314 tmpdepfile2=$dir$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
315 "$@" +Maked
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
316 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
317 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
318 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
319 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
320 rm -f "$tmpdepfile1" "$tmpdepfile2"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
321 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
322 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
323
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
324 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
325 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
326 test -f "$tmpdepfile" && break
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
327 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
328 if test -f "$tmpdepfile"; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
329 sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
330 # Add `dependent.h:' lines.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
331 sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
332 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
333 echo "#dummy" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
334 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
335 rm -f "$tmpdepfile" "$tmpdepfile2"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
336 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
337
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
338 tru64)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
339 # The Tru64 compiler uses -MD to generate dependencies as a side
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
340 # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
341 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
342 # dependencies in `foo.d' instead, so we check for that too.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
343 # Subdirectories are respected.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
344 dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
345 test "x$dir" = "x$object" && dir=
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
346 base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
347
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
348 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
349 # With Tru64 cc, shared objects can also be used to make a
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
350 # static library. This mechanism is used in libtool 1.4 series to
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
351 # handle both shared and static libraries in a single compilation.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
352 # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
353 #
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
354 # With libtool 1.5 this exception was removed, and libtool now
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
355 # generates 2 separate objects for the 2 libraries. These two
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
356 # compilations output dependencies in $dir.libs/$base.o.d and
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
357 # in $dir$base.o.d. We have to check for both files, because
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
358 # one of the two compilations can be disabled. We should prefer
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
359 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
360 # automatically cleaned when .libs/ is deleted, while ignoring
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
361 # the former would cause a distcleancheck panic.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
362 tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
363 tmpdepfile2=$dir$base.o.d # libtool 1.5
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
364 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
365 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
366 "$@" -Wc,-MD
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
367 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
368 tmpdepfile1=$dir$base.o.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
369 tmpdepfile2=$dir$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
370 tmpdepfile3=$dir$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
371 tmpdepfile4=$dir$base.d
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
372 "$@" -MD
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
373 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
374
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
375 stat=$?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
376 if test $stat -eq 0; then :
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
377 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
378 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
379 exit $stat
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
380 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
381
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
382 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
383 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
384 test -f "$tmpdepfile" && break
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
385 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
386 if test -f "$tmpdepfile"; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
387 sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
388 # That's a tab and a space in the [].
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
389 sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
390 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
391 echo "#dummy" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
392 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
393 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
394 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
395
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
396 #nosideeffect)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
397 # This comment above is used by automake to tell side-effect
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
398 # dependency tracking mechanisms from slower ones.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
399
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
400 dashmstdout)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
401 # Important note: in order to support this mode, a compiler *must*
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
402 # always write the preprocessed file to stdout, regardless of -o.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
403 "$@" || exit $?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
404
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
405 # Remove the call to Libtool.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
406 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
407 while test $1 != '--mode=compile'; do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
408 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
409 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
410 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
411 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
412
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
413 # Remove `-o $object'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
414 IFS=" "
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
415 for arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
416 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
417 case $arg in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
418 -o)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
419 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
420 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
421 $object)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
422 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
423 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
424 *)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
425 set fnord "$@" "$arg"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
426 shift # fnord
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
427 shift # $arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
428 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
429 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
430 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
431
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
432 test -z "$dashmflag" && dashmflag=-M
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
433 # Require at least two characters before searching for `:'
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
434 # in the target name. This is to cope with DOS-style filenames:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
435 # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
436 "$@" $dashmflag |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
437 sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
438 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
439 cat < "$tmpdepfile" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
440 tr ' ' '
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
441 ' < "$tmpdepfile" | \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
442 ## Some versions of the HPUX 10.20 sed can't process this invocation
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
443 ## correctly. Breaking it into two sed invocations is a workaround.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
444 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
445 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
446 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
447
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
448 dashXmstdout)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
449 # This case only exists to satisfy depend.m4. It is never actually
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
450 # run, as this mode is specially recognized in the preamble.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
451 exit 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
452 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
453
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
454 makedepend)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
455 "$@" || exit $?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
456 # Remove any Libtool call
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
457 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
458 while test $1 != '--mode=compile'; do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
459 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
460 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
461 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
462 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
463 # X makedepend
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
464 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
465 cleared=no
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
466 for arg in "$@"; do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
467 case $cleared in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
468 no)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
469 set ""; shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
470 cleared=yes ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
471 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
472 case "$arg" in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
473 -D*|-I*)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
474 set fnord "$@" "$arg"; shift ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
475 # Strip any option that makedepend may not understand. Remove
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
476 # the object too, otherwise makedepend will parse it as a source file.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
477 -*|$object)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
478 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
479 *)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
480 set fnord "$@" "$arg"; shift ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
481 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
482 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
483 obj_suffix="`echo $object | sed 's/^.*\././'`"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
484 touch "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
485 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
486 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
487 cat < "$tmpdepfile" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
488 sed '1,2d' "$tmpdepfile" | tr ' ' '
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
489 ' | \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
490 ## Some versions of the HPUX 10.20 sed can't process this invocation
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
491 ## correctly. Breaking it into two sed invocations is a workaround.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
492 sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
493 rm -f "$tmpdepfile" "$tmpdepfile".bak
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
494 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
495
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
496 cpp)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
497 # Important note: in order to support this mode, a compiler *must*
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
498 # always write the preprocessed file to stdout.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
499 "$@" || exit $?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
500
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
501 # Remove the call to Libtool.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
502 if test "$libtool" = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
503 while test $1 != '--mode=compile'; do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
504 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
505 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
506 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
507 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
508
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
509 # Remove `-o $object'.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
510 IFS=" "
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
511 for arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
512 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
513 case $arg in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
514 -o)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
515 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
516 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
517 $object)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
518 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
519 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
520 *)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
521 set fnord "$@" "$arg"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
522 shift # fnord
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
523 shift # $arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
524 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
525 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
526 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
527
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
528 "$@" -E |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
529 sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
530 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
531 sed '$ s: \\$::' > "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
532 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
533 echo "$object : \\" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
534 cat < "$tmpdepfile" >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
535 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
536 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
537 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
538
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
539 msvisualcpp)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
540 # Important note: in order to support this mode, a compiler *must*
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
541 # always write the preprocessed file to stdout, regardless of -o,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
542 # because we must use -o when running libtool.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
543 "$@" || exit $?
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
544 IFS=" "
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
545 for arg
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
546 do
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
547 case "$arg" in
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
548 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
549 set fnord "$@"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
550 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
551 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
552 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
553 *)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
554 set fnord "$@" "$arg"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
555 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
556 shift
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
557 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
558 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
559 done
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
560 "$@" -E |
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
561 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
562 rm -f "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
563 echo "$object : \\" > "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
564 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
565 echo " " >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
566 . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
567 rm -f "$tmpdepfile"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
568 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
569
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
570 none)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
571 exec "$@"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
572 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
573
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
574 *)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
575 echo "Unknown depmode $depmode" 1>&2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
576 exit 1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
577 ;;
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
578 esac
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
579
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
580 exit 0
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
581
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
582 # Local Variables:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
583 # mode: shell-script
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
584 # sh-indentation: 2
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
585 # eval: (add-hook 'write-file-hooks 'time-stamp)
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
586 # time-stamp-start: "scriptversion="
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
587 # time-stamp-format: "%:y-%02m-%02d.%02H"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
588 # time-stamp-end: "$"
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
589 # End: