diff --git a/target/common/gvsoc.mk b/target/common/gvsoc.mk index d9e82ba4d..4c3e743d7 100644 --- a/target/common/gvsoc.mk +++ b/target/common/gvsoc.mk @@ -6,8 +6,12 @@ $(BIN_DIR)/$(TARGET).gvsoc: @echo "#!/bin/bash" > $@ @echo 'binary=$$(realpath $$1)' >> $@ @echo 'echo $$binary > .rtlbinary' >> $@ - @echo 'gvsoc --target=snitch --binary $$binary \ - --control-script=$(GVSOC_BUILDDIR)/pulp/pulp/snitch/utils/gvcontrol.py $$2 run' >> $@ + @echo 'path="$$(dirname "$$(dirname "$$(readlink -f "$${BASH_SOURCE[0]}")")")"' >> $@ + @echo 'if [ -z "$$GVSOC_TARGET" ]; then' >> $@ + @echo ' GVSOC_TARGET=snitch' >> $@ + @echo 'fi' >> $@ + @echo 'gvsoc --target=$${GVSOC_TARGET} --binary $$binary \ + --control-script=$${path}/${GVSOC_BUILDDIR}/pulp/pulp/snitch/utils/gvcontrol.py $$2 run' >> $@ @chmod +x $@ .PHONY: clean-gvsoc