From 2dc6045391a026481ccc38c68dd9fbea118b610f Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 25 Feb 1999 10:22:24 +0000 Subject: [PATCH] Improve the Makefiles by taking care of the case that neither Makefile.dep not the forward declarations file exist at the time of invokation. This case only occurs after a 'make clean'. git-svn-id: https://svn.dealii.org/trunk@904 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/source/Makefile | 13 ++++++++----- deal.II/deal.II/source/Makefile | 23 ++++++++++++++++++++++- deal.II/lac/source/Makefile | 11 +++++++---- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/deal.II/base/source/Makefile b/deal.II/base/source/Makefile index 4e342fb664..17a5b107f3 100644 --- a/deal.II/base/source/Makefile +++ b/deal.II/base/source/Makefile @@ -42,13 +42,16 @@ clean: #to remake this file upon inclusion at the bottom #of this file. # -#use perl to generate rules for the .go files as well -#as to make rules not for tria.o and the like, but -#rather for libbasic.a(tria.o) -../lib/Makefile.dep: $(cc-files) $(filter-out $(forward-declarations),$(h-files)) Makefile +#see the Makefile of the deal.II directory for a thorough +#description of what happens here +../lib/Makefile.dep: $(cc-files) $(forward-declarations) $(h-files) Makefile +ifeq (0,${MAKELEVEL}) @echo ============================ Remaking Makefile - @perl ../Make_dep.pl ../lib/libbase $(INCLUDE) $(cc-files) \ + @perl ../Make_dep.pl ../lib/liblac $(INCLUDE) $(cc-files) \ > ../lib/Makefile.dep +else + @echo ============================ Not remaking Makefile since in nested mode +endif include ../lib/Makefile.dep diff --git a/deal.II/deal.II/source/Makefile b/deal.II/deal.II/source/Makefile index 834950520a..700f14f013 100644 --- a/deal.II/deal.II/source/Makefile +++ b/deal.II/deal.II/source/Makefile @@ -142,7 +142,24 @@ clean: #programs which use the 2d *and* the 3d library; #if the files within these libraries had the same names, #we may get into trouble. -../lib/Makefile.dep: $(cc-files) $(filter-out $(forward-declarations),$(h-files)) Makefile ../Make.global_options +# +# +#additional clue: if the forward declarations file does +#not exist, then the script generating the dependencies +#will not find it and will not print it into the dependencies. +#but then also 'make' will not know that it needs to be +#generated before compilation of files start, which leads +#to a cpp error. we therefore have to make sure the forward +#declaration file exists before we even start to build the +#dependencies; since it will not be in the $(h-files) in the +#critical case, we need to add it by hand. next problem: +#the generation of the forward declarations requires a +#nested call to 'make', which would then rebuild the +#Makefile.dep, which this rule won't see, wo we end up +#generating it twice. therefore: do nothing if in a nested +#make +../lib/Makefile.dep: $(cc-files) $(h-files) $(forward-declarations) Makefile ../Make.global_options +ifeq (0,${MAKELEVEL}) @echo ============================ Remaking Makefile @echo "# This Makefile was automatically generated by ../source/Makefile" \ > ../lib/Makefile.dep @@ -156,8 +173,12 @@ clean: | perl -pe 's!(\.\./lib/2d/[^ ]+)_DIM_PLACEHOLDER!$$1_2d!g;' \ | perl -pe 's!(\.\./lib/3d/[^ ]+)_DIM_PLACEHOLDER!$$1_3d!g;' \ >> ../lib/Makefile.dep +else + @echo ============================ Not remaking Makefile since in nested mode +endif include ../lib/Makefile.dep include $D/deal.II/Make.forward-declarations + diff --git a/deal.II/lac/source/Makefile b/deal.II/lac/source/Makefile index 2916c551b1..2840b5dc0a 100644 --- a/deal.II/lac/source/Makefile +++ b/deal.II/lac/source/Makefile @@ -50,13 +50,16 @@ clean: #to remake this file upon inclusion at the bottom #of this file. # -#use perl to generate rules for the .go files as well -#as to make rules not for tria.o and the like, but -#rather for libbasic.a(tria.o) -../lib/Makefile.dep: $(cc-files) $(filter-out $(forward-declarations),$(h-files)) Makefile +#see the Makefile of the deal.II directory for a thorough +#description of what happens here +../lib/Makefile.dep: $(cc-files) $(forward-declarations) $(h-files) Makefile +ifeq (0,${MAKELEVEL}) @echo ============================ Remaking Makefile @perl ../Make_dep.pl ../lib/liblac $(INCLUDE) $(cc-files) \ > ../lib/Makefile.dep +else + @echo ============================ Not remaking Makefile since in nested mode +endif include ../lib/Makefile.dep -- 2.39.5