Skip to content

Commit

Permalink
Build just the libopencm3 targets we need
Browse files Browse the repository at this point in the history
  • Loading branch information
devanlai committed Dec 31, 2018
1 parent 6e96c1b commit 144254b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,23 @@ 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)
OOCD_BOARD ?= target/stm32f0x.cfg
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
OOCD_BOARD ?= target/stm32f1x.cfg
endif

LIBNAME ?= opencm3_stm32f0
LOCM3_TARGET ?= stm32/f0
DEFS ?= -DSTM32F0
FP_FLAGS ?= -msoft-float
ARCH_FLAGS ?= -mthumb -mcpu=cortex-m0 $(FP_FLAGS)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 144254b

Please sign in to comment.