summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJulian Blake Kongslie2021-03-23 21:18:21 -0700
committerJulian Blake Kongslie2021-03-23 21:18:21 -0700
commit39b70c676387bfe06bcc931d3795afc11fd8f137 (patch)
tree00a832c1ce7ece7033c0398a82d6a67b09781e43 /Makefile
parentReplace dibble dabble algorithm with variant that tests after the add. (diff)
downloadtoycpu-39b70c676387bfe06bcc931d3795afc11fd8f137.tar.xz
Changes for Windows-friendly builds.
Diffstat (limited to '')
-rw-r--r--Makefile31
1 files changed, 4 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index 9eff3ef..f532ce2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,38 +1,15 @@
1VERILOG := $(wildcard **.sv) 1SOURCES := $(wildcard **.sv **.cpp)
2HEADERS := $(wildcard **.svh) 2COLLATERAL := $(wildcard **.hex **.svh)
3CPPSRCS := $(wildcard **.cpp)
4COLLATERAL := $(wildcard **.hex)
5 3
6OPTS ?= 4OPTS ?=
7 5
8QUARTUS ?= /opt/quartus-lite/20.1.1.720/
9
10QUARTUS_SH := $(QUARTUS)/quartus/bin/quartus_sh
11
12sim: build/Vtop 6sim: build/Vtop
13 $< 7 $<
14.PHONY: sim 8.PHONY: sim
15 9
16gui: build/toycpu.qpf 10build/Vtop: $(SOURCES) $(COLLATERAL)
17 cd build; $(QUARTUS_SH) --gui toycpu
18.PHONY: gui
19
20qpf: build/toycpu.qpf
21.PHONY: qpf
22
23pof: build/toycpu.pof
24.PHONY: pof
25
26build/Vtop: $(VERILOG) $(HEADERS) $(CPPSRCS) $(COLLATERAL)
27 @mkdir -p build
28 verilator +1800-2017ext+sv -Wall -Wno-BLKSEQ -O3 $(OPTS) --Mdir build --trace --cc --build --exe --top-module top $(VERILOG) $(CPPSRCS)
29
30build/toycpu.pof: build/toycpu.qpf $(VERILOG) $(COLLATERAL)
31 cd build; $(QUARTUS_SH) --flow compile toycpu
32
33build/toycpu.qpf: init.tcl
34 @mkdir -p build 11 @mkdir -p build
35 cd build; $(QUARTUS_SH) -t ../$< $(addprefix $(PWD),$(VERILOG)) 12 verilator +1800-2017ext+sv -Wall -Wno-BLKSEQ -O3 $(OPTS) --Mdir build --trace --cc --build --exe --top-module top $(SOURCES)
36 13
37clean: 14clean:
38 rm -rf build 15 rm -rf build