summaryrefslogtreecommitdiffstats
path: root/config/depend1.in
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2001-08-01 21:00:25 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2001-08-01 21:00:25 (GMT)
commitb5d11111b020618ba8716c9b8d4216303f0b2a30 (patch)
tree7b20e78965261b8282e9629b2e3b4f783cf4e579 /config/depend1.in
parent0d6d3eafe4458b141f44a1ef119ee1fc72b01714 (diff)
downloadhdf5-b5d11111b020618ba8716c9b8d4216303f0b2a30.zip
hdf5-b5d11111b020618ba8716c9b8d4216303f0b2a30.tar.gz
hdf5-b5d11111b020618ba8716c9b8d4216303f0b2a30.tar.bz2
[svn-r4292]
Purpose: Bug Fix Description: The way we were generating Dependencies and .depend files was broken. If the $srcdir or other macros began with a ".", then it would match anything and cause problems since it would then overwrite the beginning of the header file's path. Solution: Wrote a Perl script which can handle this type of weirdness better. It's only used when the environment is a GNU one with a GCC compiler... Platforms tested: Linux
Diffstat (limited to 'config/depend1.in')
-rw-r--r--config/depend1.in47
1 files changed, 22 insertions, 25 deletions
diff --git a/config/depend1.in b/config/depend1.in
index bc9aea0..eaa7488 100644
--- a/config/depend1.in
+++ b/config/depend1.in
@@ -21,34 +21,31 @@
## tilde to the file name.
##
$(srcdir)/Dependencies: .depend
- @if test "$(srcdir)" != "."; then \
- echo '## This file is machine generated on GNU systems.' >$@; \
- echo '## Only temporary changes may be made here.' >>$@; \
- echo >>$@; \
- perl -p $(top_srcdir)/bin/distdep .depend >>$@; \
- else \
- echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
- fi
+ @if test "$(srcdir)" != "."; then \
+ echo '## This file is machine generated on GNU systems.' >$@; \
+ echo '## Only temporary changes may be made here.' >>$@; \
+ echo >>$@; \
+ $(PERL) -p $(top_srcdir)/bin/distdep .depend >>$@; \
+ else \
+ echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
+ fi
.depend: $(LIB_SRC) $(TEST_SRC) $(PROG_SRC)
@touch .depend
- @for dep in $? dummy; do \
- if [ $$dep != "dummy" ]; then \
- case "$$dep" in \
- *.c) \
- echo Building dependencies for $$dep; \
- obj=`basename $$dep .c`.lo; \
- sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
- $(TRACE) $$dep; \
- $(CC) -MM -MG $(CPPFLAGS) $$dep 2>/dev/null | \
- sed 's% $(srcdir)/% $$(srcdir)/%g' | \
- sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
- sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
- sed 's/\.o/.lo/' >>$@; \
- ;; \
- esac; \
- fi; \
- done
+ @for dep in $? dummy; do \
+ if test $$dep != "dummy" -a -n "$(PERL)"; then \
+ case "$$dep" in \
+ *.c) \
+ echo Building dependencies for $$dep; \
+ obj=`basename $$dep .c`.lo; \
+ sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
+ $(TRACE) $$dep; \
+ $(CC) -MM -MG $(CPPFLAGS) $$dep 2>/dev/null >>$@; \
+ $(PERL) -w $(top_srcdir)/bin/dependencies --srcdir=$(srcdir) --top_srcdir=$(top_srcdir) --top_builddir=$(top_builddir) $@; \
+ ;; \
+ esac; \
+ fi; \
+ done
-include .depend