forked from HeidiSQL/HeidiSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
157 lines (136 loc) · 4.15 KB
/
Copy pathMakefile
File metadata and controls
157 lines (136 loc) · 4.15 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# This need and IFDEF WINDOWS !!
LAZBUILD := $(shell command -v lazbuild)
OPTS := -B --bm=Release
OPTSQT5 := --ws=qt5
OPTSQT6 := --ws=qt6
LPI := heidisql.lpi
BIN := ./out/heidisql
BINWIN64 := ./out/win64/heidisql.exe
BINGTK := ./out/gtk2/heidisql
BINQT5 := ./out/qt5/heidisql
BINQT6 := ./out/qt6/heidisql
BINMACOS := ./out/macos/heidisql
# Make shell magic to get version from somewhere
#VERSION := shell magic
# Check for environment variable GITHUB
ifeq ($(origin GITHUB), undefined)
# GITHUB is not set
tag := $(shell git describe --tags $(shell git rev-list --tags --max-count=1) 2>/dev/null || echo "v0.0.0")
else
# GITHUB is set
$(info GITHUB is set)
endif
VERSION := $(shell echo $(tag) | sed "s/v//")
.PHONY: all clean copy-locale build-mo build-win64 run-win64 build-gtk2 run-gtk2 build-qt5 run-qt5 build-qt6 run-qt6 build-macos deb-package tar-gtk2 tar-qt5 tar-qt6
all: clean build-win64 build-gtk2 build-qt5 build-qt6 build-macos deb-package tar-gtk2 tar-qt5 tar-qt6
clean:
@echo "=== Cleaning"
@rm -rf ./bin/lib/x86_64-linux/*
@rm -f ./out/win64/* ./out/gtk2/* ./out/qt5/* ./out/qt6/* ./out/macos/*
@rm -rf ./deb ./rpm ./tar ./dist
copy-locale:
@echo "=== Copying .mo from extra/locale to out/locale"
@mkdir -p ./out/locale
@cp -fv ./extra/locale/*.mo ./out/locale
build-win64:
@echo "=== Building Win64"
lazbuild $(OPTS) $(LPI)
@mkdir -p ./out/win64
@mv -v "$(BIN).exe" "$(BINWIN64)"
run-win64:
@echo "Not implemented yet."
build-gtk2:
@echo "=== Building GTK2"
$(LAZBUILD) $(OPTS) $(LPI)
@mkdir -p ./out/gtk2
@mv -v $(BIN) $(BINGTK)
run-gtk2: build-gtk2
@echo "=== Running GTK2"
@mkdir -p ./run/locale
@cp -vf ./extra/locale/*.mo ./run/locale
@cp -vf ./extra/ini/*.ini ./run
@cp -v $(BINGTK) ./run/heidisql
@./run/heidisql
build-qt5:
@echo "=== Building QT5"
$(LAZBUILD) $(OPTS) $(OPTSQT5) $(LPI)
@mkdir -p ./out/qt5
@mv -v $(BIN) $(BINQT5)
run-qt5: build-qt5
@echo "=== Running QT5"
@mkdir -p ./run/locale
@cp -vf ./extra/locale/*.mo ./run/locale
@cp -vf ./extra/ini/*.ini ./run
@cp -v $(BINQT5) ./run/heidisql
@./run/heidisql
build-qt6:
@echo "=== Building QT6"
$(LAZBUILD) $(OPTS) $(OPTSQT6) $(LPI)
@mkdir -p ./out/qt6
@mv -v $(BIN) $(BINQT6)
run-qt6: build-qt6
@echo "=== Running QT6"
@mkdir -p ./run/locale
@cp -vf ./extra/locale/*.mo ./run/locale
@cp -vf ./extra/ini/*.ini ./run
@cp -v $(BINQT6) ./run/heidisql
@./run/heidisql
build-macos:
@echo "=== Building macOS"
$(LAZBUILD) $(OPTS) $(LPI)
@mkdir -p ./out/macos
@mv -v $(BIN) $(BINMACOS)
deb-package:
@echo "=== Creating debian package"
rm -vrf deb
cp -R package-skeleton deb
find deb -iname ".gitkeep" -exec rm -v {} +
cp -vR extra/locale/*.mo deb/usr/share/heidisql/locale
cp -v extra/ini/*.ini deb/usr/share/heidisql
cp -v res/deb-package-icon.png deb/usr/share/pixmaps/heidisql.png
cp -v $(BINGTK) deb/usr/share/heidisql/heidisql
chmod +x deb/usr/share/heidisql/heidisql
cp -v README.md LICENSE deb/usr/share/doc/heidisql
mkdir -p dist
@sed "s/%VERSION%/$(VERSION)/" deb-control.txt > control.txt
rm -vf dist/*.deb
fpm -s dir -t deb -n heidisql -v $(VERSION) \
-p dist \
--verbose \
--deb-custom-control control.txt \
--deb-no-default-config-files \
./deb/=/
rm control.txt
tar-gtk2:
@echo "=== Creating GTK2 archive"
rm -vrf tar
mkdir -p tar/locale dist
cp -v README.md LICENSE tar
cp -v res/deb-package-icon.png tar/heidisql.png
cp -v extra/locale/*.mo tar/locale
cp -v extra/ini/*.ini tar
cp -v out/gtk2/heidisql tar
chmod +x tar/heidisql
cd tar && tar -zcvf ../dist/build-gtk2-$(tag).tgz *
tar-qt5:
@echo "=== Creating QT5 archive"
rm -vrf tar
mkdir -p tar/locale dist
cp -v README.md LICENSE tar
cp -v res/deb-package-icon.png tar/heidisql.png
cp -v extra/locale/*.mo tar/locale
cp -v extra/ini/*.ini tar
cp -v out/qt5/heidisql tar
chmod +x tar/heidisql
cd tar && tar -zcvf ../dist/build-qt5-$(tag).tgz *
tar-qt6:
@echo "=== Creating QT6 archive"
rm -vrf tar
mkdir -p tar/locale dist
cp -v README.md LICENSE tar
cp -v res/deb-package-icon.png tar/heidisql.png
cp -v extra/locale/*.mo tar/locale
cp -v extra/ini/*.ini tar
cp -v out/qt6/heidisql tar
chmod +x tar/heidisql
cd tar && tar -zcvf ../dist/build-qt6-$(tag).tgz *