2012-02-28 21:07:52 +01:00
|
|
|
#
|
|
|
|
# LUFA Library
|
2012-05-27 16:42:30 +02:00
|
|
|
# Copyright (C) Dean Camera, 2012.
|
2012-02-28 21:07:52 +01:00
|
|
|
#
|
|
|
|
# dean [at] fourwalledcubicle [dot] com
|
|
|
|
# www.lufa-lib.org
|
|
|
|
#
|
|
|
|
|
|
|
|
# Static anlysis of the entire LUFA source tree, using the free cross-platform "cppcheck" tool.
|
|
|
|
|
|
|
|
# Path to the root of the LUFA tree to scan
|
2012-03-04 17:15:59 +01:00
|
|
|
LUFA_ROOT_PATH = ../..
|
2012-02-28 21:07:52 +01:00
|
|
|
|
|
|
|
# Filenames or directories (including fragments) to exclude from the analysis
|
2012-03-04 17:15:59 +01:00
|
|
|
EXCLUDE_LIST = FATFs/ \
|
|
|
|
PetiteFATFs/ \
|
2012-03-04 19:21:54 +01:00
|
|
|
uip/
|
2012-02-28 21:07:52 +01:00
|
|
|
|
|
|
|
# Output message template for found warnings and errors
|
2012-03-04 17:15:59 +01:00
|
|
|
MESSAGE_TEMPLATE = "{file}:{line}: {severity} ({id}): {message}"
|
2012-02-29 18:04:04 +01:00
|
|
|
|
|
|
|
# Checks to suppress so that generated warnings are discarded
|
2012-03-04 17:15:59 +01:00
|
|
|
SUPPRESS_WARNINGS = variableScope \
|
2012-03-04 19:21:54 +01:00
|
|
|
missingInclude
|
2012-02-28 21:07:52 +01:00
|
|
|
|
2012-03-04 17:15:59 +01:00
|
|
|
# Extra paths to search for include files
|
2012-04-16 22:43:30 +02:00
|
|
|
INCLUDE_PATHS = $(LUFA_ROOT_PATH)/LUFA/CodeTemplates/ \
|
|
|
|
$(LUFA_ROOT_PATH)/Projects/AVRISP-MKII/
|
2012-03-04 17:15:59 +01:00
|
|
|
|
2012-04-08 13:30:28 +02:00
|
|
|
# Configuration options to pass to cppcheck
|
|
|
|
CPPCHECK_OPTIONS = --template=$(MESSAGE_TEMPLATE) $(INCLUDE_PATHS:%=-I%) $(EXCLUDE_LIST:%=-i%) --inline-suppr --force --error-exitcode=1 --std=c99
|
|
|
|
|
2012-03-04 17:15:59 +01:00
|
|
|
|
|
|
|
all: begin staticcheck end
|
|
|
|
|
|
|
|
begin:
|
|
|
|
@echo Executing build test "StaticAnalysisTest".
|
|
|
|
@echo
|
|
|
|
|
|
|
|
end:
|
|
|
|
@echo Build test "StaticAnalysisTest" complete.
|
|
|
|
@echo
|
|
|
|
|
|
|
|
staticcheck:
|
2012-04-08 13:30:28 +02:00
|
|
|
cppcheck --quiet $(CPPCHECK_OPTIONS) --check-config $(LUFA_ROOT_PATH)
|
|
|
|
cppcheck --quiet $(CPPCHECK_OPTIONS) --enable=all $(SUPPRESS_WARNINGS:%=--suppress=%) $(LUFA_ROOT_PATH)
|
2012-03-04 19:21:54 +01:00
|
|
|
|
2012-03-09 22:28:44 +01:00
|
|
|
%:
|
|
|
|
|