Abstract register read mostly working.
[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 COMPILE = $(CC) -nostdlib -nostartfiles -I.. -Tlink.ld
8
9 ELFS = debug_rom debug_rom32 debug_rom64
10 DEPS = debug_rom.S link.ld
11
12 all: $(patsubst %,%.h,$(ELFS))
13
14 %.h: %.raw
15 xxd -i $^ | sed "s/^unsigned/static const unsigned/" > $@
16
17 %.raw: %
18 $(OBJCOPY) -O binary --only-section .text $^ $@
19
20 debug_rom: $(DEPS)
21 $(COMPILE) -DRV32 -DRV64 -o $@ $^
22
23 debug_rom32: $(DEPS)
24 $(COMPILE) -DRV32 -DDEBUG_RAM_SIZE=28 -o $@ $^
25
26 debug_rom64: $(DEPS)
27 $(COMPILE) -DRV64 -o $@ $^
28
29 clean:
30 rm -f $(ELFS) debug_rom*.raw debug_rom*.h