-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (19 loc) · 932 Bytes
/
Copy pathMakefile
File metadata and controls
24 lines (19 loc) · 932 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
.PHONY: build install clean
VERSION := 0.1.0
BINARY := opencode-agent-flowkit
BUILD_DIR := bin
build:
@mkdir -p $(BUILD_DIR)
go build -ldflags "-X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY) .
install:
go install -ldflags "-X main.version=$(VERSION)" .
clean:
rm -rf $(BUILD_DIR)
# Build for multiple platforms
release:
@mkdir -p $(BUILD_DIR)
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY)-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY)-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY)-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY)-darwin-arm64 .
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION)" -o $(BUILD_DIR)/$(BINARY)-windows-amd64.exe .