]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add my version of the indentation script.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Mar 2013 17:01:40 +0000 (17:01 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Mar 2013 17:01:40 +0000 (17:01 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@28758 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/utilities/indent [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 78dca21..b57e5c9
@@ -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

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.