-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (26 loc) · 847 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
.PHONY : dist windows darwin linux-arm64 linux-amd64 clean
DIST_DIR="dist"
ZIP="zip -m"
LDFLAGS="-s -w"
BUILD_FLAGS=-ldflags=$(LDFLAGS)
dist:
mkdir -p $(DIST_DIR)
$(MAKE) windows darwin-arm64 darwin-amd64 linux-arm64 linux-amd64
.PHONY= build-windows
windows:
CGO_ENABLED=0 GOOS=windows \
go build $(BUILD_FLAGS) -o $(DIST_DIR)/clocks-windows.exe
darwin-amd64:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \
go build $(BUILD_FLAGS) -o $(DIST_DIR)/clocks-darwin-amd64
darwin-arm64:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 \
go build $(BUILD_FLAGS) -o $(DIST_DIR)/clocks-darwin-arm64
linux-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 \
go build $(BUILD_FLAGS) -o $(DIST_DIR)/clocks-linux-arm64
linux-amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build $(BUILD_FLAGS) -o $(DIST_DIR)/clocks-linux-amd64
clean:
rm -r $(DIST_DIR)/