|
|
@ -27,11 +27,11 @@ OBJDUMP = $(PREFIX)-objdump |
|
|
|
GDB = $(PREFIX)-gdb |
|
|
|
# Uncomment this line if you want to use the installed (not local) library.
|
|
|
|
#TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
|
|
|
TOOLCHAIN_DIR = ../../../.. |
|
|
|
TOOLCHAIN_DIR = ../../../../.. |
|
|
|
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
|
|
|
|
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD -DSTM32F1 |
|
|
|
LDSCRIPT = $(BINARY).ld |
|
|
|
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32f1 \
|
|
|
|
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32/f1 \
|
|
|
|
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
|
|
|
|
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float |
|
|
|
OBJS += $(BINARY).o |
|
|
@ -79,7 +79,7 @@ flash: $(BINARY).flash |
|
|
|
@#printf " OBJDUMP $(*).list\n" |
|
|
|
$(Q)$(OBJDUMP) -S $(*).elf > $(*).list |
|
|
|
|
|
|
|
%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32f1/libopencm3_stm32f1.a |
|
|
|
%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32/f1/libopencm3_stm32f1.a |
|
|
|
@#printf " LD $(subst $(shell pwd)/,,$(@))\n" |
|
|
|
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32f1 $(LDFLAGS) |
|
|
|
|