| 1 |
#======================================================================= |
| 2 |
# Makefile for riscv-tests/isa |
| 3 |
#----------------------------------------------------------------------- |
| 4 |
|
| 5 |
XLEN ?= 64 |
| 6 |
|
| 7 |
src_dir := ../. |
| 8 |
|
| 9 |
isa_dir := ../../riscv-tests/isa |
| 10 |
|
| 11 |
self_test := . |
| 12 |
self_tests_t := $(wildcard tests/*.S) |
| 13 |
self_tests := $(self_tests_t:tests/%=%) |
| 14 |
elf_tests := $(self_tests:.S=.elf) |
| 15 |
|
| 16 |
default: clean self |
| 17 |
|
| 18 |
#-------------------------------------------------------------------- |
| 19 |
# Build rules |
| 20 |
#-------------------------------------------------------------------- |
| 21 |
|
| 22 |
include ../toolchain_setup |
| 23 |
|
| 24 |
vpath %.S $(self_test) |
| 25 |
|
| 26 |
#------------------------------------------------------------ |
| 27 |
# Build assembly tests |
| 28 |
|
| 29 |
self: $(elf_tests) |
| 30 |
|
| 31 |
%32.elf: tests/%32.S |
| 32 |
$(RISCV_COMPILER) $(MARCH_OPTS_32) $(RISCV_COMPILER_OPTS) -I$(src_dir)/../env/p -I$(isa_dir)/macros/scalar -T$(src_dir)/../env/p/link.ld $< -o $(self_test)/elf/$*32 |
| 33 |
|
| 34 |
%64.elf: tests/%64.S |
| 35 |
$(RISCV_COMPILER) $(MARCH_OPTS_64) $(RISCV_COMPILER_OPTS) -I$(src_dir)/../env/p -I$(isa_dir)/macros/scalar -T$(src_dir)/../env/p/link.ld $< -o $(self_test)/elf/$*64 |
| 36 |
#------------------------------------------------------------ |
| 37 |
# Clean up |
| 38 |
|
| 39 |
clean: |
| 40 |
rm -fr elf/* |