How do I add an additional Makefile step for a single target?

Viewed 65

I have a Makefile that looks like this, going from .o -> .bin -> .stub for most targets. But I have another more complicated target that I want to generate through .o -> .elf -> .bin -> .stub.

all: simple.stub complex.stub

%.bin:  %.o
    $(Q)echo "  OBJCOPY $@"
    $(Q)$(OBJCOPY) -O binary $< $@

%.stub: %.bin
    $(Q)echo "  HEXDUMP $@"
    $(Q)$(HEXDUMP) -v -e '/2 "0x%04X, "' $< > $@

%.elf: %.o
    arm-none-eabi-gcc $< %@

How do I tell make that .o -> .bin is not a valid transition while building complex.stub, and also prevent it from going through .elf for the others?

1 Answers
Related