-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.Ubuntu
183 lines (149 loc) · 5 KB
/
Makefile.Ubuntu
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
STAGING_INCDIR := ${STAGING_DIR}/include
STAGING_LIBDIR := ${STAGING_DIR}/lib
ISIS_ROOT_DIR := ${HOME}/.isis
BUILD_TYPE := debug
PLATFORM ?= x86
MACHINE := desktop
MOC := ${QT_INSTALL_PREFIX}/bin/moc
INCLUDES := \
-isystem $(STAGING_INCDIR) \
-isystem $(STAGING_INCDIR)/webkit \
-I./Src \
-I./Yap \
-I$(STAGING_INCDIR) \
-I$(STAGING_INCDIR)/ime \
-I$(STAGING_INCDIR)/QtWebKit \
-I$(STAGING_INCDIR)/WebKitSupplemental \
-I$(QT_INSTALL_PREFIX)/include/ \
-I$(QT_INSTALL_PREFIX)/include/Qt \
-I$(QT_INSTALL_PREFIX)/include/QtCore \
-I$(QT_INSTALL_PREFIX)/include/QtGui \
-I$(QT_INSTALL_PREFIX)/include/QtNetwork \
$(shell pkg-config --cflags glib-2.0) \
$(shell pkg-config --cflags luna-service2) \
$(shell pkg-config --cflags pbnjson_cpp)
LIBS := \
-L$(QT_INSTALL_PREFIX)/lib \
-L$(STAGING_LIBDIR) \
-lQtWebKit \
-lQtGui \
-lQtNetwork \
-lQtCore \
-lpbnjson_cpp \
-lpbnjson_c \
-lyajl \
-lWebKitMisc \
-lpthread \
-lglib-2.0 \
-ldl \
$(shell pkg-config --libs gthread-2.0) \
$(shell pkg-config --libs luna-service2) \
$(shell pkg-config --libs pbnjson_cpp)
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) -DQT_WEBOS -DISIS_DESKTOP
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 \
Settings.cpp \
BrowserPage.moc.cpp \
BrowserComboBox.cpp \
BrowserComboBox.moc.cpp \
qwebkitplatformplugin.moc.cpp \
JsonUtils.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
mkdir -p $(STAGING_DIR)/bin
install -m 0775 $(TARGET_APP) $(STAGING_DIR)/bin/BrowserServer
mkdir -p $(ISIS_ROOT_DIR)/conf
install -m 644 BrowserServer.conf $(ISIS_ROOT_DIR)/conf
install -m 644 schema/HitTest.schema $(ISIS_ROOT_DIR)/conf
install -m 644 schema/InteractiveWidgetRect.schema $(ISIS_ROOT_DIR)/conf
$(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 > $@
perl -p -i -e "s{ISIS_ROOT_DIR}{$(ISIS_ROOT_DIR)}g" $@
vpath %.cpp Yap Src
vpath %.h Src
$(OBJDIR)/%.o: %.cpp
$(CXX) -MD $(INCLUDES) $(LOCAL_CFLAGS) -c `readlink -fn $<` -o $@
-include $(SOURCES:%.cpp=$(OBJDIR)/%.d)
deb:
dpkg-buildpackage -rfakeroot
.PHONY: clean
clean:
rm -rf $(OBJDIR)
rm -f $(OBJDIR)/libYap.a
rm -rf $(STAGING_INCDIR)/Yap
rm -rf $(STAGING_INCDIR)/Yap
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
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"