mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
Add command 'make cppcheck' and friend.
This commit is contained in:
parent
c49bd407bf
commit
cf8a6f8f8b
1 changed files with 14 additions and 0 deletions
14
Makefile
14
Makefile
|
@ -72,6 +72,8 @@ VPATH := $(SRC_DIR):$(SRC_DIR)/startup
|
|||
USBFS_DIR = $(ROOT)/lib/main/STM32_USB-FS-Device_Driver
|
||||
USBPERIPH_SRC = $(notdir $(wildcard $(USBFS_DIR)/src/*.c))
|
||||
|
||||
CSOURCES := $(shell find $(SRC_DIR) -name '*.c')
|
||||
|
||||
ifeq ($(TARGET),$(filter $(TARGET),STM32F3DISCOVERY CHEBUZZF3 NAZE32PRO SPRACINGF3 SPARKY ALIENWIIF3 COLIBRI_RACE))
|
||||
|
||||
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F30x_StdPeriph_Driver
|
||||
|
@ -615,6 +617,11 @@ LDFLAGS = -lm \
|
|||
# No user-serviceable parts below
|
||||
###############################################################################
|
||||
|
||||
CPPCHECK = cppcheck $(CSOURCES) --enable=all --platform=unix64 \
|
||||
--std=c99 --inline-suppr --quiet --force \
|
||||
$(addprefix -I,$(INCLUDE_DIRS)) \
|
||||
-I/usr/include -I/usr/include/linux
|
||||
|
||||
#
|
||||
# Things we will build
|
||||
#
|
||||
|
@ -684,6 +691,13 @@ unbrick_$(TARGET): $(TARGET_HEX)
|
|||
|
||||
unbrick: unbrick_$(TARGET)
|
||||
|
||||
## cppcheck : run static analysis on C source code
|
||||
cppcheck: $(CSOURCES)
|
||||
$(CPPCHECK)
|
||||
|
||||
cppcheck-result.xml: $(CSOURCES)
|
||||
$(CPPCHECK) --xml-version=2 2> cppcheck-result.xml
|
||||
|
||||
help:
|
||||
@echo ""
|
||||
@echo "Makefile for the $(FORKNAME) firmware"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue