diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-06-22 23:29:16 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-06-22 23:29:16 -0700 |
commit | 8861244f8d6ff65a6c1b69f937b2c9d9af5527b9 (patch) | |
tree | 9b7401f5333f655bf7b2394901e4942742804d98 /debug_rom/Makefile | |
parent | 965571945c16d691962211b3602168a17be859ee (diff) | |
download | spike-8861244f8d6ff65a6c1b69f937b2c9d9af5527b9.zip spike-8861244f8d6ff65a6c1b69f937b2c9d9af5527b9.tar.gz spike-8861244f8d6ff65a6c1b69f937b2c9d9af5527b9.tar.bz2 |
Parameterize debug ROM contents on XLEN
Diffstat (limited to 'debug_rom/Makefile')
-rw-r--r-- | debug_rom/Makefile | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/debug_rom/Makefile b/debug_rom/Makefile index ed4cb93..b72f37d 100644 --- a/debug_rom/Makefile +++ b/debug_rom/Makefile @@ -4,17 +4,27 @@ CC = $(RISCV)/bin/riscv64-unknown-elf-gcc OBJCOPY = $(RISCV)/bin/riscv64-unknown-elf-objcopy -%.o: %.S - $(CC) -I.. -c $< +COMPILE = $(CC) -nostdlib -nostartfiles -I.. -Tlink.ld -debug_rom.h: debug_rom.raw +ELFS = debug_rom debug_rom32 debug_rom64 +DEPS = debug_rom.S link.ld + +all: $(patsubst %,%.h,$(ELFS)) + +%.h: %.raw xxd -i $^ | sed "s/^unsigned/static const unsigned/" > $@ -debug_rom.raw: debug_rom - $(OBJCOPY) -O binary --only-section .text debug_rom debug_rom.raw +%.raw: % + $(OBJCOPY) -O binary --only-section .text $^ $@ + +debug_rom: $(DEPS) + $(COMPILE) -DRV32 -DRV64 -o $@ $^ + +debug_rom32: $(DEPS) + $(COMPILE) -DRV32 -DDEBUG_RAM_SIZE=28 -o $@ $^ -debug_rom: debug_rom.o link.ld - $(CC) -nostdlib -nostartfiles -Tlink.ld -o $@ $^ +debug_rom64: $(DEPS) + $(COMPILE) -DRV64 -o $@ $^ clean: - rm -f debug_rom debug_rom.o debug_rom.raw debug_rom.h + rm -f $(ELFS) debug_rom*.raw debug_rom*.h |