aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-12-30 19:00:54 +0100
committerClifford Wolf <clifford@clifford.at>2015-12-30 19:00:54 +0100
commit51067aff52eb958fb47b179328e3b1e1ef5d32eb (patch)
tree1874441b9a6b4120998c183bee3830f9f844ecac /examples
parenteb85e29ff0ca7b9031cf21db3dccaa70b7ef567a (diff)
parent3975b0abbcde3500efd54b153d1211833c608d75 (diff)
downloadicestorm-51067aff52eb958fb47b179328e3b1e1ef5d32eb.tar.gz
icestorm-51067aff52eb958fb47b179328e3b1e1ef5d32eb.tar.bz2
icestorm-51067aff52eb958fb47b179328e3b1e1ef5d32eb.zip
Merge pull request #18 from esden/flex_example_make
[examples] Made the example Makefiles easier to reuse.
Diffstat (limited to 'examples')
-rw-r--r--examples/hx8kboard/Makefile28
-rw-r--r--examples/icestick/Makefile28
2 files changed, 36 insertions, 20 deletions
diff --git a/examples/hx8kboard/Makefile b/examples/hx8kboard/Makefile
index 551de32..e9fd789 100644
--- a/examples/hx8kboard/Makefile
+++ b/examples/hx8kboard/Makefile
@@ -1,18 +1,26 @@
-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 $^
-prog:
- iceprog example.bin
+%.bin: %.txt
+ icepack $< $@
+
+prog: $(PROJ).bin
+ iceprog $<
+
+sudo-prog: $(PROJ).bin
+ @echo 'Executing prog as root!!!'
+ sudo iceprog $<
clean:
- rm -f example.blif example.txt example.bin
+ rm -f $(PROJ).blif $(PROJ).txt $(PROJ).bin
.PHONY: all prog clean
diff --git a/examples/icestick/Makefile b/examples/icestick/Makefile
index 295642a..eaed6f7 100644
--- a/examples/icestick/Makefile
+++ b/examples/icestick/Makefile
@@ -1,18 +1,26 @@
-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 $^
-prog:
- iceprog example.bin
+%.bin: %.txt
+ icepack $< $@
+
+prog: $(PROJ).bin
+ iceprog $<
+
+sudo-prog: $(PROJ).bin
+ @echo 'Executing prog as root!!!'
+ iceprog $<
clean:
- rm -f example.blif example.txt example.bin
+ rm -f $(PROJ).blif $(PROJ).txt $(PROJ).bin
.PHONY: all prog clean