From 3ddfb2df1b98578099f3a12505a3ad9d949122db Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 8 Jul 2005 16:16:28 +0000 Subject: [PATCH] Build dependencies properly. Should also fix the build failure on the Mac. git-svn-id: https://svn.dealii.org/trunk@11120 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/doxygen/Makefile | 32 ++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/deal.II/examples/doxygen/Makefile b/deal.II/examples/doxygen/Makefile index c688cb9b29..89776fff91 100644 --- a/deal.II/examples/doxygen/Makefile +++ b/deal.II/examples/doxygen/Makefile @@ -18,7 +18,7 @@ all: product_matrix$(EXEEXT) block_matrix_array$(EXEEXT) # Compilation of source code ###################################################################### -%.$(OBJEXT) : %.cc +%.$(OBJEXT) : @echo =====debug======$(MT)== $< @$(CXX) $(CXXFLAGS.g) $(CXXFLAGS) -c $< -o $@ @@ -38,5 +38,35 @@ product_matrix$(EXEEXT): product_matrix.$(OBJEXT) $(lib-lac.g) $(lib-base.g) # Pseudo target for cleaning directory ###################################################################### + clean: -rm -f *~ *.$(OBJEXT) $(all) + + +.PHONY: all clean + +# Finally there is a rule which you normally need not care much about: +# since the executable depends on some include files from the library, +# besides the C++ application file of course, it is necessary to +# re-generate the executable when one of the files it depends on has +# changed. The following rule to created a dependency file +# `Makefile.dep', which `make' uses to determine when to regenerate +# the executable. This file is automagically remade whenever needed, +# i.e. whenever one of the cc-/h-files changed. Make detects whether +# to remake this file upon inclusion at the bottom of this file. +# +# If the file should turn out to be empty, then blow it +# away to let make issue a proper error message rather than +# some obscure follow-up problems +Makefile.dep: *.cc Makefile \ + $(shell echo $D/*/include/*/*.h) + @echo ============================ Remaking $@ + @$D/common/scripts/make_dependencies $(INCLUDE) -B. *.cc \ + > Makefile.dep + @if test -s $@ ; then : else rm $@ ; fi + + + +# To make the dependencies known to `make', we finally have to include +# them: +include Makefile.dep -- 2.39.5