forked from HarryWang29/tencentKeTang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.37 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
NAME=tencentKeTang
BINDIR=bin
VERSION=v0.2.4
BUILDTIME=$(shell date -u)
GOBUILD=CGO_ENABLED=0 go build -ldflags '-w -s -X main.Version=${VERSION}'
PLATFORM_LIST = \
darwin-amd64 \
linux-amd64
WINDOWS_ARCH_LIST = \
windows-386 \
windows-amd64
all: linux-amd64 darwin-amd64 windows-amd64 windows-386 # Most used
darwin-amd64:
GOARCH=amd64 GOOS=darwin $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
linux-amd64:
GOARCH=amd64 GOOS=linux $(GOBUILD) -o $(BINDIR)/$(NAME)-$@
windows-386:
GOARCH=386 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)[email protected]
windows-amd64:
GOARCH=amd64 GOOS=windows $(GOBUILD) -o $(BINDIR)/$(NAME)[email protected]
gz_releases=$(addsuffix .zip, $(PLATFORM_LIST))
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST))
$(gz_releases): %.zip : %
chmod +x $(BINDIR)/$(NAME)-$(basename $@)
cp config.yaml $(BINDIR)/
cp libs/ffmpeg $(BINDIR)/
cp libs/ffprobe $(BINDIR)/
zip -m -j $(BINDIR)/$(NAME)-$(basename $@).zip $(BINDIR)/$(NAME)-$(basename $@) $(BINDIR)/config.yaml $(BINDIR)/ffmpeg $(BINDIR)/ffprobe
$(zip_releases): %.zip : %
cp config.yaml $(BINDIR)/
cp libs/ffmpeg.exe $(BINDIR)/
cp libs/ffprobe.exe $(BINDIR)/
zip -m -j $(BINDIR)/$(NAME)-$(basename $@).zip $(BINDIR)/$(NAME)-$(basename $@).exe $(BINDIR)/config.yaml $(BINDIR)/ffmpeg.exe $(BINDIR)/ffprobe.exe
all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST)
releases: $(gz_releases) $(zip_releases)
clean:
rm $(BINDIR)/*