aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-05-09 16:43:27 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-05-09 16:49:08 -0400
commit19ea6ba4ea3f1ecb9830cf4d3e1366513f4f96e3 (patch)
treea43f7e0fb3650ca54f245b750a078a0e8c356504 /Makefile
parent868fb1c273e562a1140abfa948022c9d4f55bccf (diff)
parent1e2e177f6dae62e040c674b617744c73be187062 (diff)
downloadlibrambutan-19ea6ba4ea3f1ecb9830cf4d3e1366513f4f96e3.tar.gz
librambutan-19ea6ba4ea3f1ecb9830cf4d3e1366513f4f96e3.zip
Merge branch 'refactor'
This merges the libmaple refactor work into master. The contents of libmaple proper (/libmaple/) are almost completely incompatible with previous APIs in master. See /docs/source/libmaple/overview.rst for more information on the new design. Wirish incompatibilities are limited to the HardwareTimer class; however, there are several new deprecations, most likely to be removed in 0.1.0.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile67
1 files changed, 45 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index a709696..d0cead4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,17 +9,48 @@ VENDOR_ID := 1EAF
PRODUCT_ID := 0003
# Guess the MCU based on the BOARD (can be overridden )
+# FIXME the error LED config needs to be in wirish/ instead
ifeq ($(BOARD), maple)
MCU := STM32F103RB
PRODUCT_ID := 0003
+ ERROR_LED_PORT := GPIOA
+ ERROR_LED_PIN := 5
+ DENSITY := STM32_MEDIUM_DENSITY
endif
ifeq ($(BOARD), maple_native)
MCU := STM32F103ZE
PRODUCT_ID := 0003
+ ERROR_LED_PORT := GPIOC
+ ERROR_LED_PIN := 15
+ DENSITY := STM32_HIGH_DENSITY
endif
ifeq ($(BOARD), maple_mini)
MCU := STM32F103CB
PRODUCT_ID := 0003
+ ERROR_LED_PORT := GPIOB
+ ERROR_LED_PIN := 1
+ DENSITY := STM32_MEDIUM_DENSITY
+endif
+ifeq ($(BOARD), maple_RET6)
+ MCU := STM32F103RE
+ PRODUCT_ID := 0003
+ ERROR_LED_PORT := GPIOA
+ ERROR_LED_PIN := 5
+ DENSITY := STM32_HIGH_DENSITY
+endif
+
+# Some target specific things
+ifeq ($(MEMORY_TARGET), ram)
+ LDSCRIPT := $(BOARD)/ram.ld
+ VECT_BASE_ADDR := VECT_TAB_RAM
+endif
+ifeq ($(MEMORY_TARGET), flash)
+ LDSCRIPT := $(BOARD)/flash.ld
+ VECT_BASE_ADDR := VECT_TAB_FLASH
+endif
+ifeq ($(MEMORY_TARGET), jtag)
+ LDSCRIPT := $(BOARD)/jtag.ld
+ VECT_BASE_ADDR := VECT_TAB_BASE
endif
# Useful paths
@@ -32,13 +63,19 @@ BUILD_PATH = build
LIBMAPLE_PATH := $(SRCROOT)/libmaple
SUPPORT_PATH := $(SRCROOT)/support
-# Useful variables
-GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -mcpu=cortex-m3 -mthumb -march=armv7-m -nostdlib \
- -ffunction-sections -fdata-sections -Wl,--gc-sections \
- -DBOARD_$(BOARD) -DMCU_$(MCU)
-GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall -DBOARD_$(BOARD) -DMCU_$(MCU)
-GLOBAL_ASFLAGS := -mcpu=cortex-m3 -march=armv7-m -mthumb -DBOARD_$(BOARD) \
- -DMCU_$(MCU) -x assembler-with-cpp
+# Compilation flags.
+# FIXME remove the ERROR_LED config
+GLOBAL_FLAGS := -D$(VECT_BASE_ADDR) \
+ -DBOARD_$(BOARD) -DMCU_$(MCU) \
+ -DERROR_LED_PORT=$(ERROR_LED_PORT) \
+ -DERROR_LED_PIN=$(ERROR_LED_PIN) \
+ -D$(DENSITY)
+GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -mcpu=cortex-m3 -mthumb -march=armv7-m \
+ -nostdlib -ffunction-sections -fdata-sections \
+ -Wl,--gc-sections $(GLOBAL_FLAGS)
+GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall $(GLOBAL_FLAGS)
+GLOBAL_ASFLAGS := -mcpu=cortex-m3 -march=armv7-m -mthumb \
+ -x assembler-with-cpp $(GLOBAL_FLAGS)
LDDIR := $(SUPPORT_PATH)/ld
LDFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \
@@ -49,20 +86,6 @@ LDFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \
include $(SUPPORT_PATH)/make/build-rules.mk
include $(SUPPORT_PATH)/make/build-templates.mk
-# Some target specific things
-ifeq ($(MEMORY_TARGET), ram)
- LDSCRIPT := $(BOARD)/ram.ld
- VECT_BASE_ADDR := VECT_TAB_RAM
-endif
-ifeq ($(MEMORY_TARGET), flash)
- LDSCRIPT := $(BOARD)/flash.ld
- VECT_BASE_ADDR := VECT_TAB_FLASH
-endif
-ifeq ($(MEMORY_TARGET), jtag)
- LDSCRIPT := $(BOARD)/jtag.ld
- VECT_BASE_ADDR := VECT_TAB_BASE
-endif
-
# Set all submodules here
LIBMAPLE_MODULES := $(SRCROOT)/libmaple
LIBMAPLE_MODULES += $(SRCROOT)/wirish
@@ -130,7 +153,7 @@ debug:
cscope:
rm -rf *.cscope
- find . -name '*.[hcs]' -o -name '*.cpp' | xargs cscope -b
+ find . -name '*.[hcS]' -o -name '*.cpp' | xargs cscope -b
tags:
etags `find . -name "*.c" -o -name "*.cpp" -o -name "*.h"`