pico430prog/test/rl78/Makefile

25 lines
518 B
Makefile
Raw Normal View History

AS := rl78-elf-gcc
LD := rl78-elf-gcc
OBJCOPY := rl78-elf-objcopy
all: test-rom.bin test-dbg.bin
test.S.o: test.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 "$<" "$@"
clean:
@$(RM) -v test-*.bin test-*.bin.h test-*.elf test-*.elf.map test.S.o
.KEEP: test-rom.elf test-dbg.elf