CC2538: Add a Makefile rule to generate a final assembly listing.

This commit is contained in:
Ian Martin 2014-04-02 18:17:49 -04:00
parent d387f27a65
commit 56d0dfdc7a

View File

@ -3,6 +3,7 @@ CPP = arm-none-eabi-cpp
LD = arm-none-eabi-gcc LD = arm-none-eabi-gcc
AR = arm-none-eabi-ar AR = arm-none-eabi-ar
OBJCOPY = arm-none-eabi-objcopy OBJCOPY = arm-none-eabi-objcopy
OBJDUMP = arm-none-eabi-objdump
NM = arm-none-eabi-nm NM = arm-none-eabi-nm
ifndef SOURCE_LDSCRIPT ifndef SOURCE_LDSCRIPT
@ -19,6 +20,7 @@ LDFLAGS += -T $(LDSCRIPT)
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch
OBJCOPY_FLAGS += -O binary --gap-fill 0xff OBJCOPY_FLAGS += -O binary --gap-fill 0xff
OBJDUMP_FLAGS += --disassemble --source --disassembler-options=force-thumb
### Are we building with code size optimisations? ### Are we building with code size optimisations?
ifeq ($(SMALL),1) ifeq ($(SMALL),1)
@ -82,6 +84,9 @@ CUSTOM_RULE_LINK=1
%.bin: %.elf %.bin: %.elf
$(OBJCOPY) $(OBJCOPY_FLAGS) $< $@ $(OBJCOPY) $(OBJCOPY_FLAGS) $< $@
%.lst: %.elf
$(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@
### We don't really need the .hex and .bin for the .$(TARGET) but let's make ### We don't really need the .hex and .bin for the .$(TARGET) but let's make
### sure they get built ### sure they get built
%.$(TARGET): %.elf %.hex %.bin %.$(TARGET): %.elf %.hex %.bin