Merge branch 'fix/cppcheck' into 'master'

Fix/cppcheck



See merge request !3
This commit is contained in:
tkl 2016-07-26 21:05:29 +00:00
commit f99cce4c46
4 changed files with 25 additions and 49 deletions

View File

@ -267,7 +267,6 @@
</target>
<target name="all" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
@ -275,7 +274,6 @@
</target>
<target name="clean" path="software/source/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
@ -283,7 +281,6 @@
</target>
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
@ -291,7 +288,6 @@
</target>
<target name="all" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
@ -299,7 +295,6 @@
</target>
<target name="clean" path="software/source/test/firmware/kernel/ringbuffer" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
@ -307,36 +302,11 @@
</target>
<target name="distclean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>distclean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="example_semaphore all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>APP=example_semaphore BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="example_semaphore clean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>APP=example_semaphore BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="example_semaphore install" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>APP=example_semaphore BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="test all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments>
@ -353,24 +323,17 @@
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="test check" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="test clean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>check</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="test build" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> APP=test BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>build</buildTarget>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="distclean" path="software/source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>distclean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>

View File

@ -17,14 +17,13 @@ before_script:
stages:
- check
- build
# - test
- test
# - deploy
build_job:
script:
- "cd source"
- "make build APP=test BOARD=stm32f4-discovery"
- "make build APP=example_semaphore BOARD=stm32f4-discovery"
stage: build
except:
- /^release/.*$/
@ -33,12 +32,13 @@ check_job:
script:
- "cd source"
- "make check APP=test BOARD=stm32f4-discovery"
- "make check APP=example_semaphore BOARD=stm32f4-discovery"
stage: check
#test_job:
# script: "echo test stage"
# stage: test
test_job:
script:
- "cd source"
- "make install APP=test BOARD=stm32f4-discovery"
stage: test
#int_release_job:
# script:

View File

@ -15,11 +15,12 @@ CFLAGS += \
$(addprefix -I, $(INCLUDES)) \
-Wall
CPPCHECK_FLAGS = \
CPPCHECK_FLAGS += \
--template=gcc \
--error-exitcode=1 \
--enable=warning,performance,information,style \
--inline-suppr
--inline-suppr \
$(addprefix -I, $(INCLUDES))
include $(ROOT_DIR)/config/make/tools.mk

View File

@ -7,7 +7,9 @@ CFLAGS += -DBOARD_STM32F4_DISCOVERY
endif
CROSS_COMPILE=arm-none-eabi-
INCLUDES := /usr/lib/arm-none-eabi/include
INCLUDES += \
/usr/lib/arm-none-eabi/include \
/usr/lib/gcc/arm-none-eabi/4.8/include
ifeq ($(DEBUG),y)
OPTIM = 0
@ -33,6 +35,16 @@ CFLAGS += \
-ffunction-sections
# -D inline= -mthumb\
CPPCHECK_FLAGS += \
-D USE_STDPERIPH_DRIVER\
-D VECT_TAB_FLASH\
-D GCC_ARMCM4\
-D THUMB_INTERWORK\
-D PACK_STRUCT_END=__attribute\(\(packed\)\)\
-D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)\
-D __thumb__ \
--check-config
LDFLAGS=\
-Wl,--gc-sections \
-Xlinker -M > $(MAP_DIR)/$(APP).map