From 8e1ab4d73d057280b49543d7cbeffb338b9ad80b Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 6 Mar 2013 17:01:40 +0000 Subject: [PATCH] Add my version of the indentation script. git-svn-id: https://svn.dealii.org/branches/branch_cmake@28758 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/contrib/utilities/indent | 72 +++++++------------------------- 1 file changed, 14 insertions(+), 58 deletions(-) mode change 100644 => 100755 deal.II/contrib/utilities/indent diff --git a/deal.II/contrib/utilities/indent b/deal.II/contrib/utilities/indent old mode 100644 new mode 100755 index 78dca21968..b57e5c92b7 --- a/deal.II/contrib/utilities/indent +++ b/deal.II/contrib/utilities/indent @@ -1,61 +1,17 @@ -style-h-files:= $(wildcard include/deal.II/*/*.h) -style-cc-files:= $(wildcard source/*/*.cc) -style-examples:= $(wildcard examples/*/*.cc) -.PHONY: indent -indent: - @echo "Indenting all files" - @for f in $(style-h-files) $(style-cc-files) $(style-examples) ;\ - do\ - echo $$f ;\ - astyle --options=contrib/utilities/astyle.rc $$f ;\ - done +#!/bin/bash +if test ! -d source -o ! -d include -o ! -d examples ; then + echo "*** This script must be run from the top-level directory of deal.II." + exit +fi -# -# Target for build tests: -# -TMPDIR=/tmp -CMAKE=cmake -SVN=svn info . -date:= $(shell date +%s) -random:=$(shell echo "$$RANDOM") -testdir:= "$(TMPDIR)"/deal-build-test.$(date)-$(random) -builddir:= $(testdir)/build -installdir:= $(testdir)/install -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) +if test ! -f contrib/utilities/astyle.rc ; then + echo "*** No style file contrib/utilities/astyle.rc found." + exit +fi -.PHONY: build_test -build_test: - mkdir -p $(LOGDIR) - mkdir -p $(builddir) - mkdir -p $(installdir) - @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/;' $(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) $(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 $(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 $(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 $(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 $(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 $(PIPEnTRAP) - @echo "END RUN EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile) - rm -rf $(testdir) +echo "--- Indenting all deal.II header and source files" +astyle --options=contrib/utilities/astyle.rc \ + include/deal.II/*/*.h \ + source/*/*.cc \ + examples/*/*.cc -- 2.39.5