From: maier Date: Fri, 1 Mar 2013 13:29:01 +0000 (+0000) Subject: Some improvements on build_test target X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3ea4ab38c780bf6656a8d9a8b646db5b05b076e;p=dealii-svn.git Some improvements on build_test target git-svn-id: https://svn.dealii.org/branches/branch_cmake@28681 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/GNUmakefile b/deal.II/GNUmakefile index 9e4c9af791..dca43691cf 100644 --- a/deal.II/GNUmakefile +++ b/deal.II/GNUmakefile @@ -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)