-#
# 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
#
-# 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)