From 9f4801363c1b8fe9143195e59408d171743b9f7d Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 6 Nov 2018 15:17:36 +0100 Subject: [PATCH] tool: use static analyzer with depot creation tool Convince wrapper to make static analyzer working with tool/depot/* tools. Issue #3022 --- tool/depot/static_analyze | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 tool/depot/static_analyze diff --git a/tool/depot/static_analyze b/tool/depot/static_analyze new file mode 100755 index 000000000..a415d4dd2 --- /dev/null +++ b/tool/depot/static_analyze @@ -0,0 +1,29 @@ +#!/usr/bin/make -f + +# +# \brief Tool for invoking depot tool with static clang/llvm analyzer +# \author Alexander Boettcher +# \date 2018-11-08 +# + +define HELP_MESSAGE + + Invoke depot tool with static clang/llvm analyzer + + usage: + + $(firstword $(MAKEFILE_LIST)) tool/depot/ ... + + This tool is a front end to the depot tools like 'create', 'extract' or + 'build'. The tool takes care to enable and to invoke the clang/llvm + tool 'scan-build' such that the make command is correctly recognized + by the static analyzer. + +endef + +export GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..) + +include $(GENODE_DIR)/tool/depot/mk/front_end.inc + +$(MAKECMDGOALS): + + STATIC_ANALYZE=1 make -f $(MAKECMDGOALS)