]> git.zerfleddert.de Git - raggedstone/blobdiff - heartbeat/Makefile
do not try to use $$...
[raggedstone] / heartbeat / Makefile
index 7688155fbe434fe038cda604d75c16d85b992ff3..efa7ed32ca757d076fdba9a04d08f38c9552a0b5 100644 (file)
@@ -2,6 +2,9 @@ PWD := $(shell pwd)
 
 PROJECT := raggedstone
 
+#auto|lpt1|lpt2|lpt3|com1|com2|com3|com4|usb0|usb1|usb2|usb21|ttya|ttyb|tty00|tty01
+CABLE ?= auto
+
 INTSTYLE := silent
 
 SOURCES = $(wildcard sources/*.v source/*.vhd)
@@ -41,22 +44,26 @@ $(PROJECT).bit: $(PROJECT).ncd
        @#cat $(PROJECT).drc
        @#cat $(PROJECT).bgn
 
-mcs:
-       promgen -intstyle $(INTSTYLE) -w -p mcs -u 0 $(PROJECT) -o pci1 pci2 -x xcf02s xcf04s
+$(PROJECT)-xcf02s.mcs $(PROJECT)-xcf04s.mcs: $(PROJECT).bit
+       promgen -intstyle $(INTSTYLE) -w -p mcs -u 0 $(PROJECT) -o $(PROJECT)-xcf02s $(PROJECT)-xcf04s -x xcf02s xcf04s
 
 final:
        -@grep -A 8 -B 1 ^Selected\ Device $(PROJECT).syr
        -@grep -A 8 -B 1 ^Timing\ Summary $(PROJECT).syr
        -@grep -A 21 -B 1 ^Design\ Summary $(PROJECT)_map.map
 
-burn:
+burn: $(PROJECT).bit
        xc3sprog $(PROJECT).bit
 
-load:
-       impact -batch xc3s1500.batch
+load: $(PROJECT).bit
+       @sed -e "s|%CABLE%|$(CABLE)|g" xc3s1500.batch >xc3s1500.batch.tmp
+       impact -batch xc3s1500.batch.tmp
+       @rm xc3s1500.batch.tmp
 
-flash: mcs
-       impact -batch xcf.batch
+flash: $(PROJECT)-xcf02s.mcs $(PROJECT)-xcf04s.mcs
+       @sed -e "s|%CABLE%|$(CABLE)|g" xcf.batch >xcf.batch.tmp
+       impact -batch xcf.batch.tmp
+       @rm xcf.batch.tmp
 
 clean:
        @rm -rf *.bit *.bgn *.mcs *.prm *.bld *.drc *.mcs *.ncd *.ngc *.ngd \
@@ -65,3 +72,5 @@ clean:
                _ngo xst  \
                build.log \
                $(PROJECT).unroutes *.xml
+
+.PHONY: all final burn load flash clean xst ngdbuild log
Impressum, Datenschutz