#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
#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
| 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
+
#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