-
Notifications
You must be signed in to change notification settings - Fork 52
/
makefile
75 lines (61 loc) · 2.06 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
68
69
70
71
72
73
74
75
CC=c++
CFLAGS=-std=c++2a -Wall -O2 -shared -fPIC
# CFLAGS=-std=c++2a -Wall -O0 -g -shared -fPIC
SRC=./Photino.Native
SRC_SHARED=$(SRC)/Shared
SRC_WIN=$(SRC)/Windows
SRC_MAC=$(SRC)/macOS
SRC_LIN=$(SRC)/Linux
DEST_PATH=./lib
DEST_PATH_X64=$(DEST_PATH)/x64
DEST_PATH_ARM64=$(DEST_PATH)/arm64
DEST_FILE=Photino.Native
all:
# "make all is unavailable, use [windows|mac|linux](-x64|arm64)."
windows: clean-x64 build-photino-windows
mac-universal: clean-x64 build-photino-mac-universal
linux-x64: clean-x64 install-linux-dependencies build-photino-linux-x64
linux-arm64: clean-arm64 install-linux-dependencies build-photino-linux-arm64
build-photino-windows:
# "build-photino-windows is not defined"
build-photino-mac-universal:
cp $(SRC)/Exports.cpp $(SRC)/Exports.mm &&\
$(CC) -o $(DEST_PATH_X64)/$(DEST_FILE).dylib\
$(CFLAGS)\
-arch x86_64\
-arch arm64\
-framework Cocoa\
-framework WebKit\
-framework UserNotifications\
-framework Security\
$(SRC)/Photino.Mac.AppDelegate.mm\
$(SRC)/Photino.Mac.UiDelegate.mm\
$(SRC)/Photino.Mac.WindowDelegate.mm\
$(SRC)/Photino.Mac.NavigationDelegate.mm\
$(SRC)/Photino.Mac.UrlSchemeHandler.mm\
$(SRC)/Photino.Mac.NSWindowBorderless.mm\
$(SRC)/Photino.Mac.Dialog.mm\
$(SRC)/Photino.Mac.mm\
$(SRC)/Exports.mm &&\
rm $(SRC)/Exports.mm
install-linux-dependencies:
sudo apt-get update\
&& sudo apt-get install libgtk-3-dev libwebkit2gtk-4.0-dev libnotify4 libnotify-dev
build-photino-linux-x64:
$(CC) -o $(DEST_PATH_X64)/$(DEST_FILE).so\
$(CFLAGS)\
$(SRC)/Photino.Linux.Dialog.cpp\
$(SRC)/Photino.Linux.cpp\
$(SRC)/Exports.cpp\
`pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0 libnotify`
build-photino-linux-arm64:
$(CC) -o $(DEST_PATH_ARM64)/$(DEST_FILE).so\
$(CFLAGS)\
$(SRC)/Photino.Linux.Dialog.cpp\
$(SRC)/Photino.Linux.cpp\
$(SRC)/Exports.cpp\
`pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0 libnotify`
clean-x64:
rm -rf $(DEST_PATH_X64)/* & mkdir -p $(DEST_PATH_X64)
clean-arm64:
rm -rf $(DEST_PATH_ARM64)/* & mkdir -p $(DEST_PATH_ARM64)