forked from isis-project/BrowserServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
206 lines (170 loc) · 5.28 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
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
BUILD_TYPE := release
PLATFORM := $(TARGET_ARCH)
MOC := ${STAGING_BINDIR_NATIVE}/moc-palm
ifneq (,$(findstring BUILD_BACKUP_MANAGER,$(CXXFLAGS)))
BACKUP_MANAGER_SOURCE=BackupManager.cpp WebKitEventListener.cpp
else
BACKUP_MANAGER_SOURCE=
endif
ifneq (,$(findstring BUILD_CPU_AFFINITY,$(CXXFLAGS)))
CPU_AFFINITY_SOURCE=CpuAffinity.cpp
LIBAFFINITY=-laffinity
else
CPU_AFFINITY_SOURCE=
LIBAFFINITY=
endif
ifneq (,$(findstring USE_CERT_MGR,$(CXXFLAGS)))
LIBCERTMGR=-lPmCertificateMgr
else
LIBCERTMGR=
endif
ifneq (,$(findstring USE_MEMCHUTE,$(CXXFLAGS)))
LIBMEMCHUTE=-lmemchute
else
LIBMEMCHUTE=
endif
ifneq (,$(findstring BUILD_SSL_SUPPORT,$(CXXFLAGS)))
SSL_SUPPORT_SOURCE=SSLSupport.cpp
else
SSL_SUPPORT_SOURCE=
endif
INCLUDES := \
-isystem $(STAGING_INCDIR)/PmCertificateMgr/IncsPublic \
-isystem $(STAGING_INCDIR)/webkit \
-I./Src \
-I./Yap \
-I$(STAGING_INCDIR) \
-I$(STAGING_INCDIR)/ime \
-I$(STAGING_INCDIR)/QtWebKit \
-I$(STAGING_INCDIR)/sysmgr-ipc \
-I$(STAGING_INCDIR)/WebKitSupplemental \
-I$(INCLUDE_DIR) \
-I$(INCLUDE_DIR)/Qt \
-I$(INCLUDE_DIR)/QtCore \
-I$(INCLUDE_DIR)/QtGui \
-I$(INCLUDE_DIR)/QtNetwork \
$(shell pkg-config --cflags glib-2.0) \
$(shell pkg-config --cflags luna-service2)
LIBS := \
$(LIBAFFINITY) \
-lpthread \
$(LIBMEMCHUTE) \
-lglib-2.0 \
-lpbnjson_cpp \
$(LIBCERTMGR) \
-lrt \
-lcrypto \
-lQtCore \
-ldl \
-lssl \
-lQtGui \
-lQtWebKit \
-lQtNetwork \
-lWebKitMisc \
$(shell pkg-config --libs gthread-2.0) \
$(shell pkg-config --libs luna-service2)
FLAGS_OPT := -fno-exceptions -fno-rtti -fvisibility=hidden -DDEBUG -fPIC -DTARGET_DEVICE
ifeq ("$(BUILD_TYPE)", "debug")
FLAGS_OPT := -O0 -pg -g $(FLAGS_OPT)
else
FLAGS_OPT := -O2 $(FLAGS_OPT)
endif
LOCAL_CFLAGS := $(CXXFLAGS) -Wall -Werror $(FLAGS_OPT)
LOCAL_LFLAGS := $(LDFLAGS) $(FLAGS_OPT) $(LIBS)
OBJDIR := $(BUILD_TYPE)-$(PLATFORM)
TARGET_LIB := $(OBJDIR)/libYap.a
LIB_SOURCES := \
YapPacket.cpp \
YapProxy.cpp \
YapServer.cpp \
YapClient.cpp \
IpcBuffer.cpp \
BufferLock.cpp \
BrowserRect.cpp \
PluginDirWatcher.cpp
TARGET_APP := $(OBJDIR)/BrowserServer
APP_SOURCES := \
Main.cpp \
BrowserServer.cpp \
BrowserPage.cpp \
BrowserSyncReplyPipe.cpp \
BrowserServerBase.cpp \
BrowserOffscreenQt.cpp \
BrowserPageManager.cpp \
$(BACKUP_MANAGER_SOURCE) \
$(CPU_AFFINITY_SOURCE) \
Settings.cpp \
$(SSL_SUPPORT_SOURCE) \
JsonUtils.cpp \
BrowserPage.moc.cpp \
BrowserComboBox.cpp \
BrowserComboBox.moc.cpp \
qwebkitplatformplugin.moc.cpp \
WebOSPlatformPlugin.moc.cpp
LIB_OBJS := $(LIB_SOURCES:%.cpp=$(OBJDIR)/%.o)
APP_OBJS := $(APP_SOURCES:%.cpp=$(OBJDIR)/%.o)
SOURCES := $(LIB_SOURCES) $(APP_SOURCES)
all: setup $(TARGET_LIB) $(TARGET_APP) BrowserServer.conf
setup:
@mkdir -p $(OBJDIR)
.PHONY: stage
stage: $(TARGET_APP) $(OBJDIR)/libYap.a
install -d $(STAGING_INCDIR)/Yap
install -m 444 Yap/YapDefs.h $(STAGING_INCDIR)/Yap
install -m 444 Yap/YapClient.h $(STAGING_INCDIR)/Yap
install -m 444 Yap/YapPacket.h $(STAGING_INCDIR)/Yap
install -m 444 Yap/YapProxy.h $(STAGING_INCDIR)/Yap
install -m 444 Yap/YapServer.h $(STAGING_INCDIR)/Yap
install -m 444 Yap/BufferLock.h $(STAGING_INCDIR)/Yap
install -m 444 Yap/OffscreenBuffer.h $(STAGING_INCDIR)/Yap
install -m 444 Src/IpcBuffer.h $(STAGING_INCDIR)
install -m 444 Src/BrowserRect.h $(STAGING_INCDIR)
install -m 444 Src/BrowserOffscreenInfo.h $(STAGING_INCDIR)
install -m 444 Src/BrowserOffscreenCalculations.h $(STAGING_INCDIR)
install -d $(STAGING_LIBDIR)
install -m 444 $(OBJDIR)/libYap.a $(STAGING_LIBDIR)/libYap.a
$(TARGET_LIB): $(LIB_OBJS)
$(AR) rcs $(TARGET_LIB) $(LIB_OBJS)
$(TARGET_APP): $(APP_OBJS) $(TARGET_LIB)
$(CXX) -o $(TARGET_APP) $(APP_OBJS) $(LIB_OBJS) $(LOCAL_LFLAGS)
qwebkitplatformplugin.moc.cpp: $(STAGING_INCDIR)/WebKitSupplemental/qwebkitplatformplugin.h
$(MOC) -o $@ $<
WebOSPlatformPlugin.moc.cpp: $(STAGING_INCDIR)/WebKitSupplemental/WebOSPlatformPlugin.h
$(MOC) -o $@ $<
BrowserComboBox.moc.cpp: BrowserComboBox.h
$(MOC) -o $@ $<
BrowserPage.moc.cpp: BrowserPage.h
$(MOC) -o $@ $<
.PHONY: BrowserServer.conf
BrowserServer.conf:
./conf/mergeconf.pl conf/BrowserServer_base.conf conf/BrowserServer_${MACHINE}.conf > $@
vpath %.cpp Yap Src
vpath %.h Src
$(OBJDIR)/%.o: %.cpp
$(CXX) -MD $(INCLUDES) $(LOCAL_CFLAGS) -c `readlink -fn $<` -o $@
-include $(SOURCES:%.cpp=$(OBJDIR)/%.d)
.PHONY: clean
clean:
rm -rf $(OBJDIR)
rm -rf $(STAGING_INCDIR)/Yap
rm -f $(OBJDIR)/libYap.a
rm -f $(STAGING_LIBDIR)/libYap.a
rm -f $(TARGET_APP)
rm -f BrowserPage.moc.cpp
rm -f BrowserServer.conf
rm -f BrowserComboBox.moc.cpp
rm -f qwebkitplatformplugin.moc.cpp
rm -f WebOSPlatformPlugin.moc.cpp
.PHONY: install
install:
mkdir -p $(INSTALL_DIR)/usr/bin
install -m 0775 $(BUILD_TYPE)-$(PLATFORM)/BrowserServer $(INSTALL_DIR)/usr/bin/BrowserServer
CodeGen/CodeGen: CodeGen/YapCodeGen.cpp CodeGen/BrowserYapCommandMessages.defs
bash -c "pushd CodeGen && qmake && popd"
make --directory=CodeGen
# Run this target after modifying BrowserYapCommandMessages.defs to generate the
# Yap code for both the browser-adapter and BrowserServer
.PHONY : code
code: CodeGen/CodeGen
bash -c "pushd CodeGen && ./CodeGen client Browser BrowserYapCommandMessages.defs && popd"
bash -c "pushd CodeGen && ./CodeGen server Browser BrowserYapCommandMessages.defs && popd"