Module: check_mk
Branch: master
Commit: 3f07a79d94cfbc0ed80b9628b70da9f7eafcd9d1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3f07a79d94cfbc…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jan 27 08:23:23 2016 +0100
Added clang-analyzer target.
---
.gitignore | 1 +
Makefile | 15 +++++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 2a4812c..d169491 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
api
check_mk-*.spec
check_mk-*.tar.gz
+clang-analyzer/
mk-livestatus-*.tar.gz
mkeventd-*.tar.gz
check-mk-*.exe
diff --git a/Makefile b/Makefile
index 9bb769b..b537777 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,9 @@ DISTNAME := $(NAME)-$(VERSION)
TAROPTS := --owner=root --group=root --exclude=.svn --exclude=*~ \
--exclude=.gitignore --exclude=*.swp --exclude=.f12
-CLANG_FORMAT := clang-format-3.7
+CLANG_VERSION := 3.8
+CLANG_FORMAT := clang-format-$(CLANG_VERSION)
+SCAN_BUILD := scan-build-$(CLANG_VERSION)
CPPCHECK := cppcheck
DOXYGEN := doxygen
IWYU := include-what-you-use
@@ -67,9 +69,9 @@ FILES_TO_FORMAT := $(wildcard $(addprefix agents/,*.cc *.c *.h)) \
$(wildcard $(addprefix mkeventd/src/,*.cc *.c *.h))
.PHONY: all check-binaries check check-permissions check-spaces check-version \
- clean cppcheck dist documentation format headers healspaces help iwyu \
- minify-js mk-eventd mk-livestatus mrproper optimize-images packages \
- setup setversion version
+ clang-analyzer clean cppcheck dist documentation format headers \
+ healspaces help iwyu minify-js mk-eventd mk-livestatus mrproper \
+ optimize-images packages setup setversion version
all: dist packages
@@ -260,6 +262,11 @@ iwyu:
$(MAKE) -C livestatus clean
$(MAKE) -C livestatus CC=$(IWYU) CXX=$(IWYU) -k
+# Not really perfect rules, but better than nothing
+clang-analyzer:
+ $(MAKE) -C livestatus clean
+ cd livestatus && $(SCAN_BUILD) -o ../clang-analyzer $(MAKE)
+
cppcheck:
$(CPPCHECK) --quiet --enable=all --max-configs=20 --inline-suppr --template=gcc -I
livestatus/src -I livestatus livestatus