From f2cabd5a912f6cff3b852c44a47d6306937998b9 Mon Sep 17 00:00:00 2001 From: yunimoo Date: Thu, 18 Jul 2024 04:42:02 -0400 Subject: [PATCH] Add in specific ARCH to build (#133) --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2f387bc..dfb17b9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ BINARY_NAME=go-fast-cdn OS_NAME := $(shell uname -s | tr A-Z a-z) +ARCH := $(shell arch | tr A-Z a-z | sed 's/^aarch/arm/') prep: go mod tidy @@ -12,9 +13,9 @@ build_ui: pnpm --dir ./ui build build_bin: - GOARCH=amd64 GOOS=darwin CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-darwin - CC="x86_64-linux-musl-gcc" GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-linux - CC="x86_64-w64-mingw32-gcc" GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-windows + GOARCH=${ARCH} GOOS=darwin CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-darwin + CC="x86_64-linux-musl-gcc" GOARCH=${ARCH} GOOS=linux CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-linux + CC="x86_64-w64-mingw32-gcc" GOARCH=${ARCH} GOOS=windows CGO_ENABLED=0 go build -o bin/${BINARY_NAME}-windows run: build ifeq ($(OS_NAME),)