summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2019-10-28 11:23:30 +0100
committerMurray Cumming <murrayc@murrayc.com>2019-10-28 12:26:02 +0100
commit8d747d775ae9da0a7703d28333dc326d81b36120 (patch)
tree5a426b0dd0a123aa1be92d2238e77741a27a4f31
parent94f2fe5e8c62c001da9cbbbd14e5efa6a0302df6 (diff)
downloadsigc++-8d747d775ae9da0a7703d28333dc326d81b36120.tar.gz
Build: Add target to format code with clang-format
This lets us do "make format" to reformat the code.
-rw-r--r--Makefile.am6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 1e4fc38..a431b2b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,3 +46,9 @@ DISTCLEANFILES = MSVC_NMake/sigc++config.h
# Optional: auto-generate the ChangeLog file from the git log on make dist
include $(top_srcdir)/build/dist-changelog.am
+
+# Run clang-format over all the files, to reformat them.
+# (We don't use xargs here because that wouldn't let us specify different
+# clang-format versions via a bash alias.)
+format:
+ clang-format -i `find . -name "*.h" -or -name "*.cc"`