summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJulian Blake Kongslie2022-02-27 17:21:05 -0800
committerJulian Blake Kongslie2022-02-27 17:21:05 -0800
commit0553c4839c06011bd044f69b4913e5c793fdd2ec (patch)
treed11e69863532621fe1fa55cc7e8aa2a8cfa3b727 /Makefile
downloadmultipdp8-0553c4839c06011bd044f69b4913e5c793fdd2ec.tar.xz
Initial commit.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0250933
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
1SOURCES := $(wildcard hdl/**.sv)
2HEADERS := $(wildcard hdl/**.svh)
3MEMORIES := $(addprefix build/, $(addsuffix .hex, $(basename $(wildcard mem/**.pal))))
4QUARTUS := $(shell find altera tcl -name \*.cdf -o -name \*.sdc -o -name \*.tcl)
5
6fpga: pdp8.sof
7 quartus_pgm -c 1 -m JTAG -o "P;$<@1"
8.PHONY: fpga
9
10term-mem:
11 nios2-terminal --instance 0
12.PHONY: term-mem
13
14term-pdp8:
15 nios2-terminal --instance 1
16.PHONY: term-pdp8
17
18build/%.hex: build/%.bin
19 p8bin2hex $< > $@
20
21build/%.hex: %.bin
22 p8bin2hex $< > $@
23
24build/%.bin: %.pal
25 @mkdir -p $(dir $@)
26 palbart $<
27 mv -f $*.bin $*.lst $(dir $@)
28
29pdp8.sof: $(SOURCES) $(HEADERS) $(MEMORIES) $(QUARTUS)
30 [ ! -e pdp8.qpf ] || quartus_sh -t tcl/clean.tcl
31 quartus_sh -t tcl/init.tcl
32 quartus_sh --flow compile pdp8.qpf
33
34clean:
35 git clean -dfX
36.PHONY: clean
37
38.SECONDARY: