diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 38 |
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 @@ | |||
| 1 | SOURCES := $(wildcard hdl/**.sv) | ||
| 2 | HEADERS := $(wildcard hdl/**.svh) | ||
| 3 | MEMORIES := $(addprefix build/, $(addsuffix .hex, $(basename $(wildcard mem/**.pal)))) | ||
| 4 | QUARTUS := $(shell find altera tcl -name \*.cdf -o -name \*.sdc -o -name \*.tcl) | ||
| 5 | |||
| 6 | fpga: pdp8.sof | ||
| 7 | quartus_pgm -c 1 -m JTAG -o "P;$<@1" | ||
| 8 | .PHONY: fpga | ||
| 9 | |||
| 10 | term-mem: | ||
| 11 | nios2-terminal --instance 0 | ||
| 12 | .PHONY: term-mem | ||
| 13 | |||
| 14 | term-pdp8: | ||
| 15 | nios2-terminal --instance 1 | ||
| 16 | .PHONY: term-pdp8 | ||
| 17 | |||
| 18 | build/%.hex: build/%.bin | ||
| 19 | p8bin2hex $< > $@ | ||
| 20 | |||
| 21 | build/%.hex: %.bin | ||
| 22 | p8bin2hex $< > $@ | ||
| 23 | |||
| 24 | build/%.bin: %.pal | ||
| 25 | @mkdir -p $(dir $@) | ||
| 26 | palbart $< | ||
| 27 | mv -f $*.bin $*.lst $(dir $@) | ||
| 28 | |||
| 29 | pdp8.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 | |||
| 34 | clean: | ||
| 35 | git clean -dfX | ||
| 36 | .PHONY: clean | ||
| 37 | |||
| 38 | .SECONDARY: | ||
