From 144254b4616b3b539adb8ec188a0652bc3eefe92 Mon Sep 17 00:00:00 2001 From: Devan Lai Date: Mon, 31 Dec 2018 11:44:06 -0800 Subject: [PATCH] Build just the libopencm3 targets we need --- src/rules.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rules.mk b/src/rules.mk index 3e3c728..fda45db 100644 --- a/src/rules.mk +++ b/src/rules.mk @@ -30,6 +30,7 @@ endif # Target Architecture flags ifeq ($(ARCH),STM32F0) LIBNAME = opencm3_stm32f0 + LOCM3_TARGET= stm32/f0 DEFS += -DSTM32F0 FP_FLAGS ?= -msoft-float ARCH_FLAGS = -mthumb -mcpu=cortex-m0 $(FP_FLAGS) @@ -37,6 +38,7 @@ ifeq ($(ARCH),STM32F0) endif ifeq ($(ARCH),STM32F1) LIBNAME = opencm3_stm32f1 + LOCM3_TARGET= stm32/f1 DEFS += -DSTM32F1 FP_FLAGS ?= -msoft-float ARCH_FLAGS = -mthumb -mcpu=cortex-m3 $(FP_FLAGS) -mfix-cortex-m3-ldrd @@ -44,6 +46,7 @@ ifeq ($(ARCH),STM32F1) endif LIBNAME ?= opencm3_stm32f0 +LOCM3_TARGET ?= stm32/f0 DEFS ?= -DSTM32F0 FP_FLAGS ?= -msoft-float ARCH_FLAGS ?= -mthumb -mcpu=cortex-m0 $(FP_FLAGS) @@ -156,7 +159,7 @@ $(OPENCM3_DIR)/Makefile: $(Q)git submodule update --init $(OPENCM3_DIR) $(LIB_DIR)/lib$(LIBNAME).a: $(OPENCM3_DIR)/Makefile - $(Q)$(MAKE) -C $(OPENCM3_DIR) + $(Q)$(MAKE) -C $(OPENCM3_DIR) TARGETS=$(LOCM3_TARGET) locm3: $(LIB_DIR)/lib$(LIBNAME).a