summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index de8af58..20b58af 100644
--- a/Makefile
+++ b/Makefile
@@ -6,15 +6,19 @@ MAKEFLAGS += --no-builtin-variables
PROGRAM ?= led
CST ?= tangnano9k.cst
FLASH_OPTS ?=
+# Can't use this for deps:
+# -E $(PROGRAM).deps
+# as yosys needs to have -o specified for this to work
+# but I specify the command manually
+# also, yosys inserts /tmp/ files which makes this useless.
YOSYS_OPTS ?= -Q -q -l $(PROGRAM).yosys.log
DEPS := $(wildcard *.dep)
+
# this is "bad", as it runs the deps target every time
# probably because of the include below
# SOURCES := $(wildcard *.v)
# DEPS := $(SOURCES:.v=.dep)
-# yosys deps-file doesn't work, it writes ": infile depfiles"
-#-E $(PROGRAM).deps
## default target
all: $(PROGRAM).fs
@@ -40,13 +44,13 @@ clean:
# synthesize
%.json: %.v
- gawk 'match($$0, /`include "(.*)"/, ary) {print "$*.json:", ary[1]}' $< > $*.dep
+ sh resolvedeps.sh $<
yosys -p "read_verilog $<; synth_gowin -top $* -json $@" $(YOSYS_OPTS)
# because yosys -E is buggy, or behaves differently than expected,
# use gawk to force-create deps.
%.dep: %.v
- gawk 'match($$0, /`include "(.*)"/, ary) {print "$*.json:", ary[1]}' $< > $@
+ sh resolvedeps.sh $<
# place and route?
%.pnr.json: %.json $(CST)