-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
25 lines (21 loc) · 772 Bytes
/
Copy pathmakefile
File metadata and controls
25 lines (21 loc) · 772 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
BINARY_NAME=updateit
BUILD_DIR=dist
all: clean build_all
build_all:
@mkdir -p $(BUILD_DIR)
# Linux
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 .
# Windows
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe .
# macOS (Intel)
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 .
# macOS (Apple Silicon)
GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 .
# FreeBSD
GOOS=freebsd GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-freebsd-amd64 .
# Linux ARM
GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 .
@echo "Builds completed in $(BUILD_DIR)/"
clean:
@rm -rf $(BUILD_DIR)
.PHONY: all build_all clean