]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Some improvements on build_test target
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Mar 2013 13:29:01 +0000 (13:29 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 1 Mar 2013 13:29:01 +0000 (13:29 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@28681 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/GNUmakefile

index 9e4c9af791f3cd801a5ace775d87a81bb61e00b0..dca43691cf689d4c1cc2b5f8435f8392a1559d3a 100644 (file)
@@ -1,8 +1,6 @@
-#
 # GNUmakefile has priority over Makefile for GNU Make.
 # So if a Makefile was generated by CMake due to an in-source configure
 # chain-load it:
-#
 ifneq ($(wildcard Makefile),)
   include Makefile
 else
@@ -40,32 +38,42 @@ cmake:
 
 
 #
-# Target for build tests
-#
-# Environment variables:
-#      CMAKE
-#      TMPDIR
-#      CONFIGFILE
-#      MAKEOPTS
+# Target for build tests:
 #
-
+# Environment variables: CONFIGFILE CMAKE MAKEOPTS LOGDIR TMPDIR
 TMPDIR=/tmp
 CMAKE=cmake
-
 date:= $(shell date +%s)
 random:=$(shell echo "$$RANDOM")
 testdir:= "$(TMPDIR)"/deal-build-test.$(date)-$(random)
 builddir:= $(testdir)/build
 installdir:= $(testdir)/install
 
+LOGDIR=$(testdir)
+ifeq "$(CONFIGFILE)" ""
+  logfiledir:=$(LOGDIR)/$(date).automatic
+else
+  logfiledir:=$(LOGDIR)/$(date).$(shell basename "$(CONFIGFILE)")
+endif
+logfile:=$(logfiledir)/build_test.log
+
 .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
-       cd $(installdir)/examples && make $(MAKEOPTS) run_examples >$(testdir)/examples.log 2>&1
-
+       mkdir -p $(logfiledir)
+       @echo "AUTOMATED DEAL.II BUILD TEST" | tee $(logfile)
+       @echo "BEGIN HEADER `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       @echo END HEADER `date -u '+%Y-%m-%d %T'`\n | tee -a $(logfile)
+       @echo "BEGIN CONFIGURE OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) >>$(logfile) 2>&1
+       @echo "END CONFIGURE OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       @echo "BEGIN BUILD INSTALL OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       cd $(builddir) && make $(MAKEOPTS) install >>$(logfile) 2>&1
+       @echo "END BUILD INSTALL OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       @echo "BEGIN RUN EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       cd $(installdir)/examples && make $(MAKEOPTS) run_examples >>$(logfile) 2>&1
+       @echo "END RUN EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+       rm -rf $(builddir)
+       rm -rf $(installdir)
+       rmdir --ignore-fail-on-non-empty -p $(testdir)

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.