]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Improve the Makefiles by taking care of the case that neither Makefile.dep not the...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Feb 1999 10:22:24 +0000 (10:22 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 25 Feb 1999 10:22:24 +0000 (10:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@904 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/Makefile
deal.II/deal.II/source/Makefile
deal.II/lac/source/Makefile

index 4e342fb6645f8cfd4eda81e8f4a60ccbd2a70d43..17a5b107f397be5bdd4b5c2a37e6df6106069076 100644 (file)
@@ -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
index 834950520aff5a575bb838236e1eb8bfa9c513fc..700f14f01398c59f6b62b1b26476722d17bd4fec 100644 (file)
@@ -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
+
index 2916c551b12e94d8a872329180736adcdf5c55ec..2840b5dc0ad05c587343cadd69976c06a544e4db 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.