From: Wolfgang Bangerth Date: Wed, 11 Apr 2001 13:25:15 +0000 (+0000) Subject: Fundamentally change the way the Makefiles work, and while being at it greatly simpli... X-Git-Tag: v8.0.0~19353 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a852978c5948827cdd5aea46f16213d88e47924f;p=dealii.git Fundamentally change the way the Makefiles work, and while being at it greatly simplify them. It is now no more necessary to copy around large parts of code when adding a new testcase, two lines suffice. git-svn-id: https://svn.dealii.org/trunk@4431 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/Makefile.rules b/tests/Makefile.rules index 91d14e1fb5..c6f3ca2980 100644 --- a/tests/Makefile.rules +++ b/tests/Makefile.rules @@ -12,14 +12,36 @@ normalize = $D/common/scripts/normalize.pl verbose = off + +############################################################ +# First how to create executables, including all necessary +# flags: ############################################################ -# First how to create output: by simply running a program. + +# If in multithread mode, add the ACE library to the libraries which +# we need to link with: +ifneq ($(with-multithreading),no) + LIBS += $(lib-ACE) +endif + +flags = $(CXXFLAGS.g) $(CXXFLAGS) -Wno-missing-noreturn + +%.go : %.cc Makefile + @echo =====debug========= $< + @$(CXX) $(flags) -c $< -o $@ +%.exe : + @echo =====linking======= $@ + @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) + + +############################################################ +# Next how to create output: by simply running a program. # Note that we normalize output to a few digits after # the decimal punct, in order to be able to check across # different platforms where we might differ in round-off etc. ############################################################ -%.output : %.testcase +%.output : %.exe @echo =====Running======= $< @./$< @perl -pi $(normalize) $@ @@ -62,6 +84,16 @@ verbose = off +############################################################ +# After all these general rules, here is the target to be +# executed by make: for each entry in the list $(tests) +# perform a check. +############################################################ +run-tests: $(tests:%=%.check) + + + + ############################################################ # Cleanup targets ############################################################ @@ -70,15 +102,16 @@ clean: rm -f Makefile.depend *.o *.go *.output veryclean: clean - rm -f *.testcase *.inp *.gpl *.eps *.gnuplot + rm -f *.exe *.testcase *.inp *.gpl *.eps *.gnuplot + + + ############################################################ # Automatic generation of dependencies ############################################################ -all-cc-files = $(shell echo *.cc) - -Makefile.depend: $(all-cc-files) +Makefile.depend: $(shell echo *.cc) @echo =====Dependencies== $@ @$(CXX) $(CXXFLAGS.g) $^ -M > $@ @perl -pi -e 's/(^[^.]+)\.o:/\1.o \1.go:/;' $@ diff --git a/tests/base/Makefile.in b/tests/base/Makefile.in index 170f83c071..0fad288d83 100644 --- a/tests/base/Makefile.in +++ b/tests/base/Makefile.in @@ -1,3 +1,4 @@ +# Generated automatically from Makefile.in by configure. ############################################################ # $Id$ # Copyright (C) 2000, 2001 by the deal.II authors @@ -8,187 +9,28 @@ ############################################################ D = @DEAL2_DIR@ - include $D/common/Make.global_options - - -############################################################ -# Set debug-mode as a default -############################################################ - debug-mode = on +libraries = $(lib-lac.g) \ + $(lib-base.g) -############################################################ -# Define library names -############################################################ - -libs.g = $(lib-lac.g) \ - $(lib-base.g) -libs = $(lib-lac.o) \ - $(lib-base.o) - - -############################################################ -# Select compiler flags according to debug-mode -############################################################ - -ifeq ($(debug-mode),on) -libraries = $(libs.g) -flags = $(CXXFLAGS.g) $(CXXFLAGS) -Wno-missing-noreturn -endif - -ifeq ($(debug-mode),off) -libraries = $(libs) -flags = $(CXXFLAGS.o) $(CXXFLAGS) -Wno-missing-noreturn -endif - - -# If in multithread mode, add the ACE library to the libraries which -# we need to link with: -ifneq ($(with-multithreading),no) - libraries += $(lib-ACE) -endif - - -%.go : %.cc Makefile - @echo =====debug========= $< - @$(CXX) $(flags) -c $< -o $@ -%.o : %.cc Makefile - @echo =====optimized===== $< - @$(CXX) $(flags) -c $< -o $@ - - -all: logtest.check reference.check tensor.check quadrature_test.check timer.check -exe: $(all:.check=.testcase) -output: $(all:.check=.output) - -abort.o : abort.cc - @$(CXX) -c $< -o $@ - -############################################################ -# Typical block for building a running program -# -# 1. provide a list of source files in ...-cc-files -# -# 2. generate the list of object files according to debug-mode -# -# 3. make executable -# -# 4. Explicit dependencies of object files (will be automatic soon) -# -############################################################ - -logtest-cc-files = logtest.cc - -ifeq ($(debug-mode),on) -logtest-o-files = $(logtest-cc-files:.cc=.go) -else -logtest-o-files = $(logtest-cc-files:.cc=.o) -endif - -logtest.testcase: $(logtest-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) - - -############################################################ - - -tensor-cc-files = tensor.cc - -ifeq ($(debug-mode),on) -tensor-o-files = $(tensor-cc-files:.cc=.go) -else -tensor-o-files = $(tensor-cc-files:.cc=.o) -endif - -tensor.testcase: $(tensor-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) - - - -############################################################ - - -reference-cc-files = reference.cc - -ifeq ($(debug-mode),on) -reference-o-files = $(reference-cc-files:.cc=.go) abort.o -else -reference-o-files = $(reference-cc-files:.cc=.o) abort.o -endif - -reference.testcase: $(reference-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) - - -############################################################ - - -quadrature_test-cc-files = quadrature_test.cc - -ifeq ($(debug-mode),on) -quadrature_test-o-files = $(quadrature_test-cc-files:.cc=.go) -else -quadrature_test-o-files = $(quadrature_test-cc-files:.cc=.o) -endif - -quadrature_test.testcase: $(quadrature_test-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) - - -############################################################ - - -timer-cc-files = timer.cc - -ifeq ($(debug-mode),on) -timer-o-files = $(timer-cc-files:.cc=.go) -else -timer-o-files = $(timer-cc-files:.cc=.o) -endif - -timer.testcase: $(timer-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) - +default: run-tests ############################################################ +logtest.exe : $(libraries) logtest.go +polynomial_test.exe: $(libraries) polynomial_test.go +quadrature_test.exe: $(libraries) quadrature_test.go +reference.exe : $(libraries) reference.go abort.go +tensor.exe : $(libraries) tensor.go +timer.exe : $(libraries) timer.go -polynomial_test-cc-files = polynomial_test.cc - -ifeq ($(debug-mode),on) -polynomial_test-o-files = $(polynomial_test-cc-files:.cc=.go) -else -polynomial_test-o-files = $(polynomial_test-cc-files:.cc=.o) -endif - -polynomial_test.testcase: $(polynomial_test-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) +tests = logtest quadrature_test reference tensor timer ############################################################ -# Continue with other targets if needed -############################################################ - - -target1-cc-files = t1.cc t2.cc t3.cc - -ifeq ($(debug-mode),on) -target1-o-files = $(target1-cc-files:.cc=.go) -else -target1-o-files = $(target1-cc-files:.cc=.o) -endif -target1: $(target1-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) $(flags) -o $@ $^ $(LIBS) include ../Makefile.rules include Makefile.depend diff --git a/tests/deal.II/Makefile.in b/tests/deal.II/Makefile.in index aaf7d4f84d..70d536975e 100644 --- a/tests/deal.II/Makefile.in +++ b/tests/deal.II/Makefile.in @@ -1,3 +1,4 @@ +# Generated automatically from Makefile.in by configure. ############################################################ # $Id$ # Copyright (C) 2000, 2001 by the deal.II authors @@ -8,392 +9,45 @@ ############################################################ D = @DEAL2_DIR@ - include $D/common/Make.global_options - -############################################################ -# Set debug-mode as a default -############################################################ - debug-mode = on +libraries = $(lib-lac.g) \ + $(lib-base.g) +lib-1d = $(lib-deal2-1d.g) +lib-2d = $(lib-deal2-2d.g) +lib-3d = $(lib-deal2-3d.g) -############################################################ -# Define library names -############################################################ - -libs.g = $(lib-deal2-2d.g) \ - $(lib-lac.g) \ - $(lib-base.g) -libs = $(lib-deal2-2d.o) \ - $(lib-lac.o) \ - $(lib-base.o) - - -############################################################ -# Select compiler flags according to debug-mode -############################################################ - -ifeq ($(debug-mode),on) -libraries = $(libs.g) -libdeal3d = $(lib-deal2-3d.g) -libdeal1d = $(lib-deal2-1d.g) -flags = $(CXXFLAGS.g) $(CXXFLAGS) -endif - -ifeq ($(debug-mode),off) -libraries = $(libs) -libdeal3d = $(lib-deal2-3d.o) -libdeal1d = $(lib-deal2-1d.o) -flags = $(CXXFLAGS.o) $(CXXFLAGS) -endif - - -# If in multithread mode, add the ACE library to the libraries which -# we need to link with: -ifneq ($(with-multithreading),no) - libraries += $(lib-ACE) -endif - - -%.go : %.cc Makefile - @echo =====debug========= $< - @$(CXX) $(flags) -c $< -o $@ -%.o : %.cc Makefile - @echo =====optimized===== $< - @$(CXX) $(flags) -c $< -o $@ - - -all: grid_test.check dof_test.check data_out.check \ - derivatives.check gradients.check \ - constraints.check mg.check mglocal.check \ - block_matrices.check second_derivatives.check \ - derivative_approximation.check matrices.check \ - error_estimator.check \ - intergrid_constraints.check intergrid_map.check wave-test-3.check - -exe: $(all:.check=.testcase) benchmark -run: $(all:.check=.output) -############################################################ -# Typical block for building a running program -# -# 1. provide a list of source files in ...-cc-files -# -# 2. generate the list of object files according to debug-mode -# -# 3. make executable -# -# 4. Explicit dependencies of object files (will be automatic soon) -# -############################################################ - -template-cc-files = template.cc - -ifeq ($(debug-mode),on) -template-o-files = $(template-cc-files:.cc=.go) -else -template-o-files = $(template-cc-files:.cc=.o) -endif - -template.testcase: $(template-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -constraints-cc-files = constraints.cc - -ifeq ($(debug-mode),on) -constraints-o-files = $(constraints-cc-files:.cc=.go) -else -constraints-o-files = $(constraints-cc-files:.cc=.o) -endif - -constraints.testcase: $(constraints-o-files) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -dof_test-cc-files = dof_test.cc - -ifeq ($(debug-mode),on) -dof_test-o-files = $(dof_test-cc-files:.cc=.go) -else -dof_test-o-files = $(dof_test-cc-files:.cc=.o) -endif - -dof_test.testcase: $(dof_test-o-files) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - - -data_out-cc-files = data_out.cc - -ifeq ($(debug-mode),on) -data_out-o-files = $(data_out-cc-files:.cc=.go) -else -data_out-o-files = $(data_out-cc-files:.cc=.o) -endif - -data_out.testcase: $(data_out-o-files) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -derivatives-cc-files = derivatives.cc - -ifeq ($(debug-mode),on) -derivatives-o-files = $(derivatives-cc-files:.cc=.go) -else -derivatives-o-files = $(derivatives-cc-files:.cc=.o) -endif - -derivatives.testcase: $(derivatives-o-files) $(libdeal1d) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -derivative_approximation-cc-files = derivative_approximation.cc - -ifeq ($(debug-mode),on) -derivative_approximation-o-files = $(derivative_approximation-cc-files:.cc=.go) -else -derivative_approximation-o-files = $(derivative_approximation-cc-files:.cc=.o) -endif - -derivative_approximation.testcase: $(derivative_approximation-o-files) $(libdeal1d) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -error_estimator-cc-files = error_estimator.cc - -ifeq ($(debug-mode),on) -error_estimator-o-files = $(error_estimator-cc-files:.cc=.go) -else -error_estimator-o-files = $(error_estimator-cc-files:.cc=.o) -endif - -error_estimator.testcase: $(error_estimator-o-files) $(libdeal1d) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -matrices-cc-files = matrices.cc - -ifeq ($(debug-mode),on) -matrices-o-files = $(matrices-cc-files:.cc=.go) -else -matrices-o-files = $(matrices-cc-files:.cc=.o) -endif - -matrices.testcase: $(matrices-o-files) $(libdeal1d) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -gradients-cc-files = gradients.cc - -ifeq ($(debug-mode),on) -gradients-o-files = $(gradients-cc-files:.cc=.go) -else -gradients-o-files = $(gradients-cc-files:.cc=.o) -endif - -gradients.testcase: $(gradients-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -grid_test-cc-files = grid_test.cc - -ifeq ($(debug-mode),on) -grid_test-o-files = $(grid_test-cc-files:.cc=.go) -else -grid_test-o-files = $(grid_test-cc-files:.cc=.o) -endif - -grid_test.testcase: $(grid_test-o-files) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -grid_generator-cc-files = grid_generator.cc - -ifeq ($(debug-mode),on) -grid_generator-o-files = $(grid_generator-cc-files:.cc=.go) -else -grid_generator-o-files = $(grid_generator-cc-files:.cc=.o) -endif - -grid_generator.testcase: $(grid_generator-o-files) $(libdeal3d) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -second_derivatives-cc-files = second_derivatives.cc - -ifeq ($(debug-mode),on) -second_derivatives-o-files = $(second_derivatives-cc-files:.cc=.go) -else -second_derivatives-o-files = $(second_derivatives-cc-files:.cc=.o) -endif - -second_derivatives.testcase: $(second_derivatives-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -wave-test-3-cc-files = wave-test-3.cc - -ifeq ($(debug-mode),on) -wave-test-3-o-files = $(wave-test-3-cc-files:.cc=.go) -else -wave-test-3-o-files = $(wave-test-3-cc-files:.cc=.o) -endif - -wave-test-3.testcase: $(wave-test-3-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - - -mglocal-cc-files = mglocal.cc - -ifeq ($(debug-mode),on) -mglocal-o-files = $(mglocal-cc-files:.cc=.go) -else -mglocal-o-files = $(mglocal-cc-files:.cc=.o) -endif - -mglocal.testcase: $(mglocal-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - +default: run-tests ############################################################ +block_matrices.exe : $(libraries) $(lib-2d) block_matrices.go +constraints.exe : $(libraries) $(lib-2d) $(lib-3d) constraints.go +data_out.exe : $(libraries) $(lib-2d) $(lib-3d) data_out.go +derivative_approximation.exe : $(libraries) $(lib-1d) $(lib-2d) $(lib-3d) derivative_approximation.go +derivatives.exe : $(libraries) $(lib-1d) $(lib-2d) $(lib-3d) derivatives.go +dof_test.exe : $(libraries) $(lib-2d) $(lib-3d) dof_test.go +error_estimator.exe : $(libraries) $(lib-1d) $(lib-2d) $(lib-3d) error_estimator.go +gradients.exe : $(libraries) $(lib-2d) gradients.go +grid_test.exe : $(libraries) $(lib-2d) $(lib-3d) grid_test.go +intergrid_constraints.exe : $(libraries) $(lib-1d) $(lib-2d) $(lib-3d) intergrid_constraints.go +intergrid_map.exe : $(libraries) $(lib-1d) $(lib-2d) $(lib-3d) intergrid_map.go +matrices.exe : $(libraries) $(lib-1d) $(lib-2d) $(lib-3d) matrices.go +mg.exe : $(libraries) $(lib-2d) mg.go +mglocal.exe : $(libraries) $(lib-2d) mglocal.go +second_derivatives.exe : $(libraries) $(lib-2d) second_derivatives.go +wave-test-3.exe : $(libraries) $(lib-2d) wave-test-3.go -mg-cc-files = mg.cc - -ifeq ($(debug-mode),on) -mg-o-files = $(mg-cc-files:.cc=.go) -else -mg-o-files = $(mg-cc-files:.cc=.o) -endif - -mg.testcase: $(mg-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) +tests = grid_test dof_test data_out derivatives gradients constraints mg \ + mglocal block_matrices second_derivatives derivative_approximation \ + matrices error_estimator intergrid_constraints intergrid_map \ + wave-test-3 ############################################################ -block_matrices-cc-files = block_matrices.cc - -ifeq ($(debug-mode),on) -block_matrices-o-files = $(block_matrices-cc-files:.cc=.go) -else -block_matrices-o-files = $(block_matrices-cc-files:.cc=.o) -endif - -block_matrices.testcase: $(block_matrices-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - - -intergrid_map-cc-files = intergrid_map.cc - -ifeq ($(debug-mode),on) -intergrid_map-o-files = $(intergrid_map-cc-files:.cc=.go) -else -intergrid_map-o-files = $(intergrid_map-cc-files:.cc=.o) -endif - -intergrid_map.testcase: $(intergrid_map-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(lib-deal2-1d.g) $(lib-deal2-3d.g) $(LIBS) - - -############################################################ - - -intergrid_constraints-cc-files = intergrid_constraints.cc - -ifeq ($(debug-mode),on) -intergrid_constraints-o-files = $(intergrid_constraints-cc-files:.cc=.go) -else -intergrid_constraints-o-files = $(intergrid_constraints-cc-files:.cc=.o) -endif - -intergrid_constraints.testcase: $(intergrid_constraints-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(lib-deal2-1d.g) $(lib-deal2-3d.g) $(LIBS) - - -############################################################ -# Continue with other targets if needed -############################################################ - - -benchmark-cc-files = benchmark.cc - -ifeq ($(debug-mode),on) -benchmark-o-files = $(benchmark-cc-files:.cc=.go) -else -benchmark-o-files = $(benchmark-cc-files:.cc=.o) -endif - -benchmark.testcase: $(benchmark-o-files) $(libraries) - $(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ -# Continue with other targets if needed -############################################################ - - -target1-cc-files = t1.cc t2.cc t3.cc - -ifeq ($(debug-mode),on) -target1-o-files = $(target1-cc-files:.cc=.go) -else -target1-o-files = $(target1-cc-files:.cc=.o) -endif - -target1: $(target1-o-files) $(libraries) - $(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ -############################################################ include ../Makefile.rules include Makefile.depend diff --git a/tests/fe/Makefile.in b/tests/fe/Makefile.in index 491e652f5d..8ab03c2857 100644 --- a/tests/fe/Makefile.in +++ b/tests/fe/Makefile.in @@ -1,3 +1,4 @@ +# Generated automatically from Makefile.in by configure. ############################################################ # $Id$ # Copyright (C) 2000, 2001 by the deal.II authors @@ -8,216 +9,36 @@ ############################################################ D = @DEAL2_DIR@ - include $D/common/Make.global_options - -normalize = $D/common/scripts/normalize.pl - -############################################################ -# Set debug-mode as a default -############################################################ - debug-mode = on +libraries = $(lib-deal2-1d.g) \ + $(lib-deal2-2d.g) \ + $(lib-deal2-3d.g) \ + $(lib-lac.g) \ + $(lib-base.g) -############################################################ -# Define library names -############################################################ +default: run-tests dat-checks -libs.g = $(lib-deal2-1d.g) \ - $(lib-deal2-2d.g) \ - $(lib-deal2-3d.g) \ - $(lib-lac.g) \ - $(lib-base.g) -libs = $(lib-deal2-1d.o) \ - $(lib-deal2-2d.o) \ - $(lib-deal2-3d.o) \ - $(lib-lac.o) \ - $(lib-base.o) +# additional in this directory: some tests write more than one output +# file. check these as well after all tests have been run. actually, +# check each output file; files that are checked twice don't matter +dat-checks: run-tests + @$(MAKE) `echo *.output | perl -pi -e 's/output/check/g;'` -############################################################ -# Select compiler flags according to debug-mode ############################################################ -ifeq ($(debug-mode),on) -libraries = $(libs.g) -flags = $(CXXFLAGS.g) $(CXXFLAGS) -endif +derivatives.exe : $(libraries) derivatives.go +fe_data_test.exe : $(libraries) fe_data_test.go +mapping.exe : $(libraries) mapping.go +mapping_c1.exe : $(libraries) mapping_c1.go +shapes.exe : $(libraries) shapes.go -ifeq ($(debug-mode),off) -libraries = $(libs) -flags = $(CXXFLAGS.o) $(CXXFLAGS) -endif - -# If in multithread mode, add the ACE library to the libraries which -# we need to link with: -ifneq ($(with-multithreading),no) - libraries += $(lib-ACE) -endif - - - -%.go : %.cc Makefile - @echo =====debug========= $< - @$(CXX) $(flags) -g -c $< -o $@ -%.o : %.cc Makefile - @echo =====optimized===== $< - @$(CXX) $(flags) -g -c $< -o $@ - - -all: check +tests = derivatives fe_data_test mapping mapping_c1 shapes ############################################################ -# Typical block for building a running program -# -# 1. provide a list of source files in ...-cc-files -# -# 2. generate the list of object files according to debug-mode -# -# 3. make executable -# -# 4. Explicit dependencies of object files (will be automatic soon) -# -############################################################ - -fe_data_test-cc-files = fe_data_test.cc - -ifeq ($(debug-mode),on) -fe_data_test-o-files = $(fe_data_test-cc-files:.cc=.go) -else -fe_data_test-o-files = $(fe_data_test-cc-files:.cc=.o) -endif - -fe_data_test.testcase: $(fe_data_test-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -shapes-cc-files = shapes.cc - -ifeq ($(debug-mode),on) -shapes-o-files = $(shapes-cc-files:.cc=.go) -else -shapes-o-files = $(shapes-cc-files:.cc=.o) -endif - -shapes.testcase: $(shapes-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -derivatives-cc-files = derivatives.cc - -ifeq ($(debug-mode),on) -derivatives-o-files = $(derivatives-cc-files:.cc=.go) -else -derivatives-o-files = $(derivatives-cc-files:.cc=.o) -endif - -derivatives.testcase: $(derivatives-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -embedding-cc-files = embedding.cc - -ifeq ($(debug-mode),on) -embedding-o-files = $(embedding-cc-files:.cc=.go) -else -embedding-o-files = $(embedding-cc-files:.cc=.o) -endif -embedding: $(embedding-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ - -############################################################ - -interpolation-cc-files = interpolation.cc - -ifeq ($(debug-mode),on) -interpolation-o-files = $(interpolation-cc-files:.cc=.go) -else -interpolation-o-files = $(interpolation-cc-files:.cc=.o) -endif - -interpolation: $(interpolation-o-files) $(libraries) - @$(CXX) $(LDFLAGS) -g -o $@ $^ - -############################################################ - -mapping-cc-files = mapping.cc - -ifeq ($(debug-mode),on) -mapping-o-files = $(mapping-cc-files:.cc=.go) -else -mapping-o-files = $(mapping-cc-files:.cc=.o) -endif - -mapping.testcase: $(mapping-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -mapping_c1-cc-files = mapping_c1.cc - -ifeq ($(debug-mode),on) -mapping_c1-o-files = $(mapping_c1-cc-files:.cc=.go) -else -mapping_c1-o-files = $(mapping_c1-cc-files:.cc=.o) -endif - -mapping_c1.testcase: $(mapping_c1-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -internals-cc-files = internals.cc - -ifeq ($(debug-mode),on) -internals-o-files = $(internals-cc-files:.cc=.go) -else -internals-o-files = $(internals-cc-files:.cc=.o) -endif - -internals: $(internals-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ - -performance-cc-files = performance.cc - -ifeq ($(debug-mode),on) -performance-o-files = $(performance-cc-files:.cc=.go) -else -performance-o-files = $(performance-cc-files:.cc=.o) -endif - -performance: $(performance-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ -# Continue with other targets if needed -############################################################ - -check: fe_data_test.check mapping.check mapping_c1.check derivatives.check shapes.check - @echo Checking results - $(MAKE) dodiff - -dat = $(wildcard *.output) -check = $(dat:.output=.check) - -dodiff: $(check) include ../Makefile.rules include Makefile.depend - -.PHONY: clean veryclean check diff --git a/tests/lac/Makefile.in b/tests/lac/Makefile.in index 4ba91637d5..8b660c9167 100644 --- a/tests/lac/Makefile.in +++ b/tests/lac/Makefile.in @@ -1,3 +1,4 @@ +# Generated automatically from Makefile.in by configure. ############################################################ # $Id$ # Copyright (C) 2000, 2001 by the deal.II authors @@ -8,235 +9,30 @@ ############################################################ D = @DEAL2_DIR@ - include $D/common/Make.global_options - - -############################################################ -# Set debug-mode as a default -############################################################ - debug-mode = on +libraries = $(lib-lac.g) \ + $(lib-base.g) -############################################################ -# Define library names -############################################################ - -libs.g = $(lib-lac.g) \ - $(lib-base.g) -libs = $(lib-lac.o) \ - $(lib-base.o) - - -############################################################ -# Select compiler flags according to debug-mode -############################################################ - -ifeq ($(debug-mode),on) -libraries = $(libs.g) -flags = $(CXXFLAGS.g) $(CXXFLAGS) -Wno-missing-noreturn -endif - -ifeq ($(debug-mode),off) -libraries = $(libs) -flags = $(CXXFLAGS.o) $(CXXFLAGS) -Wno-missing-noreturn -endif - -# If in multithread mode, add the ACE library to the libraries which -# we need to link with: -ifneq ($(with-multithreading),no) - libraries += $(lib-ACE) -endif - - - -%.go : %.cc Makefile - @echo =====debug========= $< - @$(CXX) $(flags) -c $< -o $@ -%.o : %.cc Makefile - @echo =====optimized===== $< - @$(CXX) $(flags) -c $< -o $@ - - -# multigrid classes will be fixed. -all: vector-vector.check block_vector.check block_matrices.check full_matrix.check solver.check -exe: $(all:.check=.testcase) benchmark -run: $(all:.check=.output) - - - -############################################################ -# Typical block for building a running program -# -# 1. provide a list of source files in ...-cc-files -# -# 2. generate the list of object files according to debug-mode -# -# 3. make executable -# -# 4. Explicit dependencies of object files (will be automatic soon) -# -############################################################ - -vector-vector-cc-files = vector-vector.cc - -ifeq ($(debug-mode),on) -vector-vector-o-files = $(vector-vector-cc-files:.cc=.go) -else -vector-vector-o-files = $(vector-vector-cc-files:.cc=.o) -endif - -vector-vector.testcase: $(vector-vector-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - -block_matrices-cc-files = block_matrices.cc - -ifeq ($(debug-mode),on) -block_matrices-o-files = $(block_matrices-cc-files:.cc=.go) -else -block_matrices-o-files = $(block_matrices-cc-files:.cc=.o) -endif - -block_matrices.testcase: $(block_matrices-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - +default: run-tests ############################################################ -block_vector-cc-files = block_vector.cc - -ifeq ($(debug-mode),on) -block_vector-o-files = $(block_vector-cc-files:.cc=.go) ../base/abort.o -else -block_vector-o-files = $(block_vector-cc-files:.cc=.o) ../base/abort.o -endif - -block_vector.testcase: $(block_vector-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - - -solver-cc-files = solver.cc testmatrix.cc - -ifeq ($(debug-mode),on) -solver-o-files = $(solver-cc-files:.cc=.go) -else -solver-o-files = $(solver-cc-files:.cc=.o) -endif +block_matrices.exe : $(libraries) block_matrices.go +block_vector.exe : $(libraries) block_vector.go abort.go +full_matrix.exe : $(libraries) full_matrix.go +solver.exe : $(libraries) solver.go testmatrix.go +sparse_ilu.exe : $(libraries) sparse_ilu.go testmatrix.go +vector-vector.exe : $(libraries) vector-vector.go +#mgbase.exe : $(libraries) mgbase.go +#mg.exe : $(libraries) mg.go testmatrix.go -solver.testcase: $(solver-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) +tests = block_matrices block_vector full_matrix solver sparse_ilu vector-vector ############################################################ -sparse_ilu-cc-files = sparse_ilu.cc testmatrix.cc - -ifeq ($(debug-mode),on) -sparse_ilu-o-files = $(sparse_ilu-cc-files:.cc=.go) -else -sparse_ilu-o-files = $(sparse_ilu-cc-files:.cc=.o) -endif - -sparse_ilu.testcase: $(sparse_ilu-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - -############################################################ - - -full_matrix-cc-files = full_matrix.cc - -ifeq ($(debug-mode),on) -full_matrix-o-files = $(full_matrix-cc-files:.cc=.go) -else -full_matrix-o-files = $(full_matrix-cc-files:.cc=.o) -endif - -full_matrix.testcase: $(full_matrix-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - - -############################################################ - - -mgbase-cc-files = mgbase.cc - -ifeq ($(debug-mode),on) -mgbase-o-files = $(mgbase-cc-files:.cc=.go) -else -mgbase-o-files = $(mgbase-cc-files:.cc=.o) -endif - -mgbase.testcase: $(mgbase-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - - -############################################################ - - -mg-cc-files = mg.cc testmatrix.cc - -ifeq ($(debug-mode),on) -mg-o-files = $(mg-cc-files:.cc=.go) -else -mg-o-files = $(mg-cc-files:.cc=.o) -endif - -mg.testcase: $(mg-o-files) $(libraries) - @echo =====linking======= $< - @$(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - - -############################################################ -# Continue with other targets if needed -############################################################ - - -benchmark-cc-files = benchmark.cc - -ifeq ($(debug-mode),on) -benchmark-o-files = $(benchmark-cc-files:.cc=.go) -else -benchmark-o-files = $(benchmark-cc-files:.cc=.o) -endif - -benchmark.testcase: $(benchmark-o-files) $(libraries) - $(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - -############################################################ -# Continue with other targets if needed -############################################################ - - -target1-cc-files = t1.cc t2.cc t3.cc - -ifeq ($(debug-mode),on) -target1-o-files = $(target1-cc-files:.cc=.go) -else -target1-o-files = $(target1-cc-files:.cc=.o) -endif - -target1: $(target1-o-files) $(libraries) - $(CXX) $(LDFLAGS) -g -o $@ $^ $(LIBS) - - include ../Makefile.rules include Makefile.depend