summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3467cfb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
1SOURCES := $(wildcard hdl/**.sv)
2QUARTUS := $(shell find altera tcl -name \*.cdf -o -name \*.sdc -o -name \*.tcl)
3
4fpga: memctrl.sof
5 quartus_pgm -c 1 -m JTAG -o "P;$<@1"
6 nios2-terminal
7.PHONY: fpga
8
9build/p8bin2hex: tool/p8bin2hex.c
10 @mkdir -p build
11 gcc -Wall -Werror -o $@ $<
12
13build/%.hex: build/%.bin build/p8bin2hex
14 build/p8bin2hex $< > $@
15
16build/%.hex: %.bin build/p8bin2hex
17 build/p8bin2hex $< > $@
18
19build/%.bin: %.pal
20 @mkdir -p $(dir $@)
21 palbart $<
22 mv -f $*.bin $*.lst $(dir $@)
23
24memctrl.sof: $(SOURCES) $(QUARTUS)
25 [ ! -e memctrl.qpf ] || quartus_sh -t tcl/clean.tcl
26 quartus_sh -t tcl/init.tcl
27 quartus_sh --flow compile memctrl.qpf
28
29clean:
30 git clean -dfX
31.PHONY: clean
32
33.SECONDARY: