@@ -25,6 +25,15 @@ SHELL := $(shell command -v bash;)
25
25
GO ?= go
26
26
GO_LDFLAGS: = $(shell if $(GO ) version|grep -q gccgo ; then echo "-gccgoflags"; else echo "-ldflags"; fi)
27
27
GOCMD = CGO_ENABLED=$(CGO_ENABLED ) GOOS=$(GOOS ) GOARCH=$(GOARCH ) $(GO )
28
+ # Podman does not work w/o CGO_ENABLED, except in some very specific cases.
29
+ # Windows and Mac (both podman-remote client only) require CGO_ENABLED=0.
30
+ CGO_ENABLED ?= 1
31
+ # Default to the native OS type and architecture unless otherwise specified
32
+ NATIVE_GOOS := $(shell env -u GOOS $(GO ) env GOOS)
33
+ GOOS ?= $(call err_if_empty,NATIVE_GOOS)
34
+ # Default to the native architecture type
35
+ NATIVE_GOARCH := $(shell env -u GOARCH $(GO ) env GOARCH)
36
+ GOARCH ?= $(NATIVE_GOARCH )
28
37
COVERAGE_PATH ?= .coverage
29
38
DESTDIR ?=
30
39
EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-main} HEAD)
@@ -179,15 +188,6 @@ CROSS_BUILD_TARGETS := \
179
188
# Dereference variable $(1), return value if non-empty, otherwise raise an error.
180
189
err_if_empty = $(if $(strip $($(1 ) ) ) ,$(strip $($(1 ) ) ) ,$(error Required variable $(1 ) value is undefined, whitespace, or empty) )
181
190
182
- # Podman does not work w/o CGO_ENABLED, except in some very specific cases.
183
- # Windows and Mac (both podman-remote client only) require CGO_ENABLED=0.
184
- CGO_ENABLED ?= 1
185
- # Default to the native OS type and architecture unless otherwise specified
186
- NATIVE_GOOS := $(shell env -u GOOS $(GO ) env GOOS)
187
- GOOS ?= $(call err_if_empty,NATIVE_GOOS)
188
- # Default to the native architecture type
189
- NATIVE_GOARCH := $(shell env -u GOARCH $(GO ) env GOARCH)
190
- GOARCH ?= $(NATIVE_GOARCH )
191
191
ifeq ($(call err_if_empty,GOOS) ,windows)
192
192
BINSFX := .exe
193
193
SRCBINDIR := bin/windows
0 commit comments