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.
23 $(srcdir)/Dependencies: .depend
24 @if test "$(srcdir)" != "."; then \
25 echo '## This file is machine generated on GNU systems.' >$@; \
26 echo '## Only temporary changes may be made here.' >>$@; \
28 perl -p $(top_srcdir)/bin/distdep .depend >>$@; \
30 echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
35 # we had Makefile target, because we want Makefile rebuild before include .depend
36 .depend: $(LIB_DEP) $(TEST_SRC) $(BIN_DEP)
38 @for dep in X $? ; do \
39 if [ $$dep != "X" ]; then \
40 if [ $$dep != "Makefile" ]; then \
43 echo Building dependencies for $$dep; \
44 obj=`basename $$dep .c`.lo; \
45 sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
46 $(DEPCC) $(C_DEPEND_FLAG) $(CPPFLAGS) $$dep 2>/dev/null | \
47 sed 's% $(srcdir)/% $$(srcdir)/%g' | \
48 sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
49 sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
50 sed 's/\.o/.lo/' >>$@; \
53 echo Building dependencies for $$dep; \
54 obj=`basename $$dep .cc`.lo; \
55 sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
56 $(DEPCXX) $(CXX_DEPEND_FLAG) $(DEPCXXFLAGS) $(CPPFLAGS) $$dep 2>/dev/null | \
57 sed 's% $(srcdir)/% $$(srcdir)/%g' | \
58 sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
59 sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
60 sed 's/\.o/.lo/' >>$@; \
63 echo Building dependencies for $$dep; \
64 obj=`basename $$dep .cxx`.lo; \
65 sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
66 $(DEPCXX) $(CXX_DEPEND_FLAG) $(DEPCXXFLAGS) $(CPPFLAGS) $$dep 2>/dev/null | \
67 sed 's% $(srcdir)/% $$(srcdir)/%g' | \
68 sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
69 sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
70 sed 's/\.o/.lo/' >>$@; \
81 -include $(top_builddir)/idl/.depidl