-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 903 Bytes
/
Makefile
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
32
33
34
35
36
# Define variables
BINARY_NAME=mintfun
BUILD_DIR=build
# Default target
all: clean build-linux build-windows build-macos
# Build for Linux
build-linux:
@echo "Building for Linux"
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 ./cmd/...
# Build for Windows
build-windows:
@echo "Building for Windows"
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe ./cmd/...
# Build for macOS
build-macos:
@echo "Building for macOS"
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 ./cmd/...
# Clean build artifacts
clean:
@echo "Cleaning build artifacts"
rm -rf $(BUILD_DIR)
# Create build directory
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
# Ensure build directory exists before building
build-linux build-windows build-macos: $(BUILD_DIR)
# Phony targets
.PHONY: all build-linux build-windows build-macos clean