forked from ucb-bar/chisel-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
suffix.mk
33 lines (21 loc) · 802 Bytes
/
suffix.mk
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
SBT := sbt
CHISEL_FLAGS :=
top_srcdir ?= ..
srcdir ?= .
executables := $(filter-out tutorial examples Image Sound,\
$(notdir $(basename $(wildcard $(srcdir)/*.scala))))
tut_outs := $(addsuffix .out, $(executables))
all: emulator verilog
check: test-solutions.xml
clean:
-rm -f out.im24 out.wav *.h *.cpp *.o *.out *.v $(executables)
-rm -rf project/target/ target/
emulator: $(tut_outs)
verilog: $(addsuffix .v, $(executables))
test-solutions.xml: $(tut_outs)
$(top_srcdir)/sbt/check $(tut_outs) > $@
%.out: %.scala
$(SBT) "run $(notdir $(basename $<)) --genHarness --compile --test --backend c $(CHISEL_FLAGS)" | tee $@
%.v: %.scala
$(SBT) "run $(notdir $(basename $<)) --genHarness --backend v $(CHISEL_FLAGS)"
.PHONY: all check clean emulator verilog