]> granicus.if.org Git - postgis/commitdiff
Add "make astyle" target to clean up source tree formatting as per the style guidelines.
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 28 Jan 2010 12:19:04 +0000 (12:19 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 28 Jan 2010 12:19:04 +0000 (12:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5172 b70326c6-7e19-0410-871a-916f4a2858ee

GNUmakefile
astyle.sh [new file with mode: 0755]

index f238d1a639bf79b2d633698cbc408448a42e8810..2f974c039087ff6a01bc1bdd0fc89f1af29358b2 100644 (file)
@@ -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 (executable)
index 0000000..96357a4
--- /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
+