From 723e2860aedd4b37aae7c8d8629b7c987ef06850 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 29 May 2012 15:56:02 +0000 Subject: [PATCH] Adding make style --- HACKING | 5 +++-- Makefile.am | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/HACKING b/HACKING index 737f9c6..db5dc3f 100644 --- a/HACKING +++ b/HACKING @@ -11,8 +11,9 @@ Here are some directions to get you started: is consistent in style and thus easier to read. Look around and respect the same style. Don't use tabs. Increment unit is two spaces. - Don't leave dandling spaces or tabs at EOL. Helper script: - $ find . -name '*.[ch]' -exec perl -pi -e 's/[ \t]+$//;' {} \; + Don't leave dandling spaces or tabs at EOL. + Helper script to get some uniformity in the style: + $ make style 2. Chase warnings: no warning should be introduced by your changes Depending what you touch, you can check with: diff --git a/Makefile.am b/Makefile.am index 273cc52..3671cb6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ CLEANFILES = Doxygen.log coverage.info libnfc.pc clean-local: clean-local-doc clean-local-coverage -.PHONY: clean-local-coverage clean-local-doc doc +.PHONY: clean-local-coverage clean-local-doc doc style clean-local-coverage: -rm -rf coverage @@ -28,3 +28,10 @@ doc : Doxyfile DISTCHECK_CONFIGURE_FLAGS="--with-drivers=all" +style: + find . -name "*.[ch]" -exec perl -pi -e 's/[ \t]+$$//' {} \; + find . -name "*.[ch]" -exec astyle --formatted --mode=c --suffix=none \ + --indent=spaces=2 --indent-switches --indent-preprocessor \ + --keep-one-line-blocks --max-instatement-indent=60 \ + --brackets=linux --pad-oper --unpad-paren --pad-header \ + --align-pointer=name {} \;