-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
67 lines (49 loc) · 1.99 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
62
63
64
65
66
67
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
# QT_STATIC_DIR ?= $(MAKEFILE_DIR)/Qt/static
QT_STATIC_DIR ?= $(HOME)/Qt/6.2.4/macos
QT_SRC_DIR ?= $(MAKEFILE_DIR)/Qt/src
QT_CFG_ARGS := -opensource -release -static -nomake examples -nomake tests -skip qt3d -skip qttranslations -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qthttpserver -skip qtlanguageserver -skip qtlottie -skip qtmqtt -skip qtmultimedia -skip qtnetworkauth -skip qtopcua -skip qtpositioning -skip qtquick3d -skip qtquick3dphysics -skip qtquicktimeline -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtshadertools -skip qtspeech -skip qtsvg -skip qttools -skip qtwebsockets
QT_INIT_ARGS := --module-subset=qtbase
QT_VERSION ?= 6.2.4
# current: FORCE
# make main
# make test
install: FORCE
make main
rm -rf '/Applications/Canvas Sync.app'
cp -a './build/Canvas Sync.app' '/Applications/Canvas Sync.app'
main:
@make --no-print-directory build
mv ./build/compile_commands.json .
test: FORCE
$(MAKEFILE_DIR)/build/test/CanvasSyncTest
build: FORCE
@echo "-- USING QT_STATIC_DIR: $(QT_STATIC_DIR)"
cmake -DQT_STATIC_DIR=$(QT_STATIC_DIR) -DCMAKE_BUILD_TYPE=Release \
-S . -B build
cmake --build build --parallel # alternatively: cd build && make
build-win: FORCE
cmake -DCMAKE_BUILD_TYPE=Release -S . -B build -G Ninja
cmake --build build
qt-setup:
make clone-qt
make init-qt
clone-qt:
git clone https://code.qt.io/qt/qt5.git -b v$(QT_VERSION) $(QT_SRC_DIR)
init-qt:
cd $(QT_SRC_DIR) && perl init-repository $(QT_INIT_ARGS)
config-qt:
cd $(QT_SRC_DIR) && ./configure -prefix $(QT_STATIC_DIR) $(QT_CFG_ARGS)
clean-qt:
cd $(QT_SRC_DIR) && ninja clean
build-qt:
cd $(QT_SRC_DIR) && ninja -j6 && ninja install
open:
open 'build/Canvas Sync.app'
reset:
rm -rf ~/files/test/*/*
clean:
rm -rf $(MAKEFILE_DIR)/.cache
rm -rf $(MAKEFILE_DIR)/build
FORCE: ;