sbom/Makefile.inc: Change GOPATH

This changes the path where go installs its packages.
Now the packages are not installed in the users home directory anymore.
This solution is not perfect though, since offline build are still not
possible, because go will fetch the packages at build time.

-modcacherw will create the go files with rw permissions, otherwise
coreboot is not able to delete the files afterwards (make distclean).

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I2a35369628454057ea4758cd1225e57f07cb71c8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77780
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
diff --git a/src/sbom/Makefile.inc b/src/sbom/Makefile.inc
index 21e2fa4..7783f09 100644
--- a/src/sbom/Makefile.inc
+++ b/src/sbom/Makefile.inc
@@ -99,7 +99,7 @@
 $(build-dir)/goswid: | $(build-dir)
 	echo "    SBOM      building goswid tool"
 	cd util/goswid; \
-	GO111MODULE=on go build -o $(abspath $@) ./cmd/goswid
+	GOPATH=$(abspath build/go) GO111MODULE=on go build -modcacherw -o $(abspath $@) ./cmd/goswid
 
 ## Generate all .json files