-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (39 loc) · 1.05 KB
/
Makefile
File metadata and controls
49 lines (39 loc) · 1.05 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
# Build variables
BINARY_NAME = dasung_auto
BUILD_DIR = build
# Platform specific variables
DARWIN = darwin
# Architecture specific variables
# AMD64 = amd64
ARM64 = arm64
# Build flags
LDFLAGS = -ldflags "-s -w"
# Default target
.PHONY: all
all: clean build
# Build all platforms
.PHONY: build
build: darwin
# Darwin (macOS) builds
.PHONY: darwin
darwin: darwin-arm64 #darwin-amd64
# .PHONY: darwin-amd64
# darwin-amd64:
# GOOS=$(DARWIN) GOARCH=$(AMD64) go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-$(DARWIN)-$(AMD64)
.PHONY: darwin-arm64
darwin-arm64:
GOOS=$(DARWIN) GOARCH=$(ARM64) go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-$(DARWIN)-$(ARM64)
# Clean build directory
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
mkdir -p $(BUILD_DIR)
# Help target
.PHONY: help
help:
@echo "Available targets:"
@echo " all - Build all platforms (default)"
@echo " build - Build all platforms"
@echo " darwin - Build all macOS versions"
@echo " clean - Clean build directory"
@echo " help - Show this help message"