-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (26 loc) · 878 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
37
38
39
NAME=PTDog
BINDIR=bin
VERSION=1.0.0
GOBUILD=CGO_ENABLED=0 go build -trimpath -ldflags '-w -s'
all: linux-amd64 darwin-amd64 windows-amd64
linux-amd64:
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
darwin-amd64:
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
windows-amd64:
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)[email protected]
PLATFORM_LIST = \
darwin-amd64 \
linux-amd64
WINDOWS_ARCH_LIST = \
windows-amd64
gz_releases=$(addsuffix .gz, $(PLATFORM_LIST))
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST))
$(gz_releases): %.gz : %
chmod +x $(BINDIR)/$(NAME)-$(basename $@)
gzip -f -S -$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@)
$(zip_releases): %.zip : %
zip -m -j $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@).exe
releases: $(gz_releases) $(zip_releases)
clean:
rm $(BINDIR)/*