mirror of
https://github.com/containers/gvisor-tap-vsock.git
synced 2025-09-26 21:01:42 +08:00
build: Build universal macOS binary
This makes use of github.com/randall77/makefat in order to generate a gvproxy-darwin binary containing both the amd64 and arm64 binaries. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:

committed by
Gerard Braad

parent
6eb1a84d6f
commit
d74ccd7e29
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
bin/
|
||||
./bin/
|
||||
capture.pcap
|
||||
tmp/
|
||||
test/qcon.log
|
||||
|
10
Makefile
10
Makefile
@@ -1,5 +1,6 @@
|
||||
TAG ?= $(shell git describe --match=NeVeRmAtCh --always --abbrev=40 --dirty)
|
||||
CONTAINER_RUNTIME ?= podman
|
||||
TOOLS_BINDIR = $(realpath tools/bin)
|
||||
|
||||
LDFLAGS = -ldflags '-s -w'
|
||||
|
||||
@@ -41,11 +42,16 @@ image:
|
||||
${CONTAINER_RUNTIME} build -t quay.io/crcont/gvisor-tap-vsock:$(TAG) -f images/Dockerfile .
|
||||
|
||||
.PHONY: cross
|
||||
cross:
|
||||
cross: $(TOOLS_BINDIR)/makefat
|
||||
GOARCH=amd64 GOOS=windows go build $(LDFLAGS) -o bin/gvproxy-windows.exe ./cmd/gvproxy
|
||||
GOARCH=amd64 GOOS=darwin go build $(LDFLAGS) -o bin/gvproxy-darwin ./cmd/gvproxy
|
||||
GOARCH=amd64 GOOS=darwin go build $(LDFLAGS) -o bin/gvproxy-darwin-amd64 ./cmd/gvproxy
|
||||
GOARCH=arm64 GOOS=darwin go build $(LDFLAGS) -o bin/gvproxy-darwin-arm64 ./cmd/gvproxy
|
||||
GOARCH=amd64 GOOS=linux go build $(LDFLAGS) -o bin/gvproxy-linux ./cmd/gvproxy
|
||||
cd bin && $(TOOLS_BINDIR)/makefat gvproxy-darwin gvproxy-darwin-amd64 gvproxy-darwin-arm64
|
||||
|
||||
# Needed to build macOS universal binary
|
||||
$(TOOLS_BINDIR)/makefat:
|
||||
GOBIN=$(TOOLS_BINDIR) go install -mod=mod github.com/randall77/makefat@latest
|
||||
|
||||
.PHONY: test-companion
|
||||
test-companion:
|
||||
|
1
tools/bin/.gitignore
vendored
Normal file
1
tools/bin/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
makefat*
|
Reference in New Issue
Block a user