tool: use static analyzer with depot creation tool

Convince wrapper to make static analyzer working with tool/depot/* tools.

Issue #3022
This commit is contained in:
Alexander Boettcher 2018-11-06 15:17:36 +01:00 committed by Christian Helmuth
parent 8199b3e685
commit 9f4801363c
1 changed files with 29 additions and 0 deletions

29
tool/depot/static_analyze Executable file
View File

@ -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/<tool> ...
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)