From 0553c4839c06011bd044f69b4913e5c793fdd2ec Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 27 Feb 2022 17:21:05 -0800 Subject: Initial commit. --- Makefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0250933 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +SOURCES := $(wildcard hdl/**.sv) +HEADERS := $(wildcard hdl/**.svh) +MEMORIES := $(addprefix build/, $(addsuffix .hex, $(basename $(wildcard mem/**.pal)))) +QUARTUS := $(shell find altera tcl -name \*.cdf -o -name \*.sdc -o -name \*.tcl) + +fpga: pdp8.sof + quartus_pgm -c 1 -m JTAG -o "P;$<@1" +.PHONY: fpga + +term-mem: + nios2-terminal --instance 0 +.PHONY: term-mem + +term-pdp8: + nios2-terminal --instance 1 +.PHONY: term-pdp8 + +build/%.hex: build/%.bin + p8bin2hex $< > $@ + +build/%.hex: %.bin + p8bin2hex $< > $@ + +build/%.bin: %.pal + @mkdir -p $(dir $@) + palbart $< + mv -f $*.bin $*.lst $(dir $@) + +pdp8.sof: $(SOURCES) $(HEADERS) $(MEMORIES) $(QUARTUS) + [ ! -e pdp8.qpf ] || quartus_sh -t tcl/clean.tcl + quartus_sh -t tcl/init.tcl + quartus_sh --flow compile pdp8.qpf + +clean: + git clean -dfX +.PHONY: clean + +.SECONDARY: -- cgit v1.2.3