Commit b9952f48 authored by Dean Camera's avatar Dean Camera
Browse files

Add Build System documentation to the library manual. Update CPPCHECK build...

Add Build System documentation to the library manual. Update CPPCHECK build system module so that it uses the SRC variable rather than just the project directory.
parent 678cb3c2
This diff is collapsed.
This diff is collapsed.
......@@ -12,10 +12,10 @@ LUFA_BUILD_MANDATORY_VARS +=
LUFA_BUILD_OPTIONAL_VARS +=
# -----------------------------------------------------------------------------
# LUFA Core Buildsystem Makefile Module.
# LUFA Core Build System Makefile Module.
# -----------------------------------------------------------------------------
# DESCRIPTION:
# Provides a set of core build targets for the LUFA buildsystem
# Provides a set of core build targets for the LUFA build system
# -----------------------------------------------------------------------------
# TARGETS:
#
......
......@@ -8,10 +8,9 @@
LUFA_BUILD_MODULES += CPPCHECK
LUFA_BUILD_TARGETS += cppcheck cppcheck-config
LUFA_BUILD_MANDATORY_VARS +=
LUFA_BUILD_OPTIONAL_VARS += CPPCHECK_PATH CPPCHECK_INCLUDES CPPCHECK_EXCLUDES CPPCHECK_MSG_TEMPLATE \
CPPCHECK_ENABLE CPPCHECK_SUPPRESS CPPCHECK_FAIL_ON_WARNING CPPCHECK_QUIET \
CPPCHECK_FLAGS
LUFA_BUILD_MANDATORY_VARS += SRC
LUFA_BUILD_OPTIONAL_VARS += CPPCHECK_INCLUDES CPPCHECK_EXCLUDES CPPCHECK_MSG_TEMPLATE CPPCHECK_ENABLE \
CPPCHECK_SUPPRESS CPPCHECK_FAIL_ON_WARNING CPPCHECK_QUIET CPPCHECK_FLAGS
# -----------------------------------------------------------------------------
# LUFA CPPCheck Buildsystem Makefile Module.
......@@ -27,11 +26,10 @@ LUFA_BUILD_OPTIONAL_VARS += CPPCHECK_PATH CPPCHECK_INCLUDES CPPCHECK_EXCLUDES C
#
# MANDATORY PARAMETERS:
#
# (None)
# SRC - List of source files to statically analyze
#
# OPTIONAL PARAMETERS:
#
# CPPCHECK_PATH - Path of the files to statically analyze
# CPPCHECK_INCLUDES - Extra include paths to search for missing
# header files
# CPPCHECK_EXCLUDES - Source file paths to exclude checking (can be
......@@ -51,7 +49,6 @@ ERROR_IF_EMPTY = $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(
ERROR_IF_NONBOOL = $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
# Default values of optionally user-supplied variables
CPPCHECK_PATH ?= .
CPPCHECK_INCLUDES ?=
CPPCHECK_EXCLUDES ?=
CPPCHECK_MSG_TEMPLATE ?= {file}:{line}: {severity} ({id}): {message}
......@@ -63,7 +60,7 @@ CPPCHECK_FLAGS ?=
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
$(call ERROR_IF_EMPTY, CPPCHECK_PATH)
$(call ERROR_IF_EMPTY, SRC)
$(call ERROR_IF_EMPTY, CPPCHECK_MSG_TEMPLATE)
$(call ERROR_IF_EMPTY, CPPCHECK_ENABLE)
$(call ERROR_IF_NONBOOL, CPPCHECK_FAIL_ON_WARNING)
......@@ -84,12 +81,12 @@ endif
MSG_CPPCHECK_CMD := ' [CPPCHECK]:'
cppcheck-config:
@echo $(MSG_CPPCHECK_CMD) Checking cppcheck configuration for path \"$(CPPCHECK_PATH)\"
cppcheck $(BASE_CPPCHECK_FLAGS) --check-config $(CPPCHECK_FLAGS) $(CPPCHECK_PATH)
@echo $(MSG_CPPCHECK_CMD) Checking cppcheck configuration check on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --check-config $(CPPCHECK_FLAGS) $(SRC)
cppcheck:
@echo $(MSG_CPPCHECK_CMD) Performing cppcheck analysis on path \"$(CPPCHECK_PATH)\"
cppcheck $(BASE_CPPCHECK_FLAGS) --enable=$(CPPCHECK_ENABLE) $(CPPCHECK_SUPPRESS:%=--suppress=%) $(CPPCHECK_FLAGS) $(CPPCHECK_PATH)
@echo $(MSG_CPPCHECK_CMD) Performing cppcheck analysis on source files
cppcheck $(BASE_CPPCHECK_FLAGS) --enable=$(CPPCHECK_ENABLE) $(CPPCHECK_SUPPRESS:%=--suppress=%) $(CPPCHECK_FLAGS) $(SRC)
# Phony build targets for this module
.PHONY: cppcheck-config cppcheck
......@@ -45,4 +45,6 @@
* diagnostic output files), execute <b>"make clean"</b>. Once a "make all" has been run and no errors were encountered, the
* resulting binary will be located in the generated ".HEX" file. If your project makes use of pre-initialized EEPROM
* variables, the generated ".EEP" file will contain the project's EEPROM data.
*
* \see \ref Page_BuildSystem for information on the LUFA build system.
*/
......@@ -21,6 +21,8 @@
*
* Below is a copy of the default LUFA application makefile, which can be used as a template for each application.
*
* \see \ref Page_BuildSystem for information on the LUFA build system.
*
* \verbinclude makefile_template
*
* Inside each makefile, a number of configuration variables are listed with the syntax "<VARIABLE NAME> = <VALUE>". For
......
......@@ -11,6 +11,7 @@
* information on compile-time tuning of the library and other developer-related sections.
*
* <b>Subsections:</b>
* \li \subpage Page_BuildSystem - The LUFA Buildsystem
* \li \subpage Page_TokenSummary - Summary of Compile Time Tokens
* \li \subpage Page_Migration - Migrating from an Older LUFA Version
* \li \subpage Page_VIDPID - Allocated USB VID and PID Values
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment