aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32
diff options
context:
space:
mode:
authorGareth McMullin2011-03-14 16:45:17 +1300
committerGareth McMullin2011-03-14 16:45:17 +1300
commit7faea389e8ba002e1c3c7604eaaa916fad583179 (patch)
treec893d2c6cdc918ca16dd697d6923bff806e26b31 /examples/stm32
parent95286a22f0bb6a822b4d2a62611bcc7b2c2daa8b (diff)
Added dependency generation. Abort loops on error.
Diffstat (limited to 'examples/stm32')
-rw-r--r--examples/stm32/Makefile.include6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/stm32/Makefile.include b/examples/stm32/Makefile.include
index 3eb3d35..cdaff1d 100644
--- a/examples/stm32/Makefile.include
+++ b/examples/stm32/Makefile.include
@@ -28,7 +28,7 @@ OBJDUMP = $(PREFIX)-objdump
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
TOOLCHAIN_DIR = ../../../..
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
- -fno-common -mcpu=cortex-m3 -mthumb -msoft-float
+ -fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD
LDSCRIPT = $(BINARY).ld
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32 \
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
@@ -75,7 +75,7 @@ flash: $(BINARY).flash
@#printf " OBJDUMP $(*).list\n"
$(Q)$(OBJDUMP) -S $(*).elf > $(*).list
-%.elf: $(OBJS) $(LDSCRIPT)
+%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32/libopencm3_stm32.a
@#printf " LD $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32 $(LDFLAGS)
@@ -118,3 +118,5 @@ endif
.PHONY: images clean
+-include $(OBJS:.o=.d)
+