-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
61 lines (42 loc) · 1.13 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
61
PACKAGE=./cmd/firefly
BINARY_NAME=firefly
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
QTRCC=qtrcc
QTDEPLOY=qtdeploy
QT_ENV=QT_DIR="${HOME}/Qt" QT_VERSION="5.13.1" QT_API="5.13.0"
BUILD_ENV=CGO_CXXFLAGS="-g -O2 -D QT_NO_DEPRECATED_WARNINGS"
PLATFORM_WINDOWS=windows_64_shared
PLATFORM_LINUX=linux
PLATFORM_DARWIN="darwin"
all: rcc moc build
# the ldflags speed up the compilation
build:
$(QT_ENV) $(BUILD_ENV) $(GOBUILD) -ldflags '-s -w' -mod=vendor -o $(BINARY_NAME) -v $(PACKAGE)
deploy_windows: rcc_windows
$(QTDEPLOY) -docker build $(PLATFORM_WINDOWS) $(PACKAGE)
deploy_linux: rcc_linux
$(QTDEPLOY) -docker build $(PLATFORM_LINUX) $(PACKAGE)
deploy: rcc
$(QT_ENV) $(QTDEPLOY) build desktop $(PACKAGE)
deploy_all: deploy deploy_windows deploy_linux
rcc:
$(QT_ENV) qtrcc desktop $(PACKAGE)
rcc_windows:
$(QT_ENV) qtrcc -docker $(PLATFORM_WINDOWS) $(PACKAGE)
rcc_linux:
$(QT_ENV) qtrcc -docker $(PLATFORM_LINUX) $(PACKAGE)
moc:
$(QT_ENV) qtmoc desktop $(PACKAGE)
setup:
$(QT_ENV) qtsetup
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
run:
./$(BINARY_NAME)