From ecc302fc45f108ed0f076e26f19d9a9fe142db79 Mon Sep 17 00:00:00 2001 From: "Jieyi Long (THETA Network)" Date: Sun, 19 Nov 2023 14:55:29 -0800 Subject: [PATCH] Makefile update to support cross-compiling AMD64 binaries on Apple Silicon (M1/M2 chips, etc) --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 59dda54..a1c779c 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,12 @@ docker: install: gen_version release +# Cross compile AMD64 binaries on Apple Silicon (M1/M2 chips, etc) +install_as: gen_version + CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o ${GOBIN}/thetasubchain ./cmd/theta/ + CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o ${GOBIN}/thetasubcli ./cmd/thetacli/ + CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o ${GOBIN}/subchain_generate_genesis ./integration/tools/subchain_generate_genesis + exe: CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -o thetasubchain.exe ./cmd/thetasubchain/ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -o thetasubcli.exe ./cmd/thetasubcli/