Module: check_mk
Branch: master
Commit: 3bde6893865f576c3f37f23372add834404b1338
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3bde6893865f57…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu May 19 14:34:26 2016 +0200
Added cppcheck-xml target for CI.
---
.gitignore | 1 +
Makefile | 13 +++++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index 1fc2593..4bfe5a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@ check_mk-*.spec
check_mk-*.tar.gz
clang-analyzer/
compile_commands.json
+cppcheck-result.xml
mk-livestatus-*.tar.gz
mkeventd-*.tar.gz
check-mk-*.exe
diff --git a/Makefile b/Makefile
index 566efe6..bded7d5 100644
--- a/Makefile
+++ b/Makefile
@@ -298,11 +298,20 @@ analyze: livestatus/config.h
$(MAKE) -C livestatus clean
cd livestatus && $(SCAN_BUILD) -o ../clang-analyzer $(MAKE)
CXXFLAGS="-std=c++14"
-# TODO: Repeating the include paths here is ugly and fragile.
+# TODO: Repeating the include paths in the cppcheck targets below is ugly and
+# fragile.
+
+# GCC-like output on stderr intended for human consumption.
cppcheck: compile_commands.json
@./compiled_sources | \
sed 's/^"\(.*\)"$$/\1/' | \
- $(CPPCHECK) --quiet -UCMC --enable=all --inline-suppr --template=gcc -I livestatus/src
-I livestatus --file-list=-
+ $(CPPCHECK) -UCMC --enable=all --inline-suppr -I livestatus/src -I livestatus
--file-list=- --quiet --template=gcc
+
+# XML output into file intended for machine processing.
+cppcheck-xml: compile_commands.json
+ @./compiled_sources | \
+ sed 's/^"\(.*\)"$$/\1/' | \
+ $(CPPCHECK) -UCMC --enable=all --inline-suppr -I livestatus/src -I livestatus
--file-list=- --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml
# TODO: We should probably handle this rule via AM_EXTRA_RECURSIVE_TARGETS in
# src/configure.ac, but this needs at least automake-1.13, which in turn is only