3 ## We keep a list of dependencies in `.depend' for each of the source
4 ## files on which it depends. When one of the source files is modified
5 ## we remove its record from .depend and regenerate its dependencies,
6 ## tacking them onto the end of .depend. By including the .depend file
7 ## into the makefile, we're telling make that the makefile depends on
8 ## the dependency list in the .depend file.
10 ## This is as fast as the `.d' method described in the GNU make manual
11 ## for automatic dependencies, but has the added advantage that all
12 ## dependencies are stored in one place. The advantage over the
13 ## `makedepend' program is that only those files that are out of date
14 ## have dependency information rebuilt, and the Makefile is not
17 ## This is also where tracing information is updated. The $(TRACE)
18 ## program is run on each source file to make sure that the H5TRACE()
19 ## macros are up to date. If they are then the file is not modified,
20 ## otherwise the file is changed and a backup is saved by appending a
21 ## tilde to the file name.
26 DEPCXXFLAGS = @DEPCXXFLAGS@
28 $(srcdir)/Dependencies: .depend
29 @if test "$(srcdir)" != "."; then \
30 echo '## This file is machine generated on GNU systems.' >$@; \
31 echo '## Only temporary changes may be made here.' >>$@; \
33 perl -p $(top_srcdir)/bin/distdep .depend >>$@; \
35 echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
40 # we had Makefile target, because we want Makefile rebuild before include .depend
41 .depend: $(LIB_DEP) $(TEST_SRC) $(BIN_DEP)
43 @for dep in X $? ; do \
44 if [ $$dep != "X" ]; then \
45 if [ $$dep != "Makefile" ]; then \
48 echo Building dependencies for $$dep; \
49 obj=`basename $$dep .c`.lo; \
50 sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
51 $(DEPCC) $(C_DEPEND_FLAG) $(CPPFLAGS) $$dep 2>/dev/null | \
52 sed 's% $(srcdir)/% $$(srcdir)/%g' | \
53 sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
54 sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
55 sed 's/\.o/.lo/' >>$@; \
58 echo Building dependencies for $$dep; \
59 obj=`basename $$dep .cc`.lo; \
60 sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
61 $(DEPCXX) $(CXX_DEPEND_FLAG) $(DEPCXXFLAGS) $(CPPFLAGS) $$dep 2>/dev/null | \
62 sed 's% $(srcdir)/% $$(srcdir)/%g' | \
63 sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
64 sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
65 sed 's/\.o/.lo/' >>$@; \
68 echo Building dependencies for $$dep; \
69 obj=`basename $$dep .cxx`.lo; \
70 sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
71 $(DEPCXX) $(CXX_DEPEND_FLAG) $(DEPCXXFLAGS) $(CPPFLAGS) $$dep 2>/dev/null | \
72 sed 's% $(srcdir)/% $$(srcdir)/%g' | \
73 sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
74 sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
75 sed 's/\.o/.lo/' >>$@; \
86 -include $(top_builddir)/idl/.depidl