From 7b180db48bcce40afba85d39a8ae73a5514854f3 Mon Sep 17 00:00:00 2001 From: uvok Date: Thu, 25 Dec 2025 12:21:19 +0100 Subject: Write my own dep resolve script --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3