aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2010-08-31 15:21:09 -0400
committerbnewbold <bnewbold@robocracy.org>2010-08-31 15:21:09 -0400
commit695f0dc4baa1bf682eec0226dc5632a9200174f1 (patch)
tree9566cdb8e513ce9504e8638403170b86870b2eda /Makefile
parent12c351d0561d1f9d4e017bbd3f847906f93b0df7 (diff)
downloadlibrambutan-695f0dc4baa1bf682eec0226dc5632a9200174f1.tar.gz
librambutan-695f0dc4baa1bf682eec0226dc5632a9200174f1.zip
MCU-specific, not BOARD-specific
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