diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-23 17:45:29 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-23 18:00:49 +0900 |
| commit | 0a63a7ecc377ea15632cde221d8a6c7117dfbef8 (patch) | |
| tree | c701409e6595d2d0d7c9675361ae4af64272e617 /Makefile.am | |
| parent | bc1c9cae00fbaeedb5748427852511ee26df73c9 (diff) | |
Add clang-format
Use clang-format-3.6 for now.
Diffstat (limited to 'Makefile.am')
| -rw-r--r-- | Makefile.am | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index c6b7c4cd..bdd7d513 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ EXTRA_DIST = config.rpath \ dist_doc_DATA = README README.rst README.html +.PHONY: clang-format + if HAVE_RST2HTML README.html: README.rst $(RST2HTML) $< > $@ @@ -27,3 +29,11 @@ endif # !HAVE_RST2HTML dist_noinst_DATA = LICENSE.OpenSSL +# Format source files using clang-format. Don't format source files +# under deps directory since we are not responsible for thier coding +# style. +clang-format: + CLANGFORMAT=`git config --get clangformat.binary`; \ + test -z $${CLANGFORMAT} && CLANGFORMAT="clang-format"; \ + $${CLANGFORMAT} -i src/*.{c,cc,h} src/includes/aria2/*.h \ + examples/*.cc test/*.{cc,h} |
