-
Notifications
You must be signed in to change notification settings - Fork 44
/
Makefile
29 lines (23 loc) · 1.07 KB
/
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
DIST_DIR = ./dist
BINARY = $(DIST_DIR)/upgit
SRC = .
LDFLAGS = -ldflags="-s -w"
create_dist_dir:
@mkdir -p $(DIST_DIR)
windows: create_dist_dir
GOOS=windows GOARCH=386 go build -o $(BINARY)_win_386.exe $(LDFLAGS) $(SRC)
GOOS=windows GOARCH=amd64 go build -o $(BINARY)_win_amd64.exe $(LDFLAGS) $(SRC)
GOOS=windows GOARCH=arm go build -o $(BINARY)_win_arm.exe $(LDFLAGS) $(SRC)
GOOS=windows GOARCH=arm64 go build -o $(BINARY)_win_arm64.exe $(LDFLAGS) $(SRC)
macos: create_dist_dir
GOOS=darwin GOARCH=amd64 go build -o $(BINARY)_macos_amd64 $(LDFLAGS) $(SRC)
GOOS=darwin GOARCH=arm64 go build -o $(BINARY)_macos_arm64 $(LDFLAGS) $(SRC)
linux: create_dist_dir
GOOS=linux GOARCH=386 go build -o $(BINARY)_linux_386 $(LDFLAGS) $(SRC)
GOOS=linux GOARCH=amd64 go build -o $(BINARY)_linux_amd64 $(LDFLAGS) $(SRC)
GOOS=linux GOARCH=arm go build -o $(BINARY)_linux_arm $(LDFLAGS) $(SRC)
GOOS=linux GOARCH=arm64 go build -o $(BINARY)_linux_arm64 $(LDFLAGS) $(SRC)
all: windows macos linux
@echo "done."
clean:
rm -rfd $(DIST_DIR)