The CPPCHECK module provides build targets to perform static analysis of the user application, using the open source cppcheck
tool.
To use this module in your application makefile, add the following code to your makefile:
include $(DMBS_PATH)/cppcheck.mk
This module requires the cppcheck
utility to be available in your system's PATH
variable. The cppcheck
utility is distributed on the project's official site but is also made available in many *nix operating system's package managers.
The following targets are supported by this module:
cppcheck
Scan the project with CPPCHECK, and show all discovered issues.
cppcheck-config
Check the project with CPPCHECK, to find missing header paths. </tbody>
The following variables must be defined (with a NAME = VALUE
syntax, one variable per line) in the user makefile to be able to use this module:
SRC
List of all project source files to scan. </tbody>
The following variables may be defined (with a NAME = VALUE
syntax, one variable per line) in the user makefile. If not specified, a default value will be assumed.
CPPCHECK_INCLUDES
Extra include paths to search, for any missing header files. Default is empty (no additional paths).
CPPCHECK_EXCLUDES
List of source files, file paths or path fragments to exclude from the scan. Default is empty (no exclusions).
CPPCHECK_MSG_TEMPLATE
Template for error and warning message output. Default is {file}:{line}: {severity} ({id}): {message}
.
CPPCHECK_ENABLE
List of CPPCHECK checks to enable. Default is all
.
CPPCHECK_SUPPRESS
List of CPPCHECK checks to ignore. Default is variableScope missingInclude
.
CPPCHECK_FAIL_ON_WARNING
Boolean, if Y
the build will fail if CPPCHECK discovers any errors or warnings. If N
, fail only on errors. Default is Y
.
CPPCHECK_QUIET
Boolean, if Y
CPPCHECK will suppress all output except for discovered errors or warnings. If N
, scan progress will be emitted. Default is Y
.
CPPCHECK_FLAGS_
Additional flags to pass to CPPCHECK when scans are started. Default is empty (no additional flags). </tbody>
The following variables may be referenced in a user makefile (via syntax) if desired, as they are provided by this module.
N/A
This module provides no variables. </tbody>
The following macros may be referenced in a user makefile (via $(call NAME, ARG1, ARG2, ...)
syntax) if desired, as they are provided by this module.
N/A
This module provides no macros. </tbody>