-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (29 loc) · 1.17 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
default: compile
base_dir = $(abspath .)
src_dir = $(base_dir)/src/main/scala/
gen_dir = $(base_dir)/generated-src
test_dir = $(base_dir)/test_run_dir
SBT = sbt
SBT_FLAGS =
SH = /bin/sh
PYTHON = python3
sbt:
$(SBT) $(SBT_FLAGS)
compile: $(wildcard $(src_dir)/*.scala) $(base_dir)/src/main/scala/Constants.scala
$(SBT) $(SBT_FLAGS) "runMain rself.Compile $(gen_dir)"
test: $(base_dir)/src/test/scala/Constants.scala $(base_dir)/src/main/scala/Constants.scala
$(SBT) test
$(SH) $(base_dir)/scripts/link_latest.sh
test-%: $(base_dir)/src/test/scala/Constants.scala $(base_dir)/src/main/scala/Constants.scala
$(SBT) "testOnly rself.$(patsubst test-%,%,$@)Tests"
$(SH) $(base_dir)/scripts/link_latest.sh $(patsubst test-%,%,$@)Tester
constants:
@echo "make constants is not available for now"
$(base_dir)/src/test/scala/Constants.scala: $(wildcard $(base_dir)/scripts/{testconst,opcodes,utility}.py)
@echo "skip making constants..."
$(base_dir)/src/main/scala/Constants.scala: $(wildcard $(base_dir)/scripts/{constants,opcodes,utility}.py)
@echo "skip making constants..."
clean:
rm -rf $(gen_dir) $(test_dir)
archive:
git archive --format=zip -o riscv-self.zip master