From e8a9985751cb25b58a8ba892a65593b2a44fb87f Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 6 Mar 2013 10:37:55 +0000 Subject: [PATCH] Bugfixes in the build_test target: By default always clean up temporary files git-svn-id: https://svn.dealii.org/branches/branch_cmake@28748 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/GNUmakefile | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/deal.II/GNUmakefile b/deal.II/GNUmakefile index 0d584c1d26..50b864dca7 100644 --- a/deal.II/GNUmakefile +++ b/deal.II/GNUmakefile @@ -70,39 +70,40 @@ random:=$(shell echo "$$RANDOM") testdir:= "$(TMPDIR)"/deal-build-test.$(date)-$(random) builddir:= $(testdir)/build installdir:= $(testdir)/install -LOGDIR=$(testdir) +LOGDIR=$(PWD) logfile:=$(LOGDIR)/$(date).$(firstword $(notdir $(CONFIGFILE)) automatic).log +CLEANUP=true +TEEnTRAP:= | tee -a $(logfile) || (if ${CLEANUP}; then rm -rf $(testdir); fi; false) +PIPEnTRAP:= >>$(logfile) 2>&1 || (if ${CLEANUP}; then rm -rf $(testdir); fi; false) .PHONY: build_test build_test: + mkdir -p $(LOGDIR) mkdir -p $(builddir) mkdir -p $(installdir) - mkdir -p $(LOGDIR) @echo "AUTOMATED DEAL.II BUILD TEST" | tee $(logfile) @echo "BEGIN HEADER `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) - @$(SVN) | perl -ne 'print "dealii-feature: revision=$$_" if s/Last Changed Rev: //; print "dealii-feature: branch=$$1\n" if m/svn\.dealii\.org\/(.+)\/deal.II/;' | tee -a $(logfile) - @echo "dealii-feature: user=$(USER)" - @echo "dealii-feature: host=`hostname`" - @echo "dealii-feature: configuration=`basename \"$(CONFIGFILE)\"`" + @$(SVN) | perl -ne 'print "dealii-feature: revision=$$_" if s/Last Changed Rev: //; print "dealii-feature: branch=$$1\n" if m/svn\.dealii\.org\/(.+)\/deal.II/;' $(TEEnTRAP) + @echo "dealii-feature: user=$(USER)" | tee -a $(logfile) + @echo "dealii-feature: host=`hostname`" | tee -a $(logfile) + @echo "dealii-feature: configuration=`basename \"$(CONFIGFILE)\"`" | 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 + cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) $(PIPEnTRAP) @echo "END CONFIGURE OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) @echo "BEGIN CMAKE SYSTEM INFORMATION `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) - cd $(builddir) && "$(CMAKE)" --system-information >>$(logfile) 2>&1 + cd $(builddir) && "$(CMAKE)" --system-information $(PIPEnTRAP) @echo "END CMAKE SYSTEM INFORMATION `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) @echo "BEGIN REPORT FEATURES `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) - cd $(builddir) && make $(MAKEOPTS) run_report_features >>$(logfile) 2>&1 + cd $(builddir) && make $(MAKEOPTS) run_report_features $(PIPEnTRAP) @echo "END REPORT FEATURES `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 + cd $(builddir) && make $(MAKEOPTS) install $(PIPEnTRAP) @echo "END BUILD INSTALL OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) @echo "BEGIN BUILD EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) - cd $(installdir)/examples && make $(MAKEOPTS) build_examples >>$(logfile) 2>&1 + cd $(installdir)/examples && make $(MAKEOPTS) build_examples $(PIPEnTRAP) @echo "END BUILD EXAMPLES 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 + cd $(installdir)/examples && make $(MAKEOPTS) run_examples $(PIPEnTRAP) @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) + rm -rf $(testdir) -- 2.39.5