Set impebreak.
[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
10 DEPS = debug_rom.S link.ld debug_rom_defines.h
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) -o $@ $^
22
23 clean:
24 rm -f $(ELFS) debug_rom*.raw debug_rom.h