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/
 
  30 all: begin staticcheck end
 
  33         @echo Executing build test "StaticAnalysisTest".
 
  37         @echo Build test "StaticAnalysisTest" complete.
 
  41         cppcheck --quiet --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) --inline-suppr --force --check-config $(LUFA_ROOT_PATH)
 
  42         cppcheck --quiet --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) --inline-suppr --force --error-exitcode=1 --std=c99 --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) --inconclusive $(LUFA_ROOT_PATH)