1
0
Files
bootrom
chisel3
csrc
emulator
firrtl
hardfloat
macros
project
regression
riscv-tools
scripts
debug_rom
Makefile
debug_rom.S
link.ld
.gitignore
Makefile
RocketSim.cfg
RocketSim.py
RocketSim32.py
RocketSim64.py
authors
check_cache_trace.py
check_comparator_trace.py
copyright-file
modify-copyright
toaxe.py
tracegen+check.sh
tracegen.py
tracestats.py
vlsi_mem_gen
vlsi_rom_gen
src
torture
vsim
vsrc
.gitignore
.gitmodules
.travis.yml
LICENSE.Berkeley
LICENSE.SiFive
LICENSE.jtag
Makefrag
README.md
README_TRAVIS.md
build.sbt
sbt-launch.jar
rocket-chip/scripts/debug_rom/Makefile

32 lines
978 B
Makefile

# See LICENSE.SiFive for license details
# Recursive make is bad, but in this case we're cross compiling which is a
# pretty unusual use case.
CC = $(RISCV)/bin/riscv64-unknown-elf-gcc
OBJCOPY = $(RISCV)/bin/riscv64-unknown-elf-objcopy
COMPILE = $(CC) -nostdlib -nostartfiles -I$(RISCV)/include/ -Tlink.ld
ELFS = debug_rom
DEPS = debug_rom.S link.ld
all: $(patsubst %,%.h,$(ELFS))
publish: debug_rom.scala
mv $< ../../src/main/scala/uncore/devices/debug/DebugRomContents.scala
%.scala: %.raw
xxd -i $^ | sed -e "s/^unsigned char debug_rom_raw\[\] = {/\/\/ This file was auto-generated by 'make publish' in debug\/ directory.\n\npackage uncore.devices\n\nobject DebugRomContents {\n\n def apply() : Array[Byte] = { Array (/" \
-e "s/};/ ).map(_.toByte) }\n\n}/" \
-e "s/^unsigned int debug_rom_raw_len.*//" > $@
%.raw: %
$(OBJCOPY) -O binary --only-section .text $^ $@
debug_rom: $(DEPS)
$(COMPILE) -o $@ $^
clean:
rm -f $(ELFS) debug_rom*.raw debug_rom*.h