]> git.meshlink.io Git - utcp/commitdiff
Check for astyle version 3 before formatting the code.
authorGuus Sliepen <guus@sliepen.org>
Sun, 17 Mar 2019 19:57:43 +0000 (20:57 +0100)
committerGuus Sliepen <guus@sliepen.org>
Sun, 17 Mar 2019 19:57:43 +0000 (20:57 +0100)
Unfortunately, code formatters change their behaviour between versions.
The code currently requires astyle version 3.x, so check this before
running astyle. If the wrong version is installed, print an error.

Makefile

index faa2f66a3b8e191e36340f3c6d64c466393baae6..6cb1bc9ab5e8bd1716d5e2932e49666ac0c881e8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ clean:
        rm -f *.o $(BIN)
 
 astyle:
+       @astyle --version | grep -q "Version 3" || (echo 'ERROR: astyle version 3 required!' 1>&2 && exit 1)
        astyle --options=.astylerc -nQ *.c *.h
 
 .PHONY: clean astyle