How to enable env variable for go build ?

Hi,

I have a program written in go that I am trying to make a port for. The build command should be:
Code:
go generate ./...
CGO_ENABLED=1 go build -o bin/ -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w' ./cmd/hostd
would this in the port Makefile do the same:
Code:
USES=           go:modules
GO_MODULE=      go.sia.tech/hostd
GO_TARGET=      ./cmd/hostd
GO_BUILDFLAGS+= -tags='netgo timetzdata' -trimpath -a -ldflags '-s -w'
GO_ENV+=        "CGO_ENABLED=1"
any help and comments welcome
cheers !
 
GO_TARGET doesn't look right.


What I typically do is to look at an existing port that uses the same build system, then see how that port is configured.
 
actually it builds but the generated binary does not behave the same as when I just build from the command line.
seems like it's missing something when building.
How to make sure of which commands and how they are run ?
 
Back
Top