diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-08-05 14:39:34 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-08-05 14:40:03 -0400 |
commit | 7f964c5fc1eae683aa161a59be6565ba03eb10a3 (patch) | |
tree | f71b12c933db56f68f3b0b3dda06c4479a84f748 /support/make | |
parent | 53723b0c90e7a9a8461e57aa2dfffcbca248528f (diff) | |
download | librambutan-7f964c5fc1eae683aa161a59be6565ba03eb10a3.tar.gz librambutan-7f964c5fc1eae683aa161a59be6565ba03eb10a3.zip |
Makefile: Don't assume Cortex M3.
Instead, derive -march and -mcpu from the target MCU in
target-config.mk. Also (on STM32F4) add the necessary floating point
flags. The CodeSourcery toolchains don't support these, so we'll need
to prepare alternative toolchains when F4 support is official.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'support/make')
-rw-r--r-- | support/make/target-config.mk | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/support/make/target-config.mk b/support/make/target-config.mk index b79c720..0e3a2c2 100644 --- a/support/make/target-config.mk +++ b/support/make/target-config.mk @@ -32,11 +32,21 @@ ifeq ($(MCU_SERIES), stm32f1) LD_SERIES_PATH := $(LD_SERIES_PATH)/$(MCU_F1_LINE) endif +ifeq ($(MCU_SERIES), stm32f1) +TARGET_FLAGS += -mcpu=cortex-m3 -march=armv7-m +endif +ifeq ($(MCU_SERIES), stm32f2) +TARGET_FLAGS += -mcpu=cortex-m3 -march=armv7-m +endif +ifeq ($(MCU_SERIES), stm32f4) +TARGET_FLAGS += -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 +endif + TARGET_LDFLAGS += -Xlinker -T$(LD_SCRIPT_PATH) \ -L $(LD_SERIES_PATH) \ -L $(LD_MEM_PATH) \ -L $(LDDIR) -TARGET_FLAGS += -DBOARD_$(BOARD) -DMCU_$(MCU) \ +TARGET_FLAGS += -mthumb -DBOARD_$(BOARD) -DMCU_$(MCU) \ -DERROR_LED_PORT=$(ERROR_LED_PORT) \ -DERROR_LED_PIN=$(ERROR_LED_PIN) \ -D$(VECT_BASE_ADDR) |