pico430prog/test/rl78g10/Makefile

28 lines
596 B
Makefile
Raw Normal View History

AS := rl78-elf-gcc
LD := rl78-elf-gcc
OBJCOPY := rl78-elf-objcopy
all: test-rom.srec test-dbg.srec test-rom.bin test-dbg.bin
2022-04-21 20:30:45 +00:00
test.S.o: test.S hw.S
$(AS) -c -o "$@" "$<"
romhdr.S.o: romhdr.S
$(AS) -c -o "$@" "$<"
OBJFILES := test.S.o romhdr.S.o
test-%.elf test-%.elf.map: $(OBJFILES) link-%.ld
$(LD) -o "$@" $(OBJFILES) -T link-$*.ld -Wl,-Map="$@.map" -nostdlib -nostartfiles
test-%.bin: test-%.elf
$(OBJCOPY) -O binary "$<" "$@"
%.srec: %.elf
$(OBJCOPY) -O srec "$<" "$@"
clean:
@$(RM) -v test-*.bin test-*.bin.h test-*.elf test-*.elf.map test.S.o
.KEEP: test-rom.elf test-dbg.elf