cppcheck added

This commit is contained in:
tkl
2016-07-23 11:09:27 +02:00
parent 7cf36fe7c1
commit f67dadf938
12 changed files with 42 additions and 25 deletions

View File

@@ -12,6 +12,7 @@ SIZEFILE = $(SIZE_DIR)/$(APP)$(SIZE_EXT)
INCLUDES += $(SRC_DIR)
SUB_FOLDER :=
CHECK_FOLDER :=
SOURCES := $(wildcard $(SRC_DIR)/*.c)
ASM_SOURCES := $(wildcard $(SRC_DIR)/*.s)
@@ -24,10 +25,15 @@ include application/application.mk
include firmware/firmware.mk
SOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.c))
CHECKSOURCES += $(foreach folder, $(CHECK_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.c))
ASMSOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.s))
all: $(MAINFILE)
check:
$(CPPCHECK) $(CPPCHECK_FLAGS) $(CHECKSOURCES)
$(MAINFILE): $(OBJECTS) $(ASM_OBJECTS)
@$(MKDIR) $(EXE_DIR)
@$(MKDIR) $(MAP_DIR)
@@ -45,7 +51,6 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
@$(MKDIR) $(OBJ_DIR)
@$(foreach folder, $(SUB_FOLDER), $(shell mkdir -p $(OBJ_DIR)/$(folder)))
$(call makedep,$<,$@,$(subst .o,.d,$@))
$(CPPCHECK) $(CPPCHECK_FLAGS) $<
$(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.s

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += application/example_semaphore
SUB_FOLDER += application/example_semaphore
INCLUDES += application/example_semaphore
DOC_SRC += application/example_semaphore
SUB_FOLDER += application/example_semaphore

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += application/test
SUB_FOLDER += application/test
INCLUDES += application/test
DOC_SRC += application/test
SUB_FOLDER += application/test

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/arch/stm32f4xx/board/stm32f4-discovery
SUB_FOLDER += firmware/arch/stm32f4xx/board/stm32f4-discovery
INCLUDES += firmware/arch/stm32f4xx/board/stm32f4-discovery
DOC_SRC += firmware/arch/stm32f4xx/board/stm32f4-discovery

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/arch/stm32f4xx/driver/gpio
SUB_FOLDER += firmware/arch/stm32f4xx/driver/gpio
INCLUDES += firmware/arch/stm32f4xx/driver/gpio
DOC_SRC += firmware/arch/stm32f4xx/driver/gpio

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/arch/stm32f4xx/driver/timer
SUB_FOLDER += firmware/arch/stm32f4xx/driver/timer
INCLUDES += firmware/arch/stm32f4xx/driver/timer
DOC_SRC += firmware/arch/stm32f4xx/driver/timer

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/arch/stm32f4xx/driver/usb_vport
SUB_FOLDER += firmware/arch/stm32f4xx/driver/usb_vport
INCLUDES += firmware/arch/stm32f4xx/driver/usb_vport
DOC_SRC += firmware/arch/stm32f4xx/driver/usb_vport

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/arch/stm32f4xx
SUB_FOLDER += firmware/arch/stm32f4xx
INCLUDES += firmware/arch/stm32f4xx
DOC_SRC += firmware/arch/stm32f4xx

View File

@@ -19,9 +19,9 @@
#undef errno
extern int errno;
/* cppcheck-suppress unusedFunction */
int _kill(int pid, int sig)
{
pid = pid; sig = sig; /* avoid warnings */
errno = EINVAL;
return -1;
}

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/kernel/driver
SUB_FOLDER += firmware/kernel/driver
INCLUDES += firmware/kernel/driver
DOC_SRC += firmware/kernel/driver

View File

@@ -1,3 +1,4 @@
CHECK_FOLDER += firmware/kernel
SUB_FOLDER += firmware/kernel
INCLUDES += firmware/kernel
DOC_SRC += firmware/kernel