/
Makefile
61 lines (40 loc) · 1.43 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#=======================================================================
# Makefile for riscv-tests/isa
#-----------------------------------------------------------------------
act_dir := .
src_dir := $(act_dir)/src
work_dir := $(ROOTDIR)/work
work_dir_isa := $(work_dir)/$(RISCV_ISA)
include $(act_dir)/Makefrag
default: all
#--------------------------------------------------------------------
# Build rules
#--------------------------------------------------------------------
vpath %.S $(act_dir)
INCLUDE=$(TARGETDIR)/$(RISCV_TARGET)/device/$(RISCV_DEVICE)/Makefile.include
ifeq ($(wildcard $(INCLUDE)),)
$(error Cannot find '$(INCLUDE)`. Check that RISCV_TARGET and RISCV_DEVICE are set correctly.)
endif
-include $(INCLUDE)
#------------------------------------------------------------
# Build and run assembly tests
%.out64: %.elf
$(RUN_TARGET)
define compile_template
$$($(1)_tests): %.elf: $(src_dir)/%.S
@mkdir -p $(work_dir_isa)/$$(@D)
$(COMPILE_TARGET)
$(1)_tests += $$($(1)_p_tests)
.PHONY: $(1)
tests += $$($(1)_tests)
endef
$(eval $(call compile_template,rv64im,-march=rv64im -mabi=lp64))
tests64_out = $(patsubst %.elf,%.out64,$(target64_tests))
run: $(tests64_out)
#------------------------------------------------------------
# Default
all: $(tests_dump)
#------------------------------------------------------------
# Clean up
clean:
rm -rf $(work_dir)