Added dependency generation. Abort loops on error.

This commit is contained in:
Gareth McMullin
2011-03-14 16:45:17 +13:00
parent 95286a22f0
commit 7faea389e8
7 changed files with 26 additions and 15 deletions

View File

@@ -28,7 +28,7 @@ OBJDUMP = $(PREFIX)-objdump
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
TOOLCHAIN_DIR = ../../../..
CFLAGS += -O0 -g3 -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
-mcpu=cortex-m3 -mthumb
-mcpu=cortex-m3 -mthumb -MD
LDSCRIPT = $(BINARY).ld
LDFLAGS += -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/lm3s \
-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/lm3s/libopencm3_lm3s.a
@#printf " LD $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(LD) $(LDFLAGS) -o $(*).elf $(OBJS) -lopencm3_lm3s
@@ -119,3 +119,5 @@ endif
.PHONY: images clean
-include $(OBJS:.o=.d)