From d895277b5f59a03702ca8613f4c170ab2ee75729 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Thu, 6 Nov 2014 20:56:45 +0000 Subject: [PATCH] allow to build multiple targets --- platforms/stm32-f103rb-nucleo/Makefile | 4 ++-- .../stm32-f103rb-nucleo/libopencm3.rules.mk | 22 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/platforms/stm32-f103rb-nucleo/Makefile b/platforms/stm32-f103rb-nucleo/Makefile index e2a0c08e4..f35eb1424 100644 --- a/platforms/stm32-f103rb-nucleo/Makefile +++ b/platforms/stm32-f103rb-nucleo/Makefile @@ -3,7 +3,7 @@ # # BINARY=led_counter -BINARY=spp_and_le_counter +# BINARY=spp_and_le_counter OPENCM3_DIR = libopencm3 LDSCRIPT = stm32f1-nucleo.ld @@ -52,7 +52,7 @@ OBJS += $(CORE_OBJ) $(COMMON_OBJ) $(BLE_OBJ) CFLAGS = -I. -I$(BTSTACK_ROOT)/include -I$(BTSTACK_ROOT)/src -I$(BTSTACK_ROOT)/ble -I$(BTSTACK_ROOT)/chipset-cc256x -examples: libopencm3/lib/libopencm3_stm32f1.a spp_and_le_counter.h $(BINARY).elf +examples: libopencm3/lib/libopencm3_stm32f1.a spp_and_le_counter.h spp_and_le_counter.elf include libopencm3.stm32f1.mk diff --git a/platforms/stm32-f103rb-nucleo/libopencm3.rules.mk b/platforms/stm32-f103rb-nucleo/libopencm3.rules.mk index c27da1d34..9568d30cc 100644 --- a/platforms/stm32-f103rb-nucleo/libopencm3.rules.mk +++ b/platforms/stm32-f103rb-nucleo/libopencm3.rules.mk @@ -47,9 +47,9 @@ STYLECHECKFILES := $(shell find . -name '*.[ch]') ############################################################################### # Source files -LDSCRIPT ?= $(BINARY).ld +# LDSCRIPT ?= $(BINARY).ld -OBJS += $(BINARY).o +# OBJS += $(BINARY).o ifeq ($(strip $(OPENCM3_DIR)),) @@ -123,13 +123,13 @@ LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group .SECONDEXPANSION: .SECONDARY: -all: elf - -elf: $(BINARY).elf -bin: $(BINARY).bin -hex: $(BINARY).hex -srec: $(BINARY).srec -list: $(BINARY).list +# all: elf +# +# elf: $(BINARY).elf +# bin: $(BINARY).bin +# hex: $(BINARY).hex +# srec: $(BINARY).srec +# list: $(BINARY).list images: $(BINARY).images flash: $(BINARY).flash @@ -153,9 +153,9 @@ flash: $(BINARY).flash @#printf " OBJDUMP $(*).list\n" $(Q)$(OBJDUMP) -S $(*).elf > $(*).list -%.elf %.map: $(OBJS) $(LDSCRIPT) $(LIB_DIR)/lib$(LIBNAME).a +%.elf %.map: $(OBJS) %.o $(LDSCRIPT) $(LIB_DIR)/lib$(LIBNAME).a @#printf " LD $(*).elf\n" - $(Q)$(LD) $(LDFLAGS) $(ARCH_FLAGS) $(OBJS) $(LDLIBS) -o $(*).elf + $(Q)$(LD) $(LDFLAGS) $(ARCH_FLAGS) $(OBJS) $(*).o $(LDLIBS) -o $(*).elf %.o: %.c @#printf " CC $(*).c\n"