From 9d016f7c3cce5e671df2212385249331a758cd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Tue, 27 Jun 2017 11:10:46 +0200 Subject: [PATCH] Add `make style` target --- Makefile.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index e1efe9c..befe906 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,8 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = contrib libfreefare test examples +libfreefare_subdirs = libfreefare test examples + +SUBDIRS = contrib $(libfreefare_subdirs) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libfreefare.pc @@ -39,3 +41,7 @@ svn-keywords: svn-keywords-check: @echo "Files missing a '$$"Id"$$' vcs keyword:" @$(SVN_KEYWORDS_FILES_LIST_CMD) | xargs grep -L '\$$Id[^$$]*\$$' + +style: + find ${libfreefare_subdirs} -name '*.[ch]' -exec perl -pi -e 's/[ \t]+$$//' {} \; + find ${libfreefare_subdirs} -name '*.[ch]' -exec astyle --style=linux --indent=force-tab-x --lineend=linux '{}' ';'