1 DMBS - Dean's Makefile Build System
2 ===================================
8 The CPPCHECK module provides build targets to perform static analysis of the
9 user application, using the open source `cppcheck` tool.
11 ## Importing This Module into a Makefile:
13 To use this module in your application makefile, add the following code to your
16 include $(DMBS_PATH)/cppcheck.mk
20 This module requires the `cppcheck` utility to be available in your system's
21 `PATH` variable. The `cppcheck` utility is distributed on the project's
22 [official site](http://cppcheck.sourceforge.net/) but is also
23 made available in many *nix operating system's package managers.
27 The following targets are supported by this module:
33 <td>Scan the project with CPPCHECK, and show all discovered issues.</td>
36 <td>cppcheck-config</td>
37 <td>Check the project with CPPCHECK, to find missing header paths.</td>
42 ## Mandatory Variables:
44 The following variables must be defined (with a `NAME = VALUE` syntax, one
45 variable per line) in the user makefile to be able to use this module:
51 <td>List of all project source files to scan.</td>
56 ## Optional Variables:
58 The following variables may be defined (with a `NAME = VALUE` syntax, one
59 variable per line) in the user makefile. If not specified, a default value will
65 <td>CPPCHECK_INCLUDES</td>
66 <td>Extra include paths to search, for any missing header files. Default is empty (no additional paths).</td>
69 <td>CPPCHECK_EXCLUDES</td>
70 <td>List of source files, file paths or path fragments to exclude from the scan. Default is empty (no exclusions).</td>
73 <td>CPPCHECK_MSG_TEMPLATE</td>
74 <td>Template for error and warning message output. Default is `{file}:{line}: {severity} ({id}): {message}`.</td>
77 <td>CPPCHECK_ENABLE</td>
78 <td>List of CPPCHECK checks to enable. Default is `all`.</td>
81 <td>CPPCHECK_SUPPRESS</td>
82 <td>List of CPPCHECK checks to ignore. Default is `variableScope missingInclude`.</td>
85 <td>CPPCHECK_FAIL_ON_WARNING</td>
86 <td>Boolean, if `Y` the build will fail if CPPCHECK discovers any errors or warnings. If `N`, fail only on errors. Default is `Y`.</td>
89 <td>CPPCHECK_QUIET</td>
90 <td>Boolean, if `Y` CPPCHECK will suppress all output except for discovered errors or warnings. If `N`, scan progress will be emitted. Default is `Y`.</td>
93 <td>CPPCHECK_FLAGS_</td>
94 <td>Additional flags to pass to CPPCHECK when scans are started. Default is empty (no additional flags).</td>
99 ## Provided Variables:
101 The following variables may be referenced in a user makefile (via `$(NAME)`
102 syntax) if desired, as they are provided by this module.
108 <td>This module provides no variables.</td>
115 The following macros may be referenced in a user makefile (via
116 `$(call NAME, ARG1, ARG2, ...)` syntax) if desired, as they are provided by
123 <td>This module provides no macros.</td>
130 The changes to this module since its initial release are listed below, as of the
131 DMBS version where the change was made.