3 # Copyright (C) Dean Camera, 2012.
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/ \
28 $(LUFA_ROOT_PATH)/Projects/AVRISP-MKII/
30 # Configuration options to pass to cppcheck
31 CPPCHECK_OPTIONS = --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) --inline-suppr --force --error-exitcode=1 --std=c99
34 all: begin staticcheck end
37 @echo Executing build test "StaticAnalysisTest".
41 @echo Build test "StaticAnalysisTest" complete.
45 cppcheck --quiet $(CPPCHECK_OPTIONS) --check-config $(LUFA_ROOT_PATH)
46 cppcheck --quiet $(CPPCHECK_OPTIONS) --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) $(LUFA_ROOT_PATH)