forked from plumthedev/myrient-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
31 lines (27 loc) · 714 Bytes
/
makefile
File metadata and controls
31 lines (27 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
APP_NAME := myrient-cli
SRC_DIR := src
OUTPUT_DIR := builds
PLATFORMS := \
linux/amd64 \
linux/arm64 \
linux/arm \
darwin/amd64 \
darwin/arm64 \
windows/amd64 \
windows/arm64
all: clean build
build:
@echo "🔨 Building for all platforms..."
@mkdir -p $(OUTPUT_DIR)
@for platform in $(PLATFORMS); do \
OS=$${platform%%/*}; \
ARCH=$${platform##*/}; \
EXT=$$( [ "$$OS" = "windows" ] && echo ".exe" || echo "" ); \
OUTPUT=$(OUTPUT_DIR)/$(APP_NAME)-$${OS}-$${ARCH}$${EXT}; \
echo "➡️ Building $$OS/$$ARCH → $$OUTPUT"; \
GOOS=$$OS GOARCH=$$ARCH go build -C $(SRC_DIR) -o ../$$OUTPUT .; \
done
@echo "✅ Build complete."
clean:
@echo "🧹 Cleaning..."
@rm -rf $(OUTPUT_DIR)