/
Makefile
67 lines (58 loc) · 2.15 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
.PHONY: setup compile debug install clean uninstall appimage appbundle appbundle_x86
release: setup
cd build; \
cmake -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS} ..; \
cmake --build . -j$(nproc)
debug: setup
cd build; \
cmake -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} ..; \
cmake --build . -j$(nproc)
install:
cd build; \
cmake --build . --target install -j$(nproc)
setup:
mkdir -p build
clean:
rm -rf build/
uninstall:
rm -rf /usr/local/bin/memento \
/usr/local/share/applications/memento.desktop \
/usr/local/share/icons/hicolor/scalable/apps/memento.svg
appimage: setup
cd build; \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DAPPIMAGE=ON ${CMAKE_ARGS} ..; \
cmake --build . -j$(nproc); \
make install DESTDIR=AppDir; \
mkdir -p ./AppDir/usr/lib/mecab; \
mkdir -p ./AppDir/usr/lib/mecab/dic; \
cp -r ../dic/ipadic ./AppDir/usr/lib/mecab/dic; \
wget -nc https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage; \
wget -nc https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage; \
wget -nc https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage; \
chmod +x linuxdeploy-x86_64.AppImage \
linuxdeploy-plugin-qt-x86_64.AppImage \
linuxdeploy-plugin-appimage-x86_64.AppImage; \
export VERSION=1.3.0; \
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage
appbundle: setup
cd build; \
cmake -DAPPBUNDLE=ON \
-DCERT=${CERT_NAME} \
-DCMAKE_BUILD_TYPE=Release \
${CMAKE_ARGS} \
..; \
cmake --build . -j$(nproc); \
mkdir -p ./src/Memento.app/Contents/Frameworks/mecab; \
cp -r ../dic ./src/Memento.app/Contents/Frameworks/mecab
# This target is for building x86_64 app bundles on arm Macs
appbundle_x86: setup
cd build; \
cmake -DAPPBUNDLE=ON \
-DMAC_CROSSCOMPILE_X86=ON \
-DCERT=${CERT_NAME} \
-DCMAKE_BUILD_TYPE=Release \
${CMAKE_ARGS} \
..; \
cmake --build . -j$(nproc); \
mkdir -p ./src/Memento.app/Contents/Frameworks/mecab; \
cp -r ../dic ./src/Memento.app/Contents/Frameworks/mecab