aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 1a905e8..862d5b1 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,20 @@
BOARD ?= maple
MEMORY_TARGET ?= flash
+# USB ID for DFU upload
+VENDOR_ID := 1EAF
+PRODUCT_ID := 0003
+
+# Guess the MCU based on the BOARD (can be overridden )
+ifeq ($(BOARD), maple)
+ MCU := STM32F103RB
+ PRODUCT_ID := 0003
+endif
+ifeq ($(BOARD), maple-native)
+ MCU := STM32F103ZE
+ PRODUCT_ID := 0003
+endif
+
# Useful paths
SRCROOT := $(dir)
BUILD_PATH = build
@@ -11,8 +25,8 @@ LIBMAPLE_PATH := libmaple
# Useful variables
GLOBAL_CFLAGS := -Os -g -mcpu=cortex-m3 -mthumb -march=armv7-m -nostdlib \
-ffunction-sections -fdata-sections -Wl,--gc-sections \
- -DBOARD_$(BOARD)
-GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall -DBOARD_$(BOARD)
+ -DBOARD_$(BOARD) -DMCU_$(MCU)
+GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall -DBOARD_$(BOARD) -DMCU_$(MCU)
LDDIR := support/ld
@@ -24,10 +38,6 @@ LDFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \
include support/make/build-rules.mk
include support/make/build-templates.mk
-# Maple USB id
-VENDOR_ID := 1EAF
-PRODUCT_ID := 0003
-
# Some target specific things
ifeq ($(MEMORY_TARGET), ram)
VECT_BASE_ADDR := VECT_TAB_RAM