forked from lmcad-unicamp/riscv-sbt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (77 loc) · 2.27 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
TOPDIR ?= $(shell pwd)
BUILDPKG_PY := $(TOPDIR)/scripts/auto/build_pkg.py
all: riscv-gnu-toolchain-newlib riscv-gnu-toolchain-linux sbt spike qemu
riscv-gnu-toolchain-newlib:
@$(BUILDPKG_PY) $@ $(MAKE_OPTS)
riscv-gnu-toolchain-linux:
@$(BUILDPKG_PY) $@ $(MAKE_OPTS)
riscv-gnu-toolchain-newlib-gcc7:
@$(BUILDPKG_PY) $@ $(MAKE_OPTS)
riscv-gnu-toolchain-linux-gcc7:
@$(BUILDPKG_PY) $@ $(MAKE_OPTS)
llvm:
@$(BUILDPKG_PY) $@ $(MAKE_OPTS)
llvm-gcc7:
@$(BUILDPKG_PY) $@ $(MAKE_OPTS)
spike:
@$(BUILDPKG_PY) $(MAKE_OPTS) riscv-isa-sim
@$(BUILDPKG_PY) $(MAKE_OPTS) riscv-pk-32
qemu:
@$(BUILDPKG_PY) $(MAKE_OPTS) qemu-user
.PHONY: sbt
sbt:
@$(BUILDPKG_PY) $(MAKE_OPTS) $@
sbt-gcc7:
@$(BUILDPKG_PY) $(MAKE_OPTS) $@
sbt-force:
@$(BUILDPKG_PY) $(MAKE_OPTS) -f sbt
sbt-clean:
@$(BUILDPKG_PY) $(MAKE_OPTS) --clean sbt
### docker image
docker-img:
cd docker && \
export TOPDIR=$(TOPDIR) PYTHONPATH=$(TOPDIR)/scripts && \
./build.py --get-srcs && \
./build.py --build all
DOCKER_SET := cd docker && export TOPDIR=$(TOPDIR) PYTHONPATH=$(TOPDIR)/scripts
docker-mibuild:
$(DOCKER_SET) && ./build.py --mibuild
docker-mitest:
$(DOCKER_SET) && ./build.py --mitest
docker-mirun:
$(DOCKER_SET) && ./build.py --mirun
docker-rdev:
$(DOCKER_SET) && ./build.py --rdev
docker-xdev:
$(DOCKER_SET) && ./build.py --xdev
docker-rgcc7:
$(DOCKER_SET) && ./build.py --bind --rgcc7
docker-xgcc7:
$(DOCKER_SET) && ./build.py --bind --xgcc7
###
clean:
rm -rf $(TOPDIR)/build
rm -rf $(TOPDIR)/toolchain/*
lc:
cat $(TOPDIR)/sbt/*.h $(TOPDIR)/sbt/*.cpp $(TOPDIR)/sbt/*.s | wc -l
lc-py:
cat $(TOPDIR)/scripts/auto/*.py \
$(TOPDIR)/test/sbt/genmake.py \
$(TOPDIR)/mibench/genmake.py \
$(TOPDIR)/docker/build.py \
| wc -l
almost-alltests:
cd $(TOPDIR)/test/sbt && ./genmake.py && make clean almost-alltests
alltests:
cd $(TOPDIR)/test/sbt && ./genmake.py && make clean alltests
### dbg ###
TEST := crc32
TEST_DIR := telecomm/CRC32
TEST_FILE := telecomm/adpcm/data/large.pcm
.PHONY: test
test:
cd $(TOPDIR)/mibench && ./genmake.py
make -C $(TOPDIR)/mibench $(TEST)-clean
make -C $(TOPDIR)/mibench rv32-$(TEST) x86-$(TEST) rv32-x86-$(TEST)-globals rv32-x86-$(TEST)-locals
$(TOPDIR)/scripts/auto/measure.py $(TOPDIR)/build/mibench/$(TEST_DIR) $(TEST) -n 1 \
--args $(TOPDIR)/mibench/$(TEST_FILE)