From b2d83a917de7f50bf26b5c53866e467f156744e3 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 15 Jul 2018 06:06:43 +0000 Subject: Fixed bug #961. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12164 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- test/nil/testbuild/Makefile | 128 ++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 82 deletions(-) (limited to 'test') diff --git a/test/nil/testbuild/Makefile b/test/nil/testbuild/Makefile index 431bf9d1f..f25c024b2 100755 --- a/test/nil/testbuild/Makefile +++ b/test/nil/testbuild/Makefile @@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),) USE_CPPOPT = -fno-rtti endif -# Enable this if you want the linker to remove unused code and data +# Enable this if you want the linker to remove unused code and data. ifeq ($(USE_LINK_GC),) USE_LINK_GC = yes endif @@ -28,16 +28,11 @@ ifeq ($(USE_LDOPT),) USE_LDOPT = endif -# Enable this if you want link time optimizations (LTO) +# Enable this if you want link time optimizations (LTO). ifeq ($(USE_LTO),) USE_LTO = yes endif -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - # Enable this if you want to see the full log while compiling. ifeq ($(USE_VERBOSE_COMPILE),) USE_VERBOSE_COMPILE = no @@ -79,14 +74,23 @@ endif ############################################################################## ############################################################################## -# Project, sources and paths +# Project, target, sources and paths # # Define project name here PROJECT = ch -# Imported source files and paths +# Target settings. +MCU = cortex-m4 + +# Imported source files and paths. CHIBIOS = ../../.. +CONFDIR := . +BUILDDIR := ./build +DEPDIR := ./.dep + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk # HAL-OSAL files (optional). @@ -97,6 +101,8 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.m # RTOS files (optional). include $(CHIBIOS)/os/nil/nil.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Auto-build files in ./source recursively. +include $(CHIBIOS)/tools/mk/autobuild.mk # Other files (optional). #include $(CHIBIOS)/test/lib/test.mk #include $(CHIBIOS)/test/nil/nil_test.mk @@ -107,90 +113,31 @@ LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = +CPPSRC = $(ALLCPPSRC) -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = +# List ASM source files here. +ASMSRC = $(ALLASMSRC) -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = +# List ASM with preprocessor source files here. +ASMXSRC = $(ALLXASMSRC) -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# +# Inclusion directories. +INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) -MCU = cortex-m4 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here +# Define C warning options here. CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes -# Define C++ warning options here +# Define C++ warning options here. CPPWARN = -Wall -Wextra -Wundef # -# Compiler settings +# Project, target, sources and paths ############################################################################## ############################################################################## @@ -201,7 +148,7 @@ CPPWARN = -Wall -Wextra -Wundef UDEFS = -DSTM32F303xC -D__ARM_ARCH_7EM__=1 # Define ASM defines here -UADEFS = +UADEFS = -DSTM32F303xC # List all user directories here UINCDIR = @@ -213,14 +160,31 @@ ULIBDIR = ULIBS = # -# End of user defines +# End of user section ############################################################################## +############################################################################## +# Common rules +# + RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk +include $(RULESPATH)/arm-none-eabi.mk include $(RULESPATH)/rules.mk +# +# Common rules ############################################################################## -# MISRA check rule, requires PCLint and the setup files, not provided. + +############################################################################## +# Custom rules # + misra: @wine lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) > misra.txt + +winmisra: + @lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) > misra.txt + +# +# Custom rules +############################################################################## -- cgit v1.2.3