-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile_windows
49 lines (35 loc) · 939 Bytes
/
Makefile_windows
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
VERSION?=v0.0.0-test
DIR = dist
EXECUTABLE = ass-shifter
GOARCH = amd64
GOOSWIN = windows
GOOSX = darwin
GOOSLINUX = linux
WINBIN = $(DIR)/$(EXECUTABLE)-win-$(GOARCH).exe
OSXBIN = $(DIR)/$(EXECUTABLE)-darwin-$(GOARCH)
LINUXBIN = $(DIR)/$(EXECUTABLE)-linux-$(GOARCH)
CC = go build
LDFLAGS = all=-w -s -X main.version=$(VERSION)
.PHONY: default all
default: all
all: darwin linux win64
.PHONY: darwin
darwin: $(OSXBIN)
# chmod +x $(OSXBIN)
.PHONY: $(OSXBIN)
$(OSXBIN):
set GOARCH=$(GOARCH)&set GOOS=$(GOOSX)&$(CC) -o $(OSXBIN) -ldflags="$(LDFLAGS)"
.PHONY: linux
linux: $(LINUXBIN)
# chmod +x $(LINUXBIN)
.PHONY: $(LINUXBIN)
$(LINUXBIN):
set GOARCH=$(GOARCH)&set GOOS=$(GOOSLINUX)&$(CC) -o $(LINUXBIN) -ldflags="$(LDFLAGS)"
.PHONY: win64
win64: $(WINBIN)
.PHONY: $(WINBIN)
$(WINBIN):
set GOARCH=$(GOARCH)&set GOOS=$(GOOSWIN)&$(CC) -o $(WINBIN) -ldflags="$(LDFLAGS)"
.PHONY: clean
clean:
del /f /q .\$(DIR)\*