diff --git a/.gitignore b/.gitignore index 385a2475..49bac5ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -bin/ +./bin/ capture.pcap tmp/ test/qcon.log diff --git a/Makefile b/Makefile index 668d41af..4172ce77 100644 --- a/Makefile +++ b/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: diff --git a/tools/bin/.gitignore b/tools/bin/.gitignore new file mode 100644 index 00000000..d243069d --- /dev/null +++ b/tools/bin/.gitignore @@ -0,0 +1 @@ +makefat*