From 2d26fc8c4bf21965c699bfbc2c0ac0215d808547 Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 28 Feb 2013 23:41:57 +0000 Subject: [PATCH] A preliminary version for a build_test target git-svn-id: https://svn.dealii.org/branches/branch_cmake@28656 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/GNUmakefile | 20 ++++++++++---------- deal.II/bundled/cmake/Makefile | 1 + deal.II/examples/CMakeLists.txt | 5 +++++ deal.II/examples/GNUmakefile | 19 ++++++++++--------- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/deal.II/GNUmakefile b/deal.II/GNUmakefile index 72f058eecf..8982b59060 100644 --- a/deal.II/GNUmakefile +++ b/deal.II/GNUmakefile @@ -25,7 +25,7 @@ indent: .PHONY: cmake cmake: - @cd bundled/cmake && make + cd bundled/cmake && make @echo @echo ======================================================= @echo @@ -58,14 +58,14 @@ testdir:= "$(TMPDIR)"/deal-build-test.$(date)-$(random) builddir:= $(testdir)/build installdir:= $(testdir)/install -.PHONY: build-test +.PHONY: build_test build-test: - @mkdir -p $(builddir) - @mkdir -p $(installdir) - @cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) >$(testdir)/configure.log 2>&1 - @cp $(builddir)/summary.log $(testdir) - @cd $(builddir) && make log >/dev/null 2>&1 - @cp $(builddir)/cmake.log $(testdir) - @cd $(builddir) && make $(MAKEOPTS) install >$(testdir)/build.log 2>&1 - + mkdir -p $(builddir) + mkdir -p $(installdir) + cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) >$(testdir)/configure.log 2>&1 + cp $(builddir)/summary.log $(testdir) + cd $(builddir) && make log >/dev/null 2>&1 + cp $(builddir)/cmake.log $(testdir) + cd $(builddir) && make $(MAKEOPTS) install >$(testdir)/build.log 2>&1 + cd $(installdir)/examples && make run_examples >$(testdir)/examples.log 2>&1 diff --git a/deal.II/bundled/cmake/Makefile b/deal.II/bundled/cmake/Makefile index de8608f3e8..30d8d55615 100644 --- a/deal.II/bundled/cmake/Makefile +++ b/deal.II/bundled/cmake/Makefile @@ -13,4 +13,5 @@ bin/cmake: clean: rm -rf bin cmake-2.8.8 cmake-2.8.8.tar.gz doc man share +.PHONY: all all: bin/cmake diff --git a/deal.II/examples/CMakeLists.txt b/deal.II/examples/CMakeLists.txt index 00c5543911..3d89b4ac39 100644 --- a/deal.II/examples/CMakeLists.txt +++ b/deal.II/examples/CMakeLists.txt @@ -29,4 +29,9 @@ IF(DEAL_II_COMPONENT_EXAMPLES) ) ENDFOREACH() + INSTALL(FILES GNUmakefile + DESTINATION ${DEAL_II_EXAMPLES_RELDIR} + COMPONENT examples + ) + ENDIF() diff --git a/deal.II/examples/GNUmakefile b/deal.II/examples/GNUmakefile index f51445e590..1516700a08 100644 --- a/deal.II/examples/GNUmakefile +++ b/deal.II/examples/GNUmakefile @@ -9,16 +9,17 @@ else default: endif -steps:= $(wildcard step-*) -configure_examples: - @echo "============ Configure all examples" - @for f in $(steps);\ - do\ - cd $(PWD)/$$f ;\ - cmake .;\ - cd $(PWD);\ - done +steps:= $(wildcard step-*) .PHONY: configure_examples +configure_examples: $(steps:%=%/Makefile) + +%/Makefile: + -cd $(@D) && cmake . > /dev/null 2>&1 + +.PHONY: run_examples +run_examples: $(steps:%=%/Output) +%/Output: %/Makefile + cd $(@D) && if [ -f Makefile ]; then make run; fi > Output 2>&1 -- 2.39.5