summaryrefslogtreecommitdiffstats
path: root/config/depend.in
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-08-15 16:40:24 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-08-15 16:40:24 (GMT)
commit9c6f65ec241eb2941e2af399385d7c7b62edac04 (patch)
tree86e56d87faffaeb0dc9aa4082aca148c055ccc21 /config/depend.in
parentd61f4c0ed53a60419ac6a5355a73598b1a0d98d0 (diff)
downloadhdf5-9c6f65ec241eb2941e2af399385d7c7b62edac04.zip
hdf5-9c6f65ec241eb2941e2af399385d7c7b62edac04.tar.gz
hdf5-9c6f65ec241eb2941e2af399385d7c7b62edac04.tar.bz2
[svn-r34] ./config/commence.in NEW
./config/conclude.in NEW Templates for the beginning and end of each Makefile. ./config/depend.in NEW Template for the part of the Makefile that generates source dependencies. ./config/freebsd2.2.1 NEW ./config/linux NEW Personal preference files. These are not part of a distribution but are for fine tuning configure for particular systems and are used by the HDF5 maintainers.
Diffstat (limited to 'config/depend.in')
-rw-r--r--config/depend.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/config/depend.in b/config/depend.in
new file mode 100644
index 0000000..d8cec80
--- /dev/null
+++ b/config/depend.in
@@ -0,0 +1,35 @@
+#------------------------------------------------------------- -*- makefile -*-
+# The following section of this makefile comes from the
+# `./config/targets' file which was generated with config.status
+# from `./config/targets.in'.
+#------------------------------------------------------------------------------
+
+# We keep a list of dependencies in `.depend' for each of the source
+# files on which it depends. When one of the source files is modified
+# we remove its record from .depend and regenerate its dependencies,
+# tacking them onto the end of .depend. By including the .depend file
+# into the makefile, we're telling make that the makefile depends on
+# the dependency list in the .depend file.
+#
+# This is as fast as the `.d' method described in the GNU make manual
+# for automatic dependencies, but has the added advantage that all
+# dependencies are stored in one place. The advantage over the
+# `makedepend' program is that only those files that are out of date
+# have dependency information rebuilt, and the Makefile is not
+# modified.
+#
+.PRECIOUS: .depend
+dep depend: .depend
+
+.depend: $(LIB_SRC) $(PROG_SRC)
+ @touch .depend
+ @for dep in $? dummy; do \
+ if [ $$dep != "dummy" ]; then \
+ echo Building dependencies for $$dep; \
+ obj=`echo $$dep | sed 's/\.c/.o/'`; \
+ sed "/$$obj/,/[^\\]$$/d" <$@ >$@- && mv $@- $@; \
+ $(CC) -M -MG $(CPPFLAGS) $$dep >>$@; \
+ fi; \
+ done
+
+-include .depend