]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change the working of the Makefile to automatically extract the libraries to link...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Feb 1999 11:52:00 +0000 (11:52 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Feb 1999 11:52:00 +0000 (11:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@844 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/Makefile
tests/deal.II/gradients.cc
tests/deal.II/second_derivatives.cc

index 83e753f9ea6f9c5c1cf8d8a465d569de713f8011..482feabf0af678f050f77ca2700ad2e384ae70d1 100644 (file)
@@ -20,21 +20,24 @@ lib-h-files = $(wildcard ../../deal_II/include/*/*.h) \
               $(wildcard ../../lac/include/*/*.h) \
               $(wildcard ../../base/include/*/*.h)
 executables = $(cc-files:.cc=.testcase)
+output-files= $(cc-files:.cc=.output)
 
 # list of libraries needed to link with
-libs.g   = $D/deal.II/lib/libdeal_II_2d.g.a $D/lac/lib/liblac.g.a $D/base/lib/libbase.g.a
-libs     = $D/deal.II/lib/libdeal_II_2d.a   $D/lac/lib/liblac.a   $D/base/lib/libbase.a
+libs.g   = $D/lac/lib/liblac.g.a $D/base/lib/libbase.g.a
+libs     = $D/lac/lib/liblac.a   $D/base/lib/libbase.a
 
 
 # check whether we use debug mode or not
 ifeq ($(debug-mode),on)
 libraries = $(libs.g)
-flags     = $(CXXFLAGS.g)
+flags     = $(CXXFLAGS.g) -L$D/deal.II/lib
+lib-tag   = "deal_II_libraries.g="
 endif
 
 ifeq ($(debug-mode),off)
 libraries = $(libs)
-flags     = $(CXXFLAGS)
+flags     = $(CXXFLAGS) -L$D/deal.II/lib
+lib-tag   = "deal_II_libraries="
 endif
 
 
@@ -42,7 +45,7 @@ endif
 # rule to make executables
 %.testcase: %.cc $(libraries)
        @echo ============================ Compiling Testcase:   $<
-       @$(CXX) $(flags) $< -o $@ $(libraries)
+       @$(CXX) $(flags) $< -o $@ $(shell grep $(lib-tag) $< | perl -pe 's/.*=//;') $(libs)
 
 
 
@@ -56,7 +59,7 @@ targets = $(addsuffix .target, $(executables))
 # the right filename by dropping the suffix added for the make-rule
 %.target : %
        @echo ============================ Executing Testcase:   $<
-       @./$<
+       ./$< > $(subst testcase,output,$<)
 
 # this is the main target
 # make dependence so that it first wants to compile all files then
@@ -66,7 +69,7 @@ check: $(executables) $(targets)
 
 
 clean:
-       -rm -f *.o *.go *~ Makefile.dep $(executables)
+       -rm -f *.o *.go *~ Makefile.dep $(executables) $(output-files)
 
 
 
index ff0f2de02da9465e52090745805084a1a66e51d0..cf420b3a03ebe8acd6d3eca5dad546f05d73c511 100644 (file)
@@ -1,5 +1,9 @@
+//     $Id$    
 // test for correctness of gradients on a given cell
 
+// deal_II_libraries.g=-ldeal_II_2d.g
+// deal_II_libraries=-ldeal_II_2d
+
 
 #include <grid/tria.h>
 #include <grid/tria_boundary.h>
index b33d67014441f0bba747ae4d60bb5a3e8cb3fa12..cfac394bba9cc4a97b265309aa720f5507e7b16a 100644 (file)
@@ -1,5 +1,8 @@
+//     $Id$    
 // test for correctness of gradients on a given cell
 
+// deal_II_libraries.g=-ldeal_II_2d.g
+// deal_II_libraries=-ldeal_II_2d
 
 #include <grid/tria.h>
 #include <grid/tria_boundary.h>

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.