Skip to content

Commit

Permalink
Add in specific ARCH to build (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunimoo authored Jul 18, 2024
1 parent 798f694 commit f2cabd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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),)
Expand Down

0 comments on commit f2cabd5

Please sign in to comment.