From: Mark Cave-Ayland Date: Thu, 28 Jan 2010 12:19:04 +0000 (+0000) Subject: Add "make astyle" target to clean up source tree formatting as per the style guidelines. X-Git-Tag: 1.5.0rc2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79912b58fcc9ef25237d29949c48faf244ff1000;p=postgis Add "make astyle" target to clean up source tree formatting as per the style guidelines. git-svn-id: http://svn.osgeo.org/postgis/trunk@5172 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/GNUmakefile b/GNUmakefile index f238d1a63..2f974c039 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -112,4 +112,7 @@ config.status: configure ChangeLog.svn: svn2cl --authors=authors.svn -i -o ChangeLog.svn +astyle: + ./astyle.sh + .PHONY: utils liblwgeom ChangeLog.svn diff --git a/astyle.sh b/astyle.sh new file mode 100755 index 000000000..96357a4cc --- /dev/null +++ b/astyle.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Run astyle on the code base ready for release + +# Find all "pure" C files in the codebase +# - not .in.c used for .sql generation +# - not lex.yy.c or wktparse.tab.c as these are generated files +CFILES=`find . -name '*.c' -not \( -name '*.in.c' -o -name 'wktparse.tab.c' -o -name 'lex.yy.c' \)` + +for THISFILE in $CFILES; +do + echo "Running astyle on $THISFILE..." + + # Rename the old version temporarily... + mv $THISFILE $THISFILE.astyle + + # Run astyle + astyle --style=ansi --indent=tab < $THISFILE.astyle > $THISFILE + + # Remove backup copy + rm $THISFILE.astyle +done +