aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPiotr Esden-Tempski <piotr@esden.net>2015-12-28 16:53:48 +0100
committerPiotr Esden-Tempski <piotr@esden.net>2015-12-28 16:53:48 +0100
commitde33788bf9b835877edd1511e070adf98549dcd6 (patch)
tree866416922696340e6af7805236e96ccdc33639b8 /examples
parent7852514c2cde208da87b62777b2c5e482092f50d (diff)
downloadicestorm-de33788bf9b835877edd1511e070adf98549dcd6.tar.gz
icestorm-de33788bf9b835877edd1511e070adf98549dcd6.tar.bz2
icestorm-de33788bf9b835877edd1511e070adf98549dcd6.zip
[examples] Made the example Makefiles easier to reuse.
Diffstat (limited to 'examples')
-rw-r--r--examples/hx8kboard/Makefile22
-rw-r--r--examples/icestick/Makefile22
2 files changed, 26 insertions, 18 deletions
diff --git a/examples/hx8kboard/Makefile b/examples/hx8kboard/Makefile
index 551de32..58be467 100644
--- a/examples/hx8kboard/Makefile
+++ b/examples/hx8kboard/Makefile
@@ -1,18 +1,22 @@
-all: example.bin
+PROJ = example
+PIN_DEF = hx8kboard.pcf
+DEVICE = 8k
-example.blif: example.v
- yosys -p 'synth_ice40 -top top -blif example.blif' example.v
+all: $(PROJ).bin
-example.txt: example.blif hx8kboard.pcf
- arachne-pnr -d 8k -o example.txt -p hx8kboard.pcf example.blif
+%.blif: %.v
+ yosys -p 'synth_ice40 -top top -blif $@' $<
-example.bin: example.txt
- icepack example.txt example.bin
+%.txt: $(PIN_DEF) %.blif
+ arachne-pnr -d $(DEVICE) -o $@ -p $^
+
+%.bin: %.txt
+ icepack $< $@
prog:
- iceprog example.bin
+ iceprog $(PROJ).bin
clean:
- rm -f example.blif example.txt example.bin
+ rm -f *.blif *.txt *.bin
.PHONY: all prog clean
diff --git a/examples/icestick/Makefile b/examples/icestick/Makefile
index 295642a..4c56295 100644
--- a/examples/icestick/Makefile
+++ b/examples/icestick/Makefile
@@ -1,18 +1,22 @@
-all: example.bin
+PROJ = example
+PIN_DEF = icestick.pcf
+DEVICE = 1k
-example.blif: example.v
- yosys -p 'synth_ice40 -top top -blif example.blif' example.v
+all: $(PROJ).bin
-example.txt: example.blif icestick.pcf
- arachne-pnr -d 1k -o example.txt -p icestick.pcf example.blif
+%.blif: %.v
+ yosys -p 'synth_ice40 -top top -blif $@' $<
-example.bin: example.txt
- icepack example.txt example.bin
+%.txt: $(PIN_DEF) %.blif
+ arachne-pnr -d $(DEVICE) -o $@ -p $^
+
+%.bin: %.txt
+ icepack $< $@
prog:
- iceprog example.bin
+ iceprog $(PROJ).bin
clean:
- rm -f example.blif example.txt example.bin
+ rm -f *.blif *.txt *.bin
.PHONY: all prog clean