Move debug rom link map to the right place.
[riscv-isa-sim.git] / debug_rom / Makefile
1 # Recursive make is bad, but in this case we're cross compiling which is a
2 # pretty unusual use case.
3
4 CC = $(RISCV)/bin/riscv64-unknown-elf-gcc
5 OBJCOPY = $(RISCV)/bin/riscv64-unknown-elf-objcopy
6
7 %.o: %.S
8 $(CC) -I.. -c $<
9
10 debug_rom.h: debug_rom.raw
11 xxd -i $^ | sed "s/^unsigned/static const unsigned/" > $@
12
13 debug_rom.raw: debug_rom
14 $(OBJCOPY) -O binary --only-section .text debug_rom debug_rom.raw
15
16 debug_rom: debug_rom.o link.ld
17 $(CC) -nostdlib -nostartfiles -Tlink.ld -o $@ $^
18
19 clean:
20 rm -f debug_rom debug_rom.o debug_rom.raw debug_rom.h