70add89b083ae903bb11d5ef80142a15a2ef4059
[WebKit-https.git] / Source / WebKit2 / GNUmakefile.am
1 include $(srcdir)/Source/WebKit2/GNUmakefile.list.am
2
3 if ENABLE_WEBKIT2
4 # Shared libraries
5 lib_LTLIBRARIES += \
6         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
7
8 # Static libraries
9 noinst_LTLIBRARIES += \
10         libWebKit2Platform.la
11
12 # We need to make sure plugin process is always built with gtk2, because plugins like flash
13 # still use gtk2. Since webcore was built with gtk3, we need to build webcoregtk sources again with gtk2
14 noinst_LTLIBRARIES += \
15         libPlatformGtk2.la \
16         libWebCoreGtk2.la
17
18 libexec_PROGRAMS += \
19         Programs/WebKitPluginProcess
20 endif
21
22 # Platform
23 libWebKit2Platform_la_SOURCES = \
24         $(webkit2platform_sources)
25
26 libWebKit2Platform_la_CXXFLAGS = \
27         -fvisibility-inlines-hidden \
28         $(global_cxxflags)
29
30 libWebKit2Platform_la_CFLAGS = \
31         -fvisibility=hidden \
32         $(global_cflags)
33
34 libWebKit2Platform_la_CPPFLAGS = \
35         -DBUILDING_WEBKIT \
36         $(global_cppflags) \
37         -fno-strict-aliasing \
38         -std=c++11 \
39         -I$(srcdir)/Source \
40         -I$(srcdir)/Source/WTF \
41         -I$(srcdir)/Source/WebKit2/Platform \
42         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC \
43         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/gtk \
44         -I$(srcdir)/Source/WebKit2/Platform/gtk \
45         -I$(top_builddir)/DerivedSources/WebKit2/include \
46         $(COVERAGE_CFLAGS) \
47         $(GLIB_CFLAGS)
48
49
50 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
51         $(webkit2_h_api)
52
53 libwebkit2gtkincludedir = $(libwebkitgtkincludedir)/webkit2
54 nodist_libwebkit2gtkinclude_HEADERS = \
55         DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.h \
56         DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitVersion.h
57
58 libwebkit2gtkinclude_HEADERS = \
59         $(webkit2gtk_h_api) \
60         $(webkit2_web_extension_h_api)
61
62 nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
63         $(webkit2_built_sources) \
64         $(webkit2gtk_built_sources)
65
66 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
67         $(webkit2_sources)
68
69 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
70         -fno-strict-aliasing \
71         -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
72         -std=c++11 \
73         $(global_cppflags) \
74         -include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
75         -I$(srcdir)/Source/WebKit/gtk \
76         -I$(srcdir)/Source/WebKit2 \
77         -I$(srcdir)/Source/WebKit2/gtk \
78         -I$(srcdir)/Source/WebKit2/Platform \
79         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC \
80         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/gtk \
81         -I$(srcdir)/Source/WebKit2/Platform/gtk \
82         -I$(srcdir)/Source/WebKit2/PluginProcess \
83         -I$(srcdir)/Source/WebKit2/Shared \
84         -I$(srcdir)/Source/WebKit2/Shared/API \
85         -I$(srcdir)/Source/WebKit2/Shared/API/c \
86         -I$(srcdir)/Source/WebKit2/Shared/API/c/gtk \
87         -I$(srcdir)/Source/WebKit2/Shared/API/c/soup \
88         -I$(srcdir)/Source/WebKit2/Shared/Authentication \
89         -I$(srcdir)/Source/WebKit2/Shared/CoreIPCSupport \
90         -I$(srcdir)/Source/WebKit2/Shared/Downloads \
91         -I$(srcdir)/Source/WebKit2/Shared/Downloads/soup \
92         -I$(srcdir)/Source/WebKit2/Shared/gtk \
93         -I$(srcdir)/Source/WebKit2/Shared/Network \
94         -I$(srcdir)/Source/WebKit2/Shared/Plugins \
95         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape \
96         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/x11 \
97         -I$(srcdir)/Source/WebKit2/Shared/soup \
98         -I$(srcdir)/Source/WebKit2/UIProcess \
99         -I$(srcdir)/Source/WebKit2/UIProcess/API \
100         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
101         -I$(srcdir)/Source/WebKit2/UIProcess/API/C/gtk \
102         -I$(srcdir)/Source/WebKit2/UIProcess/API/C/soup \
103         -I$(srcdir)/Source/WebKit2/UIProcess/API/cpp \
104         -I$(srcdir)/Source/WebKit2/UIProcess/API/gtk \
105         -I$(srcdir)/Source/WebKit2/UIProcess/Authentication \
106         -I$(srcdir)/Source/WebKit2/UIProcess/Downloads \
107         -I$(srcdir)/Source/WebKit2/UIProcess/gtk \
108         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
109         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher/gtk \
110         -I$(srcdir)/Source/WebKit2/UIProcess/Notifications \
111         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins \
112         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/unix \
113         -I$(srcdir)/Source/WebKit2/UIProcess/Storage \
114         -I$(srcdir)/Source/WebKit2/UIProcess/soup \
115         -I$(srcdir)/Source/WebKit2/UIProcess/InspectorServer \
116         -I$(srcdir)/Source/WebKit2/WebProcess \
117         -I$(srcdir)/Source/WebKit2/WebProcess/ApplicationCache \
118         -I$(srcdir)/Source/WebKit2/WebProcess/Battery \
119         -I$(srcdir)/Source/WebKit2/WebProcess/Cookies \
120         -I$(srcdir)/Source/WebKit2/WebProcess/FullScreen \
121         -I$(srcdir)/Source/WebKit2/WebProcess/Geolocation \
122         -I$(srcdir)/Source/WebKit2/WebProcess/gtk \
123         -I$(srcdir)/Source/WebKit2/WebProcess/IconDatabase \
124         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
125         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API \
126         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
127         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/gtk \
128         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/DOM \
129         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/gtk \
130         -I$(srcdir)/Source/WebKit2/WebProcess/KeyValueStorage \
131         -I$(srcdir)/Source/WebKit2/WebProcess/Launching \
132         -I$(srcdir)/Source/WebKit2/WebProcess/MediaCache \
133         -I$(srcdir)/Source/WebKit2/WebProcess/NetworkInfo \
134         -I$(srcdir)/Source/WebKit2/WebProcess/Notifications \
135         -I$(srcdir)/Source/WebKit2/WebProcess/ResourceCache \
136         -I$(srcdir)/Source/WebKit2/WebProcess/Storage \
137         -I$(srcdir)/Source/WebKit2/WebProcess/soup \
138         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins \
139         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape \
140         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/unix \
141         -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport \
142         -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/gtk \
143         -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/soup \
144         -I$(srcdir)/Source/WebKit2/WebProcess/WebPage \
145         -I$(srcdir)/Source/WebKit2/WebProcess/WebPage/atk \
146         -I$(srcdir)/Source/WebKit2/WebProcess/WebPage/gtk \
147         -I$(top_builddir)/DerivedSources/WebKit2 \
148         -I$(top_builddir)/DerivedSources/WebKit2/include \
149         -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
150         -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
151         -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/webkit2 \
152         -I$(top_builddir)/DerivedSources/WebKit2/webkit2extension/include \
153         -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
154         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
155         -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
156         -I$(top_builddir)/DerivedSources/webkitdom \
157         -DLIBEXECDIR=\""$(libexecdir)"\" \
158         -DLIBDIR=\""$(libdir)"\" \
159         -DBUILDING_WEBKIT \
160         -DWEBKIT2_COMPILATION \
161         -DENABLE_PLUGIN_PROCESS=1 \
162         $(platform_cppflags) \
163         $(platformgtk_cppflags) \
164         $(webcore_cppflags) \
165         $(webcoregtk_cppflags) \
166         $(javascriptcore_cppflags) \
167         $(CLUTTER_CFLAGS) \
168         $(COVERAGE_CFLAGS) \
169         $(ENCHANT_CFLAGS) \
170         $(FREETYPE_CFLAGS) \
171         $(GEOCLUE_CFLAGS) \
172         $(GLIB_CFLAGS) \
173         $(GTK_CFLAGS) \
174         $(GTK_UNIX_PRINTING_CFLAGS) \
175         $(LIBSOUP_CFLAGS) \
176         $(UNICODE_CFLAGS) \
177         $(XCOMPOSITE_CFLAGS) \
178         $(XDAMAGE_CFLAGS) \
179         $(XT_CFLAGS)
180
181 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
182         $(global_cxxflags)
183
184 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
185         $(global_cflags)
186
187 # Artificial dependency to make sure libwebkit2gtk and libwebkitgtk are not linked at the same time
188 # The variable creation is to avoid having automake override the entire rule instead of adding the
189 # dependency.
190 if ENABLE_WEBKIT1
191 webkit2gtk_lib_for_dep = libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
192 $(webkit2gtk_lib_for_dep): libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
193 endif
194
195 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = \
196         $(libwebkit2gtkincludedir)/WebKit2
197
198 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
199         -version-info @LIBWEBKIT2GTK_VERSION@ \
200         $(version_script) \
201         $(no_undefined)
202
203 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD := \
204         -lpthread \
205         libWebCore.la \
206         libWebCorePlatform.la \
207         libWebCoreModules.la
208
209 if ENABLE_INDEXED_DATABASE
210 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
211         libLevelDB.la
212 endif
213
214 if USE_OPENGL
215 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
216         libANGLE.la
217 endif
218
219 if ENABLE_SVG
220 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
221         libWebCoreSVG.la
222 endif
223
224 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
225         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
226         libPlatform.la \
227         libPlatformGtk.la \
228         libWebCoreDOM.la \
229         libWebCoreGtk.la \
230         libWebKit2Platform.la \
231         $(CAIRO_LIBS) \
232         $(CLUTTER_LIBS) \
233         $(COVERAGE_LDFLAGS) \
234         $(ENCHANT_LIBS) \
235         $(FREETYPE_LIBS) \
236         $(GAIL_LIBS) \
237         $(GAMEPAD_LIBS) \
238         $(GEOCLUE_LIBS) \
239         $(GLIB_LIBS) \
240         $(GSTREAMER_LIBS) \
241         $(GTK_LIBS) \
242         $(GTK_UNIX_PRINTING_LIBS) \
243         $(JPEG_LIBS) \
244         $(LIBSECRET_LIBS) \
245         $(LIBSOUP_LIBS) \
246         $(LIBXML_LIBS) \
247         $(LIBXSLT_LIBS) \
248         $(OPENGL_LIBS) \
249         $(PANGO_LIBS) \
250         $(PNG_LIBS) \
251         $(SQLITE3_LIBS) \
252         $(UNICODE_LIBS) \
253         $(WEBP_LIBS) \
254         $(XRENDER_LIBS) \
255         $(XCOMPOSITE_LIBS) \
256         $(XDAMAGE_LIBS) \
257         $(XT_LIBS) \
258         $(ZLIB_LIBS)
259
260 if ENABLE_WEBKIT2
261 pkgconfig_DATA += Source/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
262
263 if ENABLE_INTROSPECTION
264
265 WebKit2-@WEBKITGTK_API_VERSION@.gir: $(G_IR_SCANNER) libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
266         $(AM_V_GEN) \
267              CFLAGS="$(CFLAGS) -Wno-deprecated-declarations" \
268              $(G_IR_SCANNER) \
269              --quiet \
270              --warn-all \
271              --symbol-prefix=webkit \
272              --identifier-prefix=WebKit \
273              --namespace=WebKit2 \
274              --nsversion=@WEBKITGTK_API_VERSION@ \
275              --include=GObject-2.0 \
276              --include=Gtk-3.0 \
277              --include=JavaScriptCore-@WEBKITGTK_API_VERSION@ \
278              --include=Soup-2.4 \
279              --library=webkit2gtk-@WEBKITGTK_API_VERSION@ \
280              --library=javascriptcoregtk-@WEBKITGTK_API_VERSION@ \
281              --libtool="$(LIBTOOL)" \
282              --pkg=gobject-2.0 \
283              --pkg=gtk+-@GTK_API_VERSION@ \
284              --pkg=libsoup-2.4 \
285              --pkg-export=webkit2gtk-@WEBKITGTK_API_VERSION@ \
286              --output=$@ \
287              --add-include-path=$(WebKit2) \
288              --add-include-path=$(top_builddir) \
289              --c-include="webkit2/webkit2.h" \
290              -I$(srcdir)/Source \
291              -I$(WebKit2) \
292              -I$(GENSOURCES) \
293              -I$(GENSOURCES_WEBKITDOM) \
294              -I$(GENSOURCES_WEBKIT2) \
295              -I$(top_builddir)/Source/WebKit2/UIProcess/API/gtk \
296              -I$(top_srcdir)/Source/JavaScriptCore/ForwardingHeaders \
297              -I$(top_srcdir) \
298              -I$(GENSOURCES_WEBKIT2)/webkit2gtk/include \
299              -I$(GENSOURCES_WEBKIT2)/webkit2gtk \
300              -DBUILDING_WEBKIT \
301              -DWEBKIT2_COMPILATION \
302              $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h \
303              $(webkit2gtk_h_api) \
304              $(webkitgtk_gdom_built_h_api) \
305              $(WebKit2)/UIProcess/API/gtk/*.cpp
306
307 WebKit2-@WEBKITGTK_API_VERSION@.typelib: WebKit2-@WEBKITGTK_API_VERSION@.gir $(G_IR_COMPILER)
308         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit2) --includedir $(top_builddir) $< -o $@
309
310 gir_DATA += WebKit2-@WEBKITGTK_API_VERSION@.gir
311 typelibs_DATA += WebKit2-@WEBKITGTK_API_VERSION@.typelib
312
313 CLEANFILES += WebKit2-@WEBKITGTK_API_VERSION@.gir WebKit2-@WEBKITGTK_API_VERSION@.typelib
314
315 endif
316 endif
317
318 stamp-webkit2-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(webkit2_sources)
319         $(AM_V_GEN)$(PERL) $< $(WebKit2) $(GENSOURCES_WEBKIT2)/include gtk \
320         && $(PERL) $< $(WebKit2) $(GENSOURCES_WEBKIT2)/include soup \
321         && echo timestamp > $(@F)
322
323 BUILT_SOURCES += $(top_builddir)/stamp-webkit2-forwarding-headers
324
325 $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
326         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/include \
327         && ln -n -s -f ${shell pwd}/$(WebKit2)/UIProcess/API/gtk $@
328
329 $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
330         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2extension/include \
331         && ln -n -s -f ${shell pwd}/$(WebKit2)/WebProcess/InjectedBundle/API/gtk $@
332
333 BUILT_SOURCES += \
334         $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2 \
335         $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2
336
337 vpath %.messages.in = \
338         $(WebKit2)/PluginProcess \
339         $(WebKit2)/Shared \
340         $(WebKit2)/Shared/Authentication \
341         $(WebKit2)/Shared/Plugins \
342         $(WebKit2)/UIProcess \
343         $(WebKit2)/UIProcess/ApplicationCache \
344         $(WebKit2)/UIProcess/Downloads \
345         $(WebKit2)/UIProcess/Geolocation \
346         $(WebKit2)/UIProcess/Notifications \
347         $(WebKit2)/UIProcess/Plugins \
348         $(WebKit2)/UIProcess/ResourceCache \
349         $(WebKit2)/UIProcess/Storage \
350         $(WebKit2)/UIProcess/soup \
351         $(WebKit2)/WebProcess \
352         $(WebKit2)/WebProcess/ApplicationCache \
353         $(WebKit2)/WebProcess/Battery \
354         $(WebKit2)/WebProcess/Cookies \
355         $(WebKit2)/WebProcess/FullScreen \
356         $(WebKit2)/WebProcess/Geolocation \
357         $(WebKit2)/WebProcess/IconDatabase \
358         $(WebKit2)/WebProcess/MediaCache \
359         $(WebKit2)/WebProcess/NetworkInfo \
360         $(WebKit2)/WebProcess/Notifications \
361         $(WebKit2)/WebProcess/Plugins \
362         $(WebKit2)/WebProcess/ResourceCache \
363         $(WebKit2)/WebProcess/Storage \
364         $(WebKit2)/WebProcess/WebCoreSupport \
365         $(WebKit2)/WebProcess/WebPage \
366         $(WebKit2)/WebProcess/soup
367
368 message_gen_scripts = \
369         $(WebKit2)/Scripts/generate-message-receiver.py \
370         $(WebKit2)/Scripts/generate-messages-header.py \
371         $(WebKit2)/Scripts/webkit2/__init__.py \
372         $(WebKit2)/Scripts/webkit2/messages.py \
373         $(WebKit2)/Scripts/webkit2/model.py \
374         $(WebKit2)/Scripts/webkit2/parser.py
375
376 # Message header generation
377 DerivedSources/WebKit2/%MessageReceiver.cpp: %.messages.in $(message_gen_scripts)
378         $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-message-receiver.py $< > $@
379
380 DerivedSources/WebKit2/%Messages.h: %.messages.in $(message_gen_scripts)
381         $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-messages-header.py $< > $@
382
383 webkit2gtk_built_headers_dir := $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2
384 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h: stamp-webkit2enumtypes
385         @true
386
387 stamp-webkit2enumtypes: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
388         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
389         && glib-mkenums --template $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.h.template $(libwebkit2gtkinclude_HEADERS) | \
390                 sed 's,web_kit,webkit,' | \
391                 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
392                 > wk2-xgen-gth \
393         && (cmp -s wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h || cp wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h) \
394         && rm -f wk2-xgen-gth \
395         && echo timestamp > $(@F)
396
397 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
398         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
399         && glib-mkenums --template $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.cpp.template $(libwebkit2gtkinclude_HEADERS) | \
400                 sed 's,web_kit,webkit,' \
401                 > wk2-xgen-gtc \
402         && cp wk2-xgen-gtc $@ \
403         && rm -f wk2-xgen-gtc
404
405 WEBKIT2_MARSHAL_LIST = $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list
406
407 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.cpp: stamp-webkit2marshal.cpp
408         @true
409 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.h: stamp-webkit2marshal.h
410         @true
411
412 stamp-webkit2marshal.cpp: $(WEBKIT2_MARSHAL_LIST)
413         $(AM_V_GEN) echo "extern \"C\" {" > $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
414         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --body >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
415         echo '}' >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
416         echo timestamp > $(@F)
417
418 stamp-webkit2marshal.h: $(WEBKIT2_MARSHAL_LIST)
419         $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --header > $(webkit2gtk_built_headers_dir)/WebKitMarshal.h && \
420         echo timestamp > $(@F)
421
422 CLEANFILES += \
423         $(BUILT_SOURCES) \
424         $(top_builddir)/stamp-webkit2enumtypes \
425         $(top_builddir)/stamp-webkit2marshal.cpp \
426         $(top_builddir)/stamp-webkit2marshal.h \
427         $(top_builddir)/Programs/WebKitWebProcess
428
429 DISTCLEANFILES += \
430         $(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
431
432 if ENABLE_WEBKIT2
433 libexec_PROGRAMS += \
434         Programs/WebKitWebProcess
435 endif
436
437 Programs_WebKitWebProcess_CPPFLAGS = \
438         -I$(srcdir)/Source/WebKit2 \
439         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
440         -I$(srcdir)/Source/WebKit2/WebProcess/gtk \
441         -I$(top_builddir)/DerivedSources/WebKit2 \
442         -I$(top_builddir)/DerivedSources/WebKit2/include \
443         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
444         -std=c++11 \
445         $(global_cppflags) \
446         $(javascriptcore_cppflags)
447
448 Programs_WebKitWebProcess_CFLAGS = \
449         $(global_cflags) \
450         $(CAIRO_CFLAGS) \
451         $(FREETYPE_CFLAGS) \
452         $(GLIB_CFLAGS) \
453         $(GTK_CFLAGS) \
454         $(GTK_UNIX_PRINTING_CFLAGS) \
455         $(LIBSOUP_CFLAGS) \
456         $(ZLIB_CFLAGS)
457
458 Programs_WebKitWebProcess_SOURCES = \
459         Source/WebKit2/gtk/MainGtk.cpp
460
461 Programs_WebKitWebProcess_LDADD = \
462         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
463         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
464         $(FREETYPE_LIBS) \
465         $(GLIB_LIBS) \
466         $(GTK_LIBS) \
467         $(GTK_UNIX_PRINTING_LIBS) \
468         $(LIBSOUP_LIBS)
469
470 libWebCoreGtk2_la_SOURCES = \
471         $(webcoregtk_sources)
472
473 libWebCoreGtk2_la_CXXFLAGS = \
474         -fvisibility-inlines-hidden \
475         $(global_cxxflags)
476
477 libWebCoreGtk2_la_CFLAGS = \
478         -fvisibility=hidden \
479         $(global_cflags)
480
481 libWebCoreGtk2_la_CPPFLAGS = \
482         -DBUILDING_WEBKIT \
483         -DGTK_API_VERSION_2=1 \
484         $(global_cppflags) \
485         $(platform_cppflags) \
486         $(platformgtk_cppflags) \
487         $(webcore_cppflags) \
488         $(webcoregtk_cppflags) \
489         $(javascriptcore_cppflags) \
490         -fno-strict-aliasing \
491         $(COVERAGE_CFLAGS) \
492         $(ENCHANT_CFLAGS) \
493         $(GEOCLUE_CFLAGS) \
494         $(FREETYPE_CFLAGS) \
495         $(GLIB_CFLAGS) \
496         $(GSTREAMER_CFLAGS) \
497         $(GTK2_CFLAGS) \
498         $(LIBSECRET_CFLAGS) \
499         $(LIBSOUP_CFLAGS) \
500         $(LIBXML_CFLAGS) \
501         $(LIBXSLT_CFLAGS) \
502         $(SQLITE3_CFLAGS) \
503         $(UNICODE_CFLAGS) \
504         $(XRENDER_CFLAGS) \
505         $(XT_CFLAGS)
506
507 libPlatformGtk2_la_SOURCES = \
508         $(platformgtk_sources)
509
510 libPlatformGtk2_la_CXXFLAGS = \
511         -fvisibility-inlines-hidden \
512         $(global_cxxflags)
513
514 libPlatformGtk2_la_CFLAGS = \
515         -fvisibility=hidden \
516         $(global_cflags)
517
518 libPlatformGtk2_la_CPPFLAGS = \
519         -DBUILDING_WEBKIT \
520         -DGTK_API_VERSION_2=1 \
521         $(global_cppflags) \
522         $(platform_cppflags) \
523         $(platformgtk_cppflags) \
524         $(platform_webcore_cppflags) \
525         $(javascriptcore_cppflags) \
526         -fno-strict-aliasing \
527         $(GTK2_CFLAGS) \
528         $(LIBSECRET_CFLAGS) \
529         $(LIBSOUP_CFLAGS)
530
531 # Injected Bundle
532 injectedbundledir = $(libdir)/webkit2gtk-3.0/injected-bundle
533 if ENABLE_WEBKIT2
534 injectedbundle_LTLIBRARIES = libwebkit2gtkinjectedbundle.la
535 endif
536
537 libwebkit2gtkinjectedbundle_la_SOURCES = \
538         Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp
539
540 libwebkit2gtkinjectedbundle_la_LDFLAGS = \
541         $(no_undefined) \
542         -module \
543         -avoid-version
544
545 libwebkit2gtkinjectedbundle_la_CPPFLAGS = \
546         -fno-strict-aliasing \
547         -I$(srcdir)/Source/WebKit2/Platform \
548         -I$(srcdir)/Source/WebKit2/Shared \
549         -I$(srcdir)/Source/WebKit2/Shared/API/c \
550         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
551         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
552         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
553         -I$(top_builddir)/DerivedSources/InjectedBundle \
554         -I$(top_builddir)/DerivedSources/WebKit2/include \
555         -std=c++11 \
556         $(global_cppflags) \
557         $(javascriptcore_cppflags) \
558         $(GLIB_CFLAGS)
559
560 # Serialize linking of the plugin process with both webkit libraries.
561 plugin_process_for_dep = Programs/WebKitPluginProcess
562 plugin_process_for_dep_list = libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
563 if ENABLE_WEBKIT1
564 plugin_process_for_dep_list += \
565         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
566 endif
567 $(plugin_process_for_dep): $(plugin_process_for_dep_list)
568
569 webcore_layer_gtk2_deps = \
570         libPlatform.la \
571         libPlatformGtk2.la \
572         libWebCorePlatform.la \
573         libWebCoreGtk2.la \
574         libWebCore.la \
575         libWebCoreModules.la
576 if ENABLE_SVG
577 webcore_layer_gtk2_deps += \
578         libWebCoreSVG.la
579 endif
580 if ENABLE_INDEXED_DATABASE
581 webcore_layer_gtk2_deps += \
582         libLevelDB.la
583 endif
584 if USE_OPENGL
585 webcore_layer_gtk2_deps += \
586         libANGLE.la
587 endif
588
589 webcore_layer_gtk2_archives = $(foreach lib, $(webcore_layer_gtk2_deps), $(shell echo $(lib) | sed "s/\(.*\)\.la/.libs\/\1.a/"))
590
591 WebCoreLayerGtk2.a: $(webcore_layer_gtk2_deps)
592         $(AM_V_GEN)
593         $(AM_V_at)$(foreach archive, $(webcore_layer_gtk2_archives), $(shell ar t $(archive) | xargs -n50 ar cruT $@))
594
595 Programs_WebKitPluginProcess_CPPFLAGS = \
596         -include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
597         -I$(srcdir)/Source/WebKit2 \
598         -I$(srcdir)/Source/WebKit2/Platform \
599         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/ \
600         -I$(srcdir)/Source/WebKit2/PluginProcess/ \
601         -I$(srcdir)/Source/WebKit2/PluginProcess/unix \
602         -I$(srcdir)/Source/WebKit2/Shared \
603         -I$(srcdir)/Source/WebKit2/Shared/Plugins \
604         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/ \
605         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/ \
606         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
607         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/ \
608         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/ \
609         -I$(srcdir)/Source/WebKit2/Shared/soup \
610         -I$(top_builddir)/DerivedSources/WebKit2 \
611         -I$(top_builddir)/DerivedSources/WebKit2/include \
612         -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
613         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
614         -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
615         -DBUILDING_WEBKIT \
616         -DGTK_API_VERSION_2=1 \
617         -DENABLE_PLUGIN_PROCESS=1 \
618         -DLIBEXECDIR=\""$(libexecdir)"\" \
619         -std=c++11 \
620         $(global_cppflags) \
621         $(platform_cppflags) \
622         $(platformgtk_cppflags) \
623         $(webcore_cppflags) \
624         $(webcoregtk_cppflags) \
625         $(javascriptcore_cppflags) \
626         -fno-strict-aliasing \
627         $(CAIRO_CFLAGS) \
628         $(FREETYPE_CFLAGS) \
629         $(GLIB_CFLAGS) \
630         $(GSTREAMER_CFLAGS) \
631         $(GTK2_CFLAGS) \
632         $(LIBSOUP_CFLAGS) \
633         $(UNICODE_CFLAGS)
634
635 Programs_WebKitPluginProcess_CFLAGS = \
636         -fvisibility-inlines-hidden \
637         $(global_cflags) \
638         $(CAIRO_CFLAGS) \
639         $(GLIB_CFLAGS) \
640         $(GSTREAMER_CFLAGS) \
641         $(GTK2_CFLAGS) \
642         $(LIBSOUP_CFLAGS) \
643         $(UNICODE_CFLAGS)
644
645 nodist_Programs_WebKitPluginProcess_SOURCES = \
646         $(webkit2_plugin_process_built_sources)
647
648 Programs_WebKitPluginProcess_SOURCES = \
649         $(webkit2_plugin_process_sources)
650
651 Programs_WebKitPluginProcess_LDADD = \
652         -lpthread \
653         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
654         WebCoreLayerGtk2.a \
655         libWebKit2Platform.la \
656         $(CAIRO_LIBS) \
657         $(COVERAGE_LDFLAGS) \
658         $(FREETYPE_LIBS) \
659         $(GAMEPAD_LIBS) \
660         $(GEOCLUE_LIBS) \
661         $(GLIB_LIBS) \
662         $(GSTREAMER_LIBS) \
663         $(GTK2_LIBS) \
664         $(JPEG_LIBS) \
665         $(LIBSECRET_LIBS) \
666         $(LIBSOUP_LIBS) \
667         $(LIBXML_LIBS) \
668         $(LIBXSLT_LIBS) \
669         $(OLE32_LIBS) \
670         $(OPENGL_LIBS) \
671         $(PANGO_LIBS) \
672         $(PNG_LIBS) \
673         $(SHLWAPI_LIBS) \
674         $(SHM_LIBS) \
675         $(SQLITE3_LIBS) \
676         $(UNICODE_LIBS) \
677         $(WEBP_LIBS) \
678         $(XRENDER_LIBS) \
679         $(XT_LIBS) \
680         $(WINMM_LIBS) \
681         $(ZLIB_LIBS)
682
683 Programs_WebKitPluginProcess_CXXFLAGS = \
684         -fvisibility-inlines-hidden \
685         $(global_cxxflags)
686
687 EXTRA_DIST += \
688         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
689         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
690         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk.types \
691         $(WebKit2)/Scripts/generate-message-receiver.py \
692         $(WebKit2)/Scripts/generate-messages-header.py \
693         $(WebKit2)/Scripts/webkit2/__init__.py \
694         $(WebKit2)/Scripts/webkit2/messages.py \
695         $(WebKit2)/Scripts/webkit2/model.py \
696         $(WebKit2)/Scripts/webkit2/parser.py \
697         $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list \
698         $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.h.template \
699         $(WebKit2)/UIProcess/API/gtk/WebKitEnumTypes.cpp.template \
700         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html \
701         $(WebKit2)/Scripts/generate-forwarding-headers.pl \
702         $(shell ls $(WebKit2)/PluginProcess/*.in) \
703         $(shell ls $(WebKit2)/Shared/*.in) \
704         $(shell ls $(WebKit2)/Shared/Authentication/*.in) \
705         $(shell ls $(WebKit2)/Shared/Plugins/*.in) \
706         $(shell ls $(WebKit2)/UIProcess/*.in) \
707         $(shell ls $(WebKit2)/UIProcess/Downloads/*.in) \
708         $(shell ls $(WebKit2)/UIProcess/Notifications/*.in) \
709         $(shell ls $(WebKit2)/UIProcess/Plugins/*.in) \
710         $(shell ls $(WebKit2)/UIProcess/Storage/*.in) \
711         $(shell ls $(WebKit2)/UIProcess/soup/*.in) \
712         $(shell ls $(WebKit2)/WebProcess/*.in) \
713         $(shell ls $(WebKit2)/WebProcess/ApplicationCache/*.in) \
714         $(shell ls $(WebKit2)/WebProcess/Battery/*.in) \
715         $(shell ls $(WebKit2)/WebProcess/Cookies/*.in) \
716         $(shell ls $(WebKit2)/WebProcess/FullScreen/*.in) \
717         $(shell ls $(WebKit2)/WebProcess/Geolocation/*.in) \
718         $(shell ls $(WebKit2)/WebProcess/IconDatabase/*.in) \
719         $(shell ls $(WebKit2)/WebProcess/MediaCache/*.in) \
720         $(shell ls $(WebKit2)/WebProcess/NetworkInfo/*.in) \
721         $(shell ls $(WebKit2)/WebProcess/Notifications/*.in) \
722         $(shell ls $(WebKit2)/WebProcess/Plugins/*.in) \
723         $(shell ls $(WebKit2)/WebProcess/ResourceCache/*.in) \
724         $(shell ls $(WebKit2)/WebProcess/Storage/*.in) \
725         $(shell ls $(WebKit2)/WebProcess/WebCoreSupport/*.in) \
726         $(shell ls $(WebKit2)/WebProcess/WebPage/*.in) \
727         $(shell ls $(WebKit2)/WebProcess/soup/*.in)
728
729 # Installing remote inspector files
730 remoteinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
731 remoteinspector_DATA = \
732         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
733