Merge pull request #3823 from Random-Liu/better-support-windows-build
Better support windows binaries.
This commit is contained in:
commit
2a60547b4e
12
Makefile
12
Makefile
@ -106,11 +106,11 @@ GO_GCFLAGS=$(shell \
|
|||||||
echo "-gcflags=-trimpath=$${1}/src"; \
|
echo "-gcflags=-trimpath=$${1}/src"; \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
BINARIES=$(addprefix bin/,$(COMMANDS))
|
||||||
|
|
||||||
#include platform specific makefile
|
#include platform specific makefile
|
||||||
-include Makefile.$(GOOS)
|
-include Makefile.$(GOOS)
|
||||||
|
|
||||||
BINARIES=$(addprefix bin/,$(COMMANDS))
|
|
||||||
|
|
||||||
# Flags passed to `go test`
|
# Flags passed to `go test`
|
||||||
TESTFLAGS ?= $(TESTFLAGS_RACE)
|
TESTFLAGS ?= $(TESTFLAGS_RACE)
|
||||||
TESTFLAGS_PARALLEL ?= 8
|
TESTFLAGS_PARALLEL ?= 8
|
||||||
@ -178,10 +178,14 @@ benchmark: ## run benchmarks tests
|
|||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
|
define BUILD_BINARY =
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_LDFLAGS} ${GO_TAGS} ./$<
|
||||||
|
endef
|
||||||
|
|
||||||
# Build a binary from a cmd.
|
# Build a binary from a cmd.
|
||||||
bin/%: cmd/% FORCE
|
bin/%: cmd/% FORCE
|
||||||
@echo "$(WHALE) $@${BINARY_SUFFIX}"
|
$(BUILD_BINARY)
|
||||||
@go build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@${BINARY_SUFFIX} ${GO_LDFLAGS} ${GO_TAGS} ./$<
|
|
||||||
|
|
||||||
bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
|
bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
|
||||||
@echo "$(WHALE) bin/containerd-shim"
|
@echo "$(WHALE) bin/containerd-shim"
|
||||||
|
@ -17,9 +17,12 @@
|
|||||||
WHALE = "+"
|
WHALE = "+"
|
||||||
ONI = "-"
|
ONI = "-"
|
||||||
|
|
||||||
BINARY_SUFFIX=".exe"
|
|
||||||
|
|
||||||
# amd64 supports go test -race
|
# amd64 supports go test -race
|
||||||
ifeq ($(GOARCH),amd64)
|
ifeq ($(GOARCH),amd64)
|
||||||
TESTFLAGS_RACE= -race
|
TESTFLAGS_RACE= -race
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BINARIES:=$(addsuffix .exe,$(BINARIES))
|
||||||
|
|
||||||
|
bin/%.exe: cmd/% FORCE
|
||||||
|
$(BUILD_BINARY)
|
||||||
|
Loading…
Reference in New Issue
Block a user