Explicitly set GOOS when building binary

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2021-06-10 10:40:06 +02:00
parent f05e4e81c5
commit c728bf4b1e

View File

@ -27,8 +27,10 @@ MODULE := github.com/NVIDIA/nvidia-container-toolkit
docker-native: docker-native:
include $(CURDIR)/docker/docker.mk include $(CURDIR)/docker/docker.mk
GOOS ?= linux
binary: binary:
go build -ldflags "-s -w" -o "$(LIB_NAME)" $(MODULE)/cmd/$(LIB_NAME) GOOS=$(GOOS) go build -ldflags "-s -w" -o "$(LIB_NAME)" $(MODULE)/cmd/$(LIB_NAME)
# Define the check targets for the Golang codebase # Define the check targets for the Golang codebase
.PHONY: check fmt assert-fmt ineffassign lint misspell vet .PHONY: check fmt assert-fmt ineffassign lint misspell vet