diff --git a/Makefile b/Makefile index 1f279089400d59b9fdf195cd95a28abcce2cb32b..34dc134d3ec31e39ec4e377392840a97f1b9def3 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ ## ## Makefile for Miosix embedded OS ## -MAKEFILE_VERSION := 1.09 -GCCMAJOR := $(shell arm-miosix-eabi-gcc --version | \ - perl -e '$$_=<>;/\(GCC\) (\d+)/;print "$$1"') +MAKEFILE_VERSION := 1.10 ## Path to kernel directory (edited by init_project_out_of_git_repo.pl) KPATH := miosix ## Path to config directory (edited by init_project_out_of_git_repo.pl) @@ -59,12 +57,7 @@ LFLAGS := $(LFLAGS_BASE) DFLAGS := -MMD -MP ## libmiosix.a is among stdlibs because needs to be within start/end group -STDLIBS := -lmiosix -lstdc++ -lc -lm -lgcc - -ifneq ($(GCCMAJOR),4) - STDLIBS += -latomic -endif - +STDLIBS := -lmiosix -lstdc++ -lc -lm -lgcc -latomic LINK_LIBS := $(LIBS) -L$(KPATH) -Wl,--start-group $(STDLIBS) -Wl,--end-group all: all-recursive main diff --git a/miosix/Makefile b/miosix/Makefile index 95d8c7986f1f49f69d72927f8b0bf62830daff44..1fb69bf30c83b3b5e6b4cbab5efd5395a184919a 100644 --- a/miosix/Makefile +++ b/miosix/Makefile @@ -2,9 +2,7 @@ ## Makefile for Miosix embedded OS ## This makefile builds the whole kernel ## -MAKEFILE_VERSION := 1.09 -GCCMAJOR := $(shell arm-miosix-eabi-gcc --version | \ - perl -e '$$_=<>;/\(GCC\) (\d+)/;print "$$1"') +MAKEFILE_VERSION := 1.10 ## KPATH and CONFPATH are forwarded by the parent Makefile include $(CONFPATH)/config/Makefile.inc diff --git a/miosix/_examples/datalogger/Makefile b/miosix/_examples/datalogger/Makefile index 3abadcef3feff82998970c4f5a76a6ba8864b6ee..aa5e87895e069fd13060deb7cc1f0e6c7174090b 100644 --- a/miosix/_examples/datalogger/Makefile +++ b/miosix/_examples/datalogger/Makefile @@ -1,9 +1,7 @@ ## ## Makefile for Miosix embedded OS ## -MAKEFILE_VERSION := 1.09 -GCCMAJOR := $(shell arm-miosix-eabi-gcc --version | \ - perl -e '$$_=<>;/\(GCC\) (\d+)/;print "$$1"') +MAKEFILE_VERSION := 1.10 ## Path to kernel directory (edited by init_project_out_of_git_repo.pl) KPATH := miosix ## Path to config directory (edited by init_project_out_of_git_repo.pl) @@ -59,12 +57,7 @@ LFLAGS := $(LFLAGS_BASE) DFLAGS := -MMD -MP ## libmiosix.a is among stdlibs because needs to be within start/end group -STDLIBS := -lmiosix -lstdc++ -lc -lm -lgcc - -ifneq ($(GCCMAJOR),4) - STDLIBS += -latomic -endif - +STDLIBS := -lmiosix -lstdc++ -lc -lm -lgcc -latomic LINK_LIBS := $(LIBS) -L$(KPATH) -Wl,--start-group $(STDLIBS) -Wl,--end-group all: all-recursive main diff --git a/miosix/_examples/sad_trombone/Makefile b/miosix/_examples/sad_trombone/Makefile index 5dd40e35746c6baf82fa6f9094502e9eb16db947..2ea1bda61b64a63cf8f32571991c996930415a84 100644 --- a/miosix/_examples/sad_trombone/Makefile +++ b/miosix/_examples/sad_trombone/Makefile @@ -1,9 +1,7 @@ ## ## Makefile for Miosix embedded OS ## -MAKEFILE_VERSION := 1.09 -GCCMAJOR := $(shell arm-miosix-eabi-gcc --version | \ - perl -e '$$_=<>;/\(GCC\) (\d+)/;print "$$1"') +MAKEFILE_VERSION := 1.10 ## Path to kernel directory (edited by init_project_out_of_git_repo.pl) KPATH := miosix ## Path to config directory (edited by init_project_out_of_git_repo.pl) @@ -59,12 +57,7 @@ LFLAGS := $(LFLAGS_BASE) DFLAGS := -MMD -MP ## libmiosix.a is among stdlibs because needs to be within start/end group -STDLIBS := -lmiosix -lstdc++ -lc -lm -lgcc - -ifneq ($(GCCMAJOR),4) - STDLIBS += -latomic -endif - +STDLIBS := -lmiosix -lstdc++ -lc -lm -lgcc -latomic LINK_LIBS := $(LIBS) -L$(KPATH) -Wl,--start-group $(STDLIBS) -Wl,--end-group all: all-recursive main diff --git a/miosix/arch/cortexM4_stm32f4/common/interfaces-impl/os_timer.cpp b/miosix/arch/common/core/stm32f2_f4_f7_os_timer.cpp similarity index 100% rename from miosix/arch/cortexM4_stm32f4/common/interfaces-impl/os_timer.cpp rename to miosix/arch/common/core/stm32f2_f4_f7_os_timer.cpp diff --git a/miosix/config/Makefile.inc b/miosix/config/Makefile.inc index 7b079a453d26dcf31e427b7c53d76562ee8b7477..8733cfd5760df8e5f8c55023aa81da743a9e6cc4 100644 --- a/miosix/config/Makefile.inc +++ b/miosix/config/Makefile.inc @@ -623,7 +623,7 @@ endif ## a new board or porting Miosix to a new architecture ## ############################################################################ -ifneq ($(MAKEFILE_VERSION),1.09) +ifneq ($(MAKEFILE_VERSION),1.10) $(info You are using an incompatible makefile. Make sure it matches \ the one distributed with the current version of the kernel) $(error Error) @@ -721,15 +721,10 @@ endif ## ## Then, initialize C/C++ flags ## -ifneq ($(GCCMAJOR),4) - CXXSTD := -std=c++14 -else - CXXSTD := -std=gnu++11 -endif CFLAGS_BASE := -D_MIOSIX_BOARDNAME=\"$(OPT_BOARD)\" -D_DEFAULT_SOURCE=1 \ -ffunction-sections -Wall -Werror=return-type -g CXXFLAGS_BASE := -D_MIOSIX_BOARDNAME=\"$(OPT_BOARD)\" -D_DEFAULT_SOURCE=1 \ - $(CXXSTD) -ffunction-sections -Wall -Werror=return-type -g + -std=c++14 -ffunction-sections -Wall -Werror=return-type -g ## ## Now two big switch-like constructs nested. The first lists all possible @@ -1741,8 +1736,8 @@ else ifeq ($(ARCH),cortexM4_stm32f4) $(ARCH_INC)/interfaces-impl/portability.cpp \ $(ARCH_INC)/interfaces-impl/delays.cpp \ $(ARCH_INC)/interfaces-impl/gpio_impl.cpp \ - $(ARCH_INC)/interfaces-impl/os_timer.cpp \ arch/common/drivers/sd_stm32f2_f4.cpp \ + arch/common/core/stm32f2_f4_f7_os_timer.cpp \ arch/common/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c ##----------------------------------------------------------------------------- @@ -2008,7 +2003,7 @@ else ifeq ($(ARCH),cortexM3_stm32f2) arch/common/drivers/stm32_hardware_rng.cpp \ $(ARCH_INC)/interfaces-impl/portability.cpp \ $(ARCH_INC)/interfaces-impl/gpio_impl.cpp \ - $(ARCH_INC)/interfaces-impl/os_timer.cpp \ + arch/common/core/stm32f2_f4_f7_os_timer.cpp \ arch/common/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c ##----------------------------------------------------------------------------- @@ -2264,6 +2259,7 @@ else ifeq ($(ARCH),cortexM7_stm32f7) $(ARCH_INC)/interfaces-impl/portability.cpp \ $(ARCH_INC)/interfaces-impl/delays.cpp \ $(ARCH_INC)/interfaces-impl/gpio_impl.cpp \ + arch/common/core/stm32f2_f4_f7_os_timer.cpp \ arch/common/CMSIS/Device/ST/STM32F7xx/Source/Templates/system_stm32f7xx.c ##----------------------------------------------------------------------------- @@ -2324,19 +2320,15 @@ else ifeq ($(ARCH),cortexM7_stm32h7) OD := $(PREFIX)objdump SZ := $(PREFIX)size - ## Select appropriate compiler flags for both ASM/C/C++/linker - ifneq ($(GCCMAJOR),4) - ARCHOPTS := -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 - else - ## Fallback to cortex M4 and single precision fp, which is compatible - ARCHOPTS := -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 - endif - AFLAGS_BASE := $(ARCHOPTS) + AFLAGS_BASE := -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 CFLAGS_BASE += -D_ARCH_CORTEXM7_STM32H7 $(CLOCK_FREQ) $(XRAM) $(SRAM_BOOT)\ - $(ARCHOPTS) $(OPT_OPTIMIZATION) -c + -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 \ + $(OPT_OPTIMIZATION) -c CXXFLAGS_BASE += -D_ARCH_CORTEXM7_STM32H7 $(CLOCK_FREQ) $(XRAM) $(SRAM_BOOT)\ - $(ARCHOPTS) $(OPT_EXCEPT) $(OPT_OPTIMIZATION) -c - LFLAGS_BASE := $(ARCHOPTS) -Wl,--gc-sections,-Map,main.map \ + -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 \ + $(OPT_EXCEPT) $(OPT_OPTIMIZATION) -c + LFLAGS_BASE := -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 \ + -Wl,--gc-sections,-Map,main.map \ -Wl,-T$(KPATH)/$(LINKER_SCRIPT) $(OPT_EXCEPT) \ $(OPT_OPTIMIZATION) -nostdlib @@ -2352,6 +2344,7 @@ else ifeq ($(ARCH),cortexM7_stm32h7) $(ARCH_INC)/interfaces-impl/portability.cpp \ $(ARCH_INC)/interfaces-impl/delays.cpp \ $(ARCH_INC)/interfaces-impl/gpio_impl.cpp \ + arch/common/core/stm32f2_f4_f7_os_timer.cpp \ arch/common/CMSIS/Device/ST/STM32H7xx/Source/Templates/system_stm32h7xx.c ##-----------------------------------------------------------------------------