Lines Matching +full:sub +full:- +full:spaces
2 # depcomp - compile a program generating dependencies as side-effects
4 scriptversion=2013-05-30.07; # UTC
6 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
30 echo "$0: No command. Try '$0 --help' for more information." 1>&2
33 -h | --h*)
35 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
38 as side-effects.
49 Report bugs to <bug-automake@gnu.org>.
53 -v | --v*)
65 */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
70 # Get the suffix-stripped basename of the given path, and save it the
74 base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
85 # Factor out some common post-processing of the generated depfile.
90 # post-process it.
91 if test -f "$tmpdepfile"; then
97 # which is needed to avoid the deleted-header problem.
98 { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
99 sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
101 rm -f "$tmpdepfile"
119 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
124 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
125 depfile=${depfile-`echo "$object" |
126 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
127 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
129 rm -f "$tmpdepfile"
139 # HP compiler uses -M and no extra arg.
140 gccflag=-M
146 dashmflag=-xM
150 cygpath_u="cygpath -u -f -"
153 # Just convert the backslash-escaped backslashes to single forward
161 # Just convert the backslash-escaped backslashes to single forward
168 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
169 gccflag=-qmakedep=gcc,-MF
177 ## it if -MD -MP comes after the -MF stuff. Hmm.
185 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
193 if test $stat -ne 0; then
194 rm -f "$tmpdepfile"
201 ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
202 ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
206 ## - Don't want to use -MD because we'd like the dependencies to end
209 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
210 ## -MM, not -M (despite what the docs say). Also, it might not be
212 ## - Using -M directly means running the compiler twice (even worse
214 if test -z "$gccflag"; then
215 gccflag=-MD,
217 "$@" -Wp,"$gccflag$tmpdepfile"
219 if test $stat -ne 0; then
220 rm -f "$tmpdepfile"
223 rm -f "$depfile"
225 # The second -e expression handles DOS-style file names with drive
227 sed -e 's/^[^:]*: / /' \
228 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
242 | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
243 | sed -e 's/$/ :/' >> "$depfile"
244 rm -f "$tmpdepfile"
256 "$@" "-Wp,-MDupdate,$tmpdepfile"
258 "$@" -MDupdate "$tmpdepfile"
261 if test $stat -ne 0; then
262 rm -f "$tmpdepfile"
265 rm -f "$depfile"
267 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
276 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
281 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
286 rm -f "$tmpdepfile"
297 # The C for AIX Compiler uses -M and outputs the dependencies
308 "$@" -Wc,-M
313 "$@" -M
316 if test $stat -ne 0; then
317 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
323 test -f "$tmpdepfile" && break
329 # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
341 # spaces rather than leading tabs (at least since its commit 0394caf7
342 # "Emit spaces for -MD").
343 "$@" -MD -MF "$tmpdepfile"
345 if test $stat -ne 0; then
346 rm -f "$tmpdepfile"
349 rm -f "$depfile"
350 # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
352 sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
354 # dummy dependency, to avoid the deleted-header problem.
355 sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
356 rm -f "$tmpdepfile"
361 ## listed in this file. A plain '-MD' option would be understood by many
364 # Portland's C compiler understands '-MD'.
369 # foo.o: sub/foo.c sub/foo.h
371 # foo.o: sub/foo.c ... \
372 # sub/foo.h ... \
384 lockdir=$base.d-lock
392 while test $i -gt 0; do
393 # mkdir is a portable test-and-set.
396 "$@" -MD
404 while test -d "$lockdir" && test $i -gt 0; do
406 i=`expr $i - 1`
409 i=`expr $i - 1`
411 trap - 1 2 13 15
412 if test $i -le 0; then
418 if test $stat -ne 0; then
419 rm -f "$tmpdepfile"
422 rm -f "$depfile"
431 | sed -e 's/$/ :/' >> "$depfile"
432 rm -f "$tmpdepfile"
447 "$@" -Wc,+Maked
454 if test $stat -ne 0; then
455 rm -f "$tmpdepfile1" "$tmpdepfile2"
461 test -f "$tmpdepfile" && break
463 if test -f "$tmpdepfile"; then
464 sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
466 sed -ne '2,${
475 rm -f "$tmpdepfile" "$tmpdepfile2"
479 # The Tru64 compiler uses -MD to generate dependencies as a side
480 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
481 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
497 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
498 "$@" -Wc,-MD
503 "$@" -MD
507 if test $stat -ne 0; then
508 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
514 test -f "$tmpdepfile" && break
516 # Same post-processing that is required for AIX mode.
522 showIncludes=-Wc,-showIncludes
524 showIncludes=-showIncludes
528 grep -v '^Note: including file: ' "$tmpdepfile"
529 if test $stat -ne 0; then
530 rm -f "$tmpdepfile"
533 rm -f "$depfile"
540 sed < "$tmpdepfile" -n '
545 }' | $cygpath_u | sort -u | sed -n '
556 rm -f "$tmpdepfile"
567 # This comment above is used by automake to tell side-effect
572 # always write the preprocessed file to stdout, regardless of -o.
577 while test "X$1" != 'X--mode=compile'; do
583 # Remove '-o $object'.
588 -o)
602 test -z "$dashmflag" && dashmflag=-M
604 # in the target name. This is to cope with DOS-style filenames:
608 rm -f "$depfile"
613 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
614 | sed -e 's/$/ :/' >> "$depfile"
615 rm -f "$tmpdepfile"
628 while test "X$1" != 'X--mode=compile'; do
648 -D*|-I*)
652 -arch)
654 -*|$object)
662 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
663 rm -f "$depfile"
665 # No need to regex-escape $object, excess matching of '.' is harmless.
671 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
672 | sed -e 's/$/ :/' >> "$depfile"
673 rm -f "$tmpdepfile" "$tmpdepfile".bak
683 while test "X$1" != 'X--mode=compile'; do
689 # Remove '-o $object'.
694 -o)
708 "$@" -E \
709 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
710 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
712 rm -f "$depfile"
716 rm -f "$tmpdepfile"
726 while test "X$1" != 'X--mode=compile'; do
736 -o)
742 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
754 "$@" -E 2>/dev/null |
755 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
756 rm -f "$depfile"
758 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
760 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
761 rm -f "$tmpdepfile"
784 # mode: shell-script
785 # sh-indentation: 2
786 # eval: (add-hook 'write-file-hooks 'time-stamp)
787 # time-stamp-start: "scriptversion="
788 # time-stamp-format: "%:y-%02m-%02d.%02H"
789 # time-stamp-time-zone: "UTC"
790 # time-stamp-end: "; # UTC"