Skip to content

Commit

Permalink
Modify Makefile to support building for ARM64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterJack002 committed Nov 25, 2024
1 parent 7b8019a commit 314edd1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
CTR=docker
NAME=woom

GOOS ?= linux
GOARCH ?= amd64

GOBUILD=CGO_ENABLED=0 \
go build -tags release -trimpath
GOOS=$(GOOS) GOARCH=$(GOARCH) \
go build -tags release -trimpath

GOBUILDARM64=CGO_ENABLED=0 \
GOOS=$(GOOS) GOARCH=arm64 \
go build -tags release -trimpath

.PHONY: default
default: webapp build
Expand All @@ -10,13 +19,20 @@ default: webapp build
build:
$(GOBUILD) -o $(NAME)

.PHONY: build-arm64
build-arm64:
$(GOBUILDARM64) -o $(NAME)-aarch64

.PHONY: arm64
arm64: webapp build-arm64

.PHONY: webapp
webapp:
npm run build

.PHONY: webapp-clean
webapp-clean:
rm -r dist
rm -r static/dist

.PHONY: clean
clean: webapp-clean
Expand Down

0 comments on commit 314edd1

Please sign in to comment.