aboutsummaryrefslogtreecommitdiffstats
path: root/examples/icestick/leds/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'examples/icestick/leds/Makefile')
-rw-r--r--examples/icestick/leds/Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/icestick/leds/Makefile b/examples/icestick/leds/Makefile
new file mode 100644
index 0000000..77a610d
--- /dev/null
+++ b/examples/icestick/leds/Makefile
@@ -0,0 +1,34 @@
+PROJ = blink
+#PROJ = fixed1
+#PROJ = multi1
+#PROJ = multi2
+#PROJ = rotate1
+#PROJ = rotate2
+#PROJ = rotate3
+#PROJ = rotate4
+#PROJ = spin1
+#PROJ = spin2
+
+PIN_DEF = leds.pcf
+DEVICE = hx1k
+
+all: $(PROJ).bin
+
+%.json: leds.vhdl %.vhdl
+ yosys -m ghdl -p 'ghdl $^ -e leds; synth_ice40 -json $@'
+
+%.asc: %.json
+ nextpnr-ice40 --package $(DEVICE) --pcf $(PIN_DEF) --json $< --asc $@
+
+%.bin: %.asc
+ icepack $< $@
+
+prog: $(PROJ).bin
+ iceprog $<
+
+clean:
+ rm -f $(PROJ).json $(PROJ).asc $(PROJ).bin
+
+.SECONDARY:
+
+.PHONY: all prog clean