From: michael Date: Sun, 11 Feb 2007 20:49:30 +0000 (+0000) Subject: common makefile X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/raggedstone/commitdiff_plain/81dcfdfd282a69217e19d7536c7572d6d7918d19 common makefile --- diff --git a/common/Makefile.common b/common/Makefile.common new file mode 100644 index 0000000..51494f9 --- /dev/null +++ b/common/Makefile.common @@ -0,0 +1,74 @@ +PWD := $(shell pwd) + +#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) + +all: $(PROJECT).bit final + +log: + time make all &>build.log + +xst: $(PROJECT).ngc + +ngdbuild: $(PROJECT).ngd + +$(PROJECT).ngc: $(SOURCES) + @# echo synclib > $(PROJECT).lso # hmm. things are different in ise 9.1 + echo work > $(PROJECT).lso + xst -intstyle $(INTSTYLE) -ifn $(PROJECT).xst -ofn $(PROJECT).syr + @#cat $(PROJECT).syr + +$(PROJECT).ngd: $(PROJECT).ngc + ngdbuild -intstyle $(INTSTYLE) -dd "$(PWD)/_ngo" -nt timestamp -uc $(PROJECT).ucf -p xc3s1500-fg456-4 $(PROJECT).ngc $(PROJECT).ngd + +$(PROJECT)_map.ngm $(PROJECT).pcf: $(PROJECT).ngd + map -intstyle $(INTSTYLE) -p xc3s1500-fg456-4 -cm area -pr b -k 4 -c 100 -o $(PROJECT)_map.ncd $(PROJECT).ngd $(PROJECT).pcf + +$(PROJECT).ncd: $(PROJECT)_map.ngm $(PROJECT).pcf + @#par -w -intstyle $(INTSTYLE) -ol std -n 4 -t 1 $(PROJECT)_map.ncd $(PROJECT).dir $(PROJECT).pcf + par -w -intstyle $(INTSTYLE) -ol std -t 1 $(PROJECT)_map.ncd $(PROJECT).ncd $(PROJECT).pcf + +$(PROJECT).twx: $(PROJECT).ncd + trce -intstyle $(INTSTYLE) -e 3 -l 3 -s 4 -xml $(PROJECT) $(PROJECT).ncd -o $(PROJECT).twr $(PROJECT).pcf + @#cat $(PROJECT).twr + +$(PROJECT).bit: $(PROJECT).ncd + bitgen -intstyle $(INTSTYLE) -f $(PROJECT).ut $(PROJECT).ncd + @# cp $(PROJECT).bit ../jcarr_last.bit + @#cat $(PROJECT).drc + @#cat $(PROJECT).bgn + +$(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: $(PROJECT).bit + xc3sprog $(PROJECT).bit + +load: $(PROJECT).bit + @sed -e "s|%CABLE%|$(CABLE)|g" xc3s1500.batch >xc3s1500.batch.tmp + impact -batch xc3s1500.batch.tmp + @rm xc3s1500.batch.tmp + +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 \ + *.ngr *.pad *.par *.pcf *.prm *.syr *.twr *.twx *.xpi *.lso *.prm *.mcs _impact* \ + $(PROJECT)_map.* $(PROJECT)_pad.* \ + _ngo xst \ + build.log \ + $(PROJECT).unroutes *.xml + +.PHONY: all final burn load flash clean xst ngdbuild log diff --git a/heartbeat/Makefile b/heartbeat/Makefile index efa7ed3..3771043 100644 --- a/heartbeat/Makefile +++ b/heartbeat/Makefile @@ -1,76 +1,3 @@ -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) - -all: $(PROJECT).bit final - -log: - time make all &>build.log - -xst: $(PROJECT).ngc - -ngdbuild: $(PROJECT).ngd - -$(PROJECT).ngc: $(SOURCES) - @# echo synclib > $(PROJECT).lso # hmm. things are different in ise 9.1 - echo work > $(PROJECT).lso - xst -intstyle $(INTSTYLE) -ifn $(PROJECT).xst -ofn $(PROJECT).syr - @#cat $(PROJECT).syr - -$(PROJECT).ngd: $(PROJECT).ngc - ngdbuild -intstyle $(INTSTYLE) -dd "$(PWD)/_ngo" -nt timestamp -uc $(PROJECT).ucf -p xc3s1500-fg456-4 $(PROJECT).ngc $(PROJECT).ngd - -$(PROJECT)_map.ngm $(PROJECT).pcf: $(PROJECT).ngd - map -intstyle $(INTSTYLE) -p xc3s1500-fg456-4 -cm area -pr b -k 4 -c 100 -o $(PROJECT)_map.ncd $(PROJECT).ngd $(PROJECT).pcf - -$(PROJECT).ncd: $(PROJECT)_map.ngm $(PROJECT).pcf - @#par -w -intstyle $(INTSTYLE) -ol std -n 4 -t 1 $(PROJECT)_map.ncd $(PROJECT).dir $(PROJECT).pcf - par -w -intstyle $(INTSTYLE) -ol std -t 1 $(PROJECT)_map.ncd $(PROJECT).ncd $(PROJECT).pcf - -$(PROJECT).twx: $(PROJECT).ncd - trce -intstyle $(INTSTYLE) -e 3 -l 3 -s 4 -xml $(PROJECT) $(PROJECT).ncd -o $(PROJECT).twr $(PROJECT).pcf - @#cat $(PROJECT).twr - -$(PROJECT).bit: $(PROJECT).ncd - bitgen -intstyle $(INTSTYLE) -f $(PROJECT).ut $(PROJECT).ncd - @# cp $(PROJECT).bit ../jcarr_last.bit - @#cat $(PROJECT).drc - @#cat $(PROJECT).bgn - -$(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: $(PROJECT).bit - xc3sprog $(PROJECT).bit - -load: $(PROJECT).bit - @sed -e "s|%CABLE%|$(CABLE)|g" xc3s1500.batch >xc3s1500.batch.tmp - impact -batch xc3s1500.batch.tmp - @rm xc3s1500.batch.tmp - -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 \ - *.ngr *.pad *.par *.pcf *.prm *.syr *.twr *.twx *.xpi *.lso *.prm *.mcs _impact* \ - $(PROJECT)_map.* $(PROJECT)_pad.* \ - _ngo xst \ - build.log \ - $(PROJECT).unroutes *.xml - -.PHONY: all final burn load flash clean xst ngdbuild log +include ../Makefile.common