3 # Copyright (C) Dean Camera, 2011.
5 # dean [at] fourwalledcubicle [dot] com
9 # Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool.
11 # Path to the root of the LUFA tree to scan
12 LUFA_ROOT_PATH = ../..
14 # Filenames or directories (including fragments) to exclude from the analysis
15 EXCLUDE_LIST = FATFs/ \
19 # Output message template for found warnings and errors
20 MESSAGE_TEMPLATE = "{file}:{line}: {severity} ({id}): {message}"
22 # Checks to suppress so that generated warnings are discarded
23 SUPPRESS_WARNINGS = variableScope \
26 # Extra paths to search for include files
27 INCLUDE_PATHS = $(LUFA_ROOT_PATH)/LUFA/CodeTemplates/
29 # Configuration options to pass to cppcheck
30 CPPCHECK_OPTIONS = --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) --inline-suppr --force --error-exitcode=1 --std=c99
33 all: begin staticcheck end
36 @echo Executing build test "StaticAnalysisTest".
40 @echo Build test "StaticAnalysisTest" complete.
44 cppcheck --quiet $(CPPCHECK_OPTIONS) --check-config $(LUFA_ROOT_PATH)
45 cppcheck --quiet $(CPPCHECK_OPTIONS) --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) $(LUFA_ROOT_PATH)