forked from orzogc/acfunlive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (50 loc) · 1.2 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
50
51
52
53
54
55
56
57
58
59
60
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOGET=$(GOCMD) get -d
GITREPO=github.com/orzogc/acfunlive
UIDIR=acfunlive-ui
STATIC=CGO_ENABLED=0
WINDOWSENV=GOOS=windows GOARCH=amd64
TAGS=-tags tray
LDFLAGS=-ldflags -H=windowsgui
YARNINSTALL=yarn install
YARNGENERATE=yarn generate
NODEMODULES=node_modules
NUXTDIR=.nuxt
DISTDIR=dist
MKDIR=mkdir -p
RM=rm -rf
CP=cp -rf
CD=cd
BINARY=bin
WEBUIDIR=webui
all: deps build
build: build-go-cli build-ui
build-gui: deps build-go-gui build-ui
build-go-cli:
$(MKDIR) $(BINARY)
$(STATIC) $(GOBUILD) -o $(BINARY)
build-go-gui:
$(MKDIR) $(BINARY)
$(GOBUILD) -o $(BINARY) $(TAGS)
build-ui:
$(CD) $(UIDIR) && $(YARNGENERATE)
$(CP) $(UIDIR)/$(DISTDIR)/. $(BINARY)/$(WEBUIDIR)
deps:
$(GOGET) $(GITREPO)
$(CD) $(UIDIR) && $(YARNINSTALL)
clean:
$(GOCLEAN)
$(RM) $(BINARY)
$(RM) $(UIDIR)/$(NODEMODULES)
$(RM) $(UIDIR)/$(NUXTDIR)
$(RM) $(UIDIR)/$(DISTDIR)
build-windows-gui: deps build-go-windows-gui build-ui
build-go-windows-gui:
$(MKDIR) $(BINARY)
$(STATIC) $(WINDOWSENV) $(GOBUILD) -o $(BINARY) $(TAGS) $(LDFLAGS)
build-windows-cli: deps build-go-windows-cli build-ui
build-go-windows-cli:
$(MKDIR) $(BINARY)
$(STATIC) $(WINDOWSENV) $(GOBUILD) -o $(BINARY)