2011-03-31 Xan Lopez <xlopez@igalia.com>
[WebKit-https.git] / Source / WebKit / gtk / GNUmakefile.am
1
2 # Programs to run the WebKitGtk unit tests
3 GTESTER = gtester
4 GTESTER_REPORT = gtester-report
5
6 lib_LTLIBRARIES += \
7         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
8
9 nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
10         $(webkitgtk_built_sources)
11
12 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/webkit
13 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
14         $(webkitgtk_static_h_api)
15
16 nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
17         $(webkitgtk_built_h_api) \
18         $(GENSOURCES_WEBKIT)/webkitenumtypes.h
19
20 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
21         $(webcoregtk_sources) \
22         $(webkitgtk_sources)
23
24 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
25         $(SYMBOL_VISIBILITY_INLINES) \
26         $(global_cxxflags)
27
28 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
29         $(SYMBOL_VISIBILITY) \
30         $(global_cflags)
31
32 if ENABLE_SPELLCHECK
33 webkitgtk_cppflags += \
34         -DENABLE_SPELLCHECK=1
35
36 webkitgtk_sources += \
37         Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.cpp \
38         Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.h
39 endif
40
41 # When building WebCore/WebKit, we want WebCore/config.h and NOT JavaScriptCore/config.h,
42 # hence, it's important that WebCore/ should come first before JavaScriptCore in the
43 # include path.
44 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
45         -DBUILDING_WEBKIT \
46         -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
47         -DDATA_DIR=\"${datadir}\" \
48         -I$(WebCore)/bindings \
49         -I$(WebCore)/bindings/gobject \
50         -I$(WebKit) \
51         -I$(WebKit)/WebCoreSupport \
52         -I$(WebKit)/webkit \
53         -I$(GENSOURCES_WEBKIT) \
54         -ISource/WebKit/gtk/webkit \
55         $(global_cppflags) \
56         $(webcore_cppflags) \
57         $(webcoregtk_cppflags) \
58         $(javascriptcore_cppflags) \
59         $(webkitgtk_cppflags) \
60         -fno-strict-aliasing \
61         $(HILDON_CPPFLAGS) \
62         $(COVERAGE_CFLAGS) \
63         $(ENCHANT_CFLAGS) \
64         $(GAIL_CFLAGS) \
65         $(GEOCLUE_CFLAGS) \
66         $(GLIB_CFLAGS) \
67         $(GSTREAMER_CFLAGS) \
68         $(GTK_CFLAGS) \
69         $(HILDON_CFLAGS) \
70         $(LIBSOUP_CFLAGS) \
71         $(LIBXML_CFLAGS) \
72         $(LIBXSLT_CFLAGS) \
73         $(SQLITE3_CFLAGS) \
74         $(UNICODE_CFLAGS) \
75         $(XT_CFLAGS)
76
77 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
78         -version-info @LIBWEBKITGTK_VERSION@ \
79         $(version_script) \
80         $(no_undefined)
81
82 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
83         -lpthread \
84         libWebCore.la \
85         libJavaScriptCore.la \
86         $(webcore_ldflags) \
87         $(CAIRO_LIBS) \
88         $(COVERAGE_LDFLAGS) \
89         $(ENCHANT_LIBS) \
90         $(FREETYPE_LIBS) \
91         $(GAIL_LIBS) \
92         $(GEOCLUE_LIBS) \
93         $(GLIB_LIBS) \
94         $(GSTREAMER_LIBS) \
95         $(GTK_LIBS) \
96         $(HILDON_LIBS) \
97         $(JPEG_LIBS) \
98         $(LIBSOUP_LIBS) \
99         $(LIBXML_LIBS) \
100         $(LIBXSLT_LIBS) \
101         $(PANGO_LIBS) \
102         $(PNG_LIBS) \
103         $(SQLITE3_LIBS) \
104         $(UNICODE_LIBS) \
105         $(XRENDER_LIBS) \
106         $(XT_LIBS) \
107         $(WINMM_LIBS) \
108         $(SHLWAPI_LIBS) \
109         $(OLE32_LIBS)
110
111 webkitgtk_static_h_api += \
112         $(srcdir)/Source/WebKit/gtk/webkit/webkit.h \
113         $(srcdir)/Source/WebKit/gtk/webkit/webkitapplicationcache.h \
114         $(srcdir)/Source/WebKit/gtk/webkit/webkitdefines.h \
115         $(srcdir)/Source/WebKit/gtk/webkit/webkitdownload.h \
116         $(srcdir)/Source/WebKit/gtk/webkit/webkiterror.h \
117         $(srcdir)/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
118         $(srcdir)/Source/WebKit/gtk/webkit/webkitglobals.h \
119         $(srcdir)/Source/WebKit/gtk/webkit/webkithittestresult.h \
120         $(srcdir)/Source/WebKit/gtk/webkit/webkiticondatabase.h \
121         $(srcdir)/Source/WebKit/gtk/webkit/webkitnetworkrequest.h \
122         $(srcdir)/Source/WebKit/gtk/webkit/webkitnetworkresponse.h \
123         $(srcdir)/Source/WebKit/gtk/webkit/webkitsecurityorigin.h \
124         $(srcdir)/Source/WebKit/gtk/webkit/webkitsoupauthdialog.h \
125         $(srcdir)/Source/WebKit/gtk/webkit/webkitviewportattributes.h \
126         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebbackforwardlist.h \
127         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebdatabase.h \
128         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebdatasource.h \
129         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebframe.h \
130         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebhistoryitem.h \
131         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebinspector.h \
132         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebnavigationaction.h \
133         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebplugin.h \
134         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebplugindatabase.h \
135         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebpolicydecision.h \
136         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebresource.h \
137         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebsettings.h \
138         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
139         $(srcdir)/Source/WebKit/gtk/webkit/webkitwebview.h
140
141 webkitgtk_built_h_api += \
142         Source/WebKit/gtk/webkit/webkitversion.h
143
144 webkitgtk_h_api += \
145         $(webkitgtk_built_h_api) \
146         $(webkitgtk_static_h_api)
147
148 # webkitenumtypes.{h,cpp} cannot be in webkitgtk_built_h_api, because
149 # the rule that builds it depends on webkitgtk_built_h_api (circular dependency).
150 webkitgtk_built_sources += \
151         DerivedSources/webkit/webkitenumtypes.cpp \
152         DerivedSources/webkit/webkitenumtypes.h \
153         DerivedSources/webkit/webkitmarshal.cpp \
154         DerivedSources/webkit/webkitmarshal.h \
155         $(webkitgtk_built_h_api) \
156         $(webkitgtk_gdom_built_sources) 
157 BUILT_SOURCES += $(webkitgtk_built_sources)
158
159 webkitgtk_sources += \
160         Source/WebCore/bindings/gobject/ConvertToUTF8String.cpp \
161         Source/WebCore/bindings/gobject/ConvertToUTF8String.h \
162         Source/WebCore/bindings/gobject/DOMObjectCache.cpp \
163         Source/WebCore/bindings/gobject/DOMObjectCache.h \
164         Source/WebCore/bindings/gobject/GObjectEventListener.cpp \
165         Source/WebCore/bindings/gobject/GObjectEventListener.h \
166         Source/WebCore/bindings/gobject/WebKitDOMBinding.cpp \
167         Source/WebCore/bindings/gobject/WebKitDOMBinding.h \
168         Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp \
169         Source/WebCore/bindings/gobject/WebKitDOMEventTarget.h \
170         Source/WebCore/bindings/gobject/WebKitDOMEventTargetPrivate.h \
171         Source/WebCore/bindings/gobject/WebKitDOMObject.cpp \
172         Source/WebCore/bindings/gobject/WebKitDOMObject.h \
173         Source/WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.cpp \
174         Source/WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.h \
175         Source/WebKit/gtk/WebCoreSupport/AssertMatchingEnums.cpp \
176         Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
177         Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
178         Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
179         Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
180         Source/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \
181         Source/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \
182         Source/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
183         Source/WebKit/gtk/WebCoreSupport/DragClientGtk.h \
184         Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp \
185         Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h \
186         Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
187         Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
188         Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
189         Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
190         Source/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h \
191         Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp \
192         Source/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h \
193         Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
194         Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
195         Source/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
196         Source/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
197         Source/WebKit/gtk/webkit/webkitapplicationcache.cpp \
198         Source/WebKit/gtk/webkit/webkitdownload.cpp \
199         Source/WebKit/gtk/webkit/webkitdownloadprivate.h \
200         Source/WebKit/gtk/webkit/webkiterror.cpp \
201         Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
202         Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h \
203         Source/WebKit/gtk/webkit/webkitglobals.cpp \
204         Source/WebKit/gtk/webkit/webkitglobals.h \
205         Source/WebKit/gtk/webkit/webkitglobalsprivate.h \
206         Source/WebKit/gtk/webkit/webkithittestresult.cpp \
207         Source/WebKit/gtk/webkit/webkithittestresultprivate.h \
208         Source/WebKit/gtk/webkit/webkiticondatabase.cpp \
209         Source/WebKit/gtk/webkit/webkitnetworkrequest.cpp \
210         Source/WebKit/gtk/webkit/webkitnetworkrequestprivate.h \
211         Source/WebKit/gtk/webkit/webkitnetworkresponse.cpp \
212         Source/WebKit/gtk/webkit/webkitnetworkresponseprivate.h \
213         Source/WebKit/gtk/webkit/webkitsecurityorigin.cpp \
214         Source/WebKit/gtk/webkit/webkitsecurityoriginprivate.h \
215         Source/WebKit/gtk/webkit/webkitsoupauthdialog.c \
216         Source/WebKit/gtk/webkit/webkitversion.cpp \
217         Source/WebKit/gtk/webkit/webkitviewportattributes.cpp \
218         Source/WebKit/gtk/webkit/webkitviewportattributesprivate.h \
219         Source/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
220         Source/WebKit/gtk/webkit/webkitwebbackforwardlistprivate.h \
221         Source/WebKit/gtk/webkit/webkitwebdatabase.cpp \
222         Source/WebKit/gtk/webkit/webkitwebdatasource.cpp \
223         Source/WebKit/gtk/webkit/webkitwebdatasourceprivate.h \
224         Source/WebKit/gtk/webkit/webkitwebframe.cpp \
225         Source/WebKit/gtk/webkit/webkitwebframeprivate.h \
226         Source/WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
227         Source/WebKit/gtk/webkit/webkitwebhistoryitemprivate.h \
228         Source/WebKit/gtk/webkit/webkitwebinspector.cpp \
229         Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h \
230         Source/WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
231         Source/WebKit/gtk/webkit/webkitwebnavigationactionprivate.h \
232         Source/WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
233         Source/WebKit/gtk/webkit/webkitwebpolicydecisionprivate.h \
234         Source/WebKit/gtk/webkit/webkitwebresource.cpp \
235         Source/WebKit/gtk/webkit/webkitwebresourceprivate.h \
236         Source/WebKit/gtk/webkit/webkitwebplugin.cpp \
237         Source/WebKit/gtk/webkit/webkitwebpluginprivate.h \
238         Source/WebKit/gtk/webkit/webkitwebplugindatabase.cpp \
239         Source/WebKit/gtk/webkit/webkitwebplugindatabaseprivate.h \
240         Source/WebKit/gtk/webkit/webkitwebsettings.cpp \
241         Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h \
242         Source/WebKit/gtk/webkit/webkitwebview.cpp \
243         Source/WebKit/gtk/webkit/webkitwebviewprivate.h \
244         Source/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp \
245         Source/WebKit/gtk/webkit/webkitwebwindowfeaturesprivate.h
246
247 pkgconfigdir = $(libdir)/pkgconfig
248 pkgconfig_DATA = Source/WebKit/gtk/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc
249
250 if ENABLE_INTROSPECTION
251
252 JSCore-@WEBKITGTK_API_VERSION@.gir: $(top_builddir)/Source/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir
253         $(AM_V_GEN)cp $(top_builddir)/Source/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir $(top_builddir)/
254
255 JSCORE_GIRSOURCES += JSCore-@WEBKITGTK_API_VERSION@.gir
256 WEBKIT_GIRSOURCES += WebKit-@WEBKITGTK_API_VERSION@.gir
257
258 $(WEBKIT_GIRSOURCES): $(G_IR_SCANNER) $(JSCORE_GIRSOURCES) libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
259         $(AM_V_GEN)$(G_IR_SCANNER) -v --warn-all \
260              --symbol-prefix=webkit \
261              --identifier-prefix=WebKit \
262              --namespace=WebKit \
263              --nsversion=@WEBKITGTK_API_VERSION@ \
264              --include=GObject-2.0 \
265              --include=Gtk-@GTK_API_VERSION@ \
266              --include=JSCore-@WEBKITGTK_API_VERSION@ \
267              --include=Soup-2.4 \
268              --library=webkitgtk-@WEBKITGTK_API_VERSION@ \
269              --libtool="$(LIBTOOL)" \
270              --pkg=gobject-2.0 \
271              --pkg=gtk+-@GTK_API_VERSION@ \
272              --pkg=libsoup-2.4 \
273              --output=$@ \
274              --add-include-path=$(WebKit) \
275              --add-include-path=$(top_builddir) \
276              -I$(srcdir)/Source \
277              -I$(WebKit) \
278              -I$(GENSOURCES) \
279              -I$(GENSOURCES_WEBKIT) \
280              -I$(top_builddir)/Source/WebKit/gtk \
281              -I$(top_srcdir)/Source/JavaScriptCore/ForwardingHeaders \
282              -I$(top_srcdir) \
283              $(GENSOURCES_WEBKIT)/webkitenumtypes.h \
284              $(webkitgtk_h_api) \
285              $(WebKit)/webkit/*.cpp \
286              $(WebKit)/webkit/*.c
287
288 girdir = $(datadir)/gir-1.0
289 gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)
290
291 typelibsdir += $(libdir)/girepository-1.0
292 typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
293
294 %.typelib: %.gir $(G_IR_COMPILER)
295         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit) --includedir $(top_builddir) $< -o $@
296
297 CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
298
299 endif
300
301 EXTRA_DIST += $(top_builddir)/Source/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir
302
303 WEBKIT_MARSHAL_LIST = $(WebKit)/webkitmarshal.list
304 $(GENSOURCES_WEBKIT)/webkitmarshal.cpp: stamp-webkitmarshal.cpp
305         @true
306 $(GENSOURCES_WEBKIT)/webkitmarshal.h: stamp-webkitmarshal.h
307         @true
308
309 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
310         $(AM_V_GEN) echo "extern \"C\" {" > $(GENSOURCES_WEBKIT)/webkitmarshal.cpp && \
311         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(GENSOURCES_WEBKIT)/webkitmarshal.cpp && \
312         echo '}' >> $(GENSOURCES_WEBKIT)/webkitmarshal.cpp && \
313         echo timestamp > $(@F)
314
315 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
316         $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(GENSOURCES_WEBKIT)/webkitmarshal.h && \
317         echo timestamp > $(@F)
318
319 $(GENSOURCES_WEBKIT)/webkitenumtypes.h: stamp-webkitenumtypes.h
320         @true
321 stamp-webkitenumtypes.h: $(webkitgtk_h_api) $(WebKit)/GNUmakefile.am
322         $(AM_V_GEN)glib-mkenums \
323                         --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
324                         --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
325                         --fhead "#include <glib-object.h>\n\n" \
326                         --fhead "#include <webkit/webkitdefines.h>\n\n" \
327                         --fhead "G_BEGIN_DECLS\n\n" \
328                         --ftail "G_END_DECLS\n\n" \
329                         --ftail "#endif\n" \
330                         --fprod "#include <webkit/@basename@>\n\n" \
331                         --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
332                         --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
333                 $(webkitgtk_h_api) | \
334                 sed 's,web_kit,webkit,' | \
335                 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
336                 > xgen-gth \
337         && (cmp -s xgen-gth $(GENSOURCES_WEBKIT)/webkitenumtypes.h || cp xgen-gth $(GENSOURCES_WEBKIT)/webkitenumtypes.h) \
338         && rm -f xgen-gth \
339         && echo timestamp > $(@F)
340
341 $(GENSOURCES_WEBKIT)/webkitenumtypes.cpp: $(webkitgtk_h_api) $(WebKit)/GNUmakefile.am
342         $(AM_V_GEN)glib-mkenums \
343                         --fhead "#include <config.h>\n" \
344                         --fhead "#include <glib-object.h>\n" \
345                         --fhead "#include \"$(GENSOURCES_WEBKIT)/webkitenumtypes.h\"\n\n" \
346                         --fhead "extern \"C\" {\n\n" \
347                         --fprod "\n/* enumerations from \"@filename@\" */" \
348                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
349                         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
350                         --vtail "    { 0, NULL, NULL }\n};\n\n" \
351                         --vtail "GType @enum_name@_get_type(void)\n{\n" \
352                         --vtail "    static GType type = 0;\n\n" \
353                         --vtail "    if (!type)\n" \
354                         --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
355                         --vtail "    return type;\n}\n\n" \
356                         --ftail "}\n" \
357                 $(webkitgtk_h_api) | \
358                 sed 's,web_kit,webkit,' \
359                 > xgen-gtc \
360         && cp xgen-gtc $@ \
361         && rm -f xgen-gtc
362
363 # GSettings
364 gsettings_SCHEMAS = $(top_builddir)/Source/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml
365 @GSETTINGS_RULES@
366
367 EXTRA_DIST += \
368         $(WebKit)/ChangeLog \
369         $(WebKit)/NEWS \
370         $(WebKit)/webkitmarshal.list \
371         $(WebKit)/docs/GNUmakefile.* \
372         $(WebKit)/docs/webkitenvironment.xml \
373         $(WebKit)/docs/webkitgtk-docs.sgml \
374         $(WebKit)/docs/webkitgtk-sections.txt \
375         $(WebKit)/docs/version.xml.in \
376         $(WebKit)/po/* \
377         $(WebKit)/resources/* \
378         $(WebKit)/tests/resources/* \
379         $(WebKit)/tests/test_utils.h \
380         $(WebKit)/org.webkitgtk.gschema.xml.in
381
382 # extra resource files
383 resourcesdir = ${datadir}/webkit-@WEBKITGTK_API_VERSION@/resources
384 dist_resources_DATA = \
385         $(shell ls $(srcdir)/Source/WebKit/gtk/resources/*.html)
386
387 # Build unit tests
388 noinst_PROGRAMS += $(TEST_PROGS)
389 webkit_tests_cflags = \
390         -fno-strict-aliasing \
391         -I$(srcdir)/Source/JavaScriptCore/ForwardingHeaders \
392         -I$(WebKit) \
393         -I$(GENSOURCES) \
394         -I$(top_builddir)/Source/WebKit/gtk \
395         -I$(top_srcdir)/Source/WebCore/bindings \
396         -I$(top_srcdir)/Source/WebCore/bindings/gobject \
397         $(global_cppflags) \
398         $(global_cflags) \
399         $(javascriptcore_cppflags) \
400         $(GLIB_CFLAGS) \
401         $(GTK_CFLAGS) \
402         $(LIBSOUP_CFLAGS)
403
404 webkit_tests_ldadd = \
405         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
406         $(GTK_LIBS) \
407         $(GLIB_LIBS) \
408         $(LIBSOUP_LIBS)
409
410 webkit_tests_ldflags = \
411         -no-install \
412         -no-fast-install
413
414 TEST_PROGS += \
415         Programs/unittests/testapplicationcache \
416         Programs/unittests/testdomdocument \
417         Programs/unittests/testdomdomwindow \
418         Programs/unittests/testdomnode \
419         Programs/unittests/testhttpbackend \
420         Programs/unittests/testloading \
421         Programs/unittests/testglobals \
422         Programs/unittests/testmimehandling \
423         Programs/unittests/testnetworkrequest \
424         Programs/unittests/testnetworkresponse \
425         Programs/unittests/testwebframe \
426         Programs/unittests/testwebbackforwardlist \
427         Programs/unittests/testwebhistoryitem \
428         Programs/unittests/testwindow \
429         Programs/unittests/testdownload \
430         Programs/unittests/testatk \
431         Programs/unittests/testatkroles \
432         Programs/unittests/testhittestresult \
433         Programs/unittests/testwebsettings \
434         Programs/unittests/testwebresource \
435         Programs/unittests/testwebdatasource \
436         Programs/unittests/testwebplugindatabase \
437         Programs/unittests/testwebview \
438         Programs/unittests/testkeyevents \
439         Programs/unittests/testcopyandpaste
440
441 # Add additional tests here
442 Programs_unittests_testapplicationcache_SOURCES = Source/WebKit/gtk/tests/testapplicationcache.c
443 Programs_unittests_testapplicationcache_CFLAGS = $(webkit_tests_cflags)
444 Programs_unittests_testapplicationcache_LDADD = $(webkit_tests_ldadd)
445 Programs_unittests_testapplicationcache_LDFLAGS = $(webkit_tests_ldflags)
446
447 Programs_unittests_testdomdocument_SOURCES = Source/WebKit/gtk/tests/testdomdocument.c
448 Programs_unittests_testdomdocument_CFLAGS = $(webkit_tests_cflags)
449 Programs_unittests_testdomdocument_LDADD = $(webkit_tests_ldadd)
450 Programs_unittests_testdomdocument_LDFLAGS = $(webkit_tests_ldflags)
451
452 Programs_unittests_testdomdomwindow_SOURCES = Source/WebKit/gtk/tests/testdomdomwindow.c
453 Programs_unittests_testdomdomwindow_CFLAGS = $(webkit_tests_cflags)
454 Programs_unittests_testdomdomwindow_LDADD = $(webkit_tests_ldadd)
455 Programs_unittests_testdomdomwindow_LDFLAGS = $(webkit_tests_ldflags)
456
457 Programs_unittests_testdomnode_SOURCES = Source/WebKit/gtk/tests/testdomnode.c
458 Programs_unittests_testdomnode_CFLAGS = $(webkit_tests_cflags)
459 Programs_unittests_testdomnode_LDADD = $(webkit_tests_ldadd)
460 Programs_unittests_testdomnode_LDFLAGS = $(webkit_tests_ldflags)
461
462 Programs_unittests_testhttpbackend_SOURCES = Source/WebKit/gtk/tests/testhttpbackend.c
463 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
464 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
465 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
466
467 Programs_unittests_testglobals_SOURCES = Source/WebKit/gtk/tests/testglobals.c
468 Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags)
469 Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd)
470 Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags)
471
472 Programs_unittests_testloading_SOURCES = Source/WebKit/gtk/tests/testloading.c
473 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
474 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
475 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
476
477 Programs_unittests_testmimehandling_SOURCES = Source/WebKit/gtk/tests/testmimehandling.c Source/WebKit/gtk/tests/test_utils.c
478 Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
479 Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
480 Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)
481
482 Programs_unittests_testnetworkrequest_SOURCES = Source/WebKit/gtk/tests/testnetworkrequest.c
483 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
484 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
485 Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
486
487 Programs_unittests_testnetworkresponse_SOURCES = Source/WebKit/gtk/tests/testnetworkresponse.c
488 Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags)
489 Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd)
490 Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags)
491
492 Programs_unittests_testwebframe_SOURCES = Source/WebKit/gtk/tests/testwebframe.c
493 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
494 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
495 Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
496
497 Programs_unittests_testwebplugindatabase_SOURCES = Source/WebKit/gtk/tests/testwebplugindatabase.c
498 Programs_unittests_testwebplugindatabase_CFLAGS = -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" $(webkit_tests_cflags)
499 Programs_unittests_testwebplugindatabase_LDADD = $(webkit_tests_ldadd)
500 Programs_unittests_testwebplugindatabase_LDFLAGS = $(webkit_tests_ldflags)
501
502 Programs_unittests_testwebbackforwardlist_SOURCES = Source/WebKit/gtk/tests/testwebbackforwardlist.c
503 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
504 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
505 Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
506
507 Programs_unittests_testwebhistoryitem_SOURCES = Source/WebKit/gtk/tests/testwebhistoryitem.c
508 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
509 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
510 Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
511
512 Programs_unittests_testwindow_SOURCES = Source/WebKit/gtk/tests/testwindow.c
513 Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags)
514 Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd)
515 Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags)
516
517 Programs_unittests_testdownload_SOURCES = Source/WebKit/gtk/tests/testdownload.c
518 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
519 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
520 Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
521
522 Programs_unittests_testatk_SOURCES = Source/WebKit/gtk/tests/testatk.c
523 Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
524 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
525 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
526
527 Programs_unittests_testatkroles_SOURCES = Source/WebKit/gtk/tests/testatkroles.c
528 Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags)
529 Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd)
530 Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags)
531
532 Programs_unittests_testwebsettings_SOURCES = Source/WebKit/gtk/tests/testwebsettings.c
533 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
534 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
535 Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
536
537 Programs_unittests_testwebresource_SOURCES = Source/WebKit/gtk/tests/testwebresource.c
538 Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags)
539 Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd)
540
541 Programs_unittests_testwebdatasource_SOURCES = Source/WebKit/gtk/tests/testwebdatasource.c
542 Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
543 Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)
544
545 Programs_unittests_testwebview_SOURCES = Source/WebKit/gtk/tests/testwebview.c Source/WebKit/gtk/tests/test_utils.c
546 Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
547 Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
548 Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)
549
550 Programs_unittests_testhittestresult_SOURCES = Source/WebKit/gtk/tests/testhittestresult.c
551 Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
552 Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)
553
554 Programs_unittests_testkeyevents_SOURCES = Source/WebKit/gtk/tests/testkeyevents.c
555 Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags)
556 Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd)
557 Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags)
558
559 Programs_unittests_testcopyandpaste_SOURCES = Source/WebKit/gtk/tests/testcopyandpaste.c \
560         Source/WebCore/platform/gtk/GtkVersioning.c
561 Programs_unittests_testcopyandpaste_CFLAGS = $(webkit_tests_cflags) \
562         -I$(srcdir)/Source/WebCore/platform/gtk \
563         -I$(srcdir)/Source/WebCore
564 Programs_unittests_testcopyandpaste_LDADD = $(webkit_tests_ldadd)
565 Programs_unittests_testcopyandpaste_LDFLAGS = $(webkit_tests_ldflags)
566
567 # Project-wide clean rules
568 # Files that will be cleaned
569 CLEANFILES += \
570         $(BUILT_SOURCES) \
571         $(top_builddir)/stamp-webkitmarshal.cpp \
572         $(top_builddir)/stamp-webkitmarshal.h \
573         $(top_builddir)/stamp-webkitenumtypes.cpp \
574         $(top_builddir)/stamp-webkitenumtypes.h \
575         $(top_builddir)/Programs/GtkLauncher
576
577 DISTCLEANFILES += \
578         $(top_builddir)/Source/WebKit/gtk/docs/version.xml \
579         $(top_builddir)/Source/WebKit/gtk/docs/GNUmakefile \
580         $(top_builddir)/Source/WebKit/gtk/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc \
581         $(top_builddir)/Source/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml \
582         $(top_builddir)/Source/WebKit/gtk/webkit/webkitversion.h
583
584 dist-hook:
585         cp $(WebKit)/NEWS $(distdir)
586 install-data-local: po-install-data-local
587 installdirs-data-local: po-installdirs-data-local
588 uninstall-local: po-uninstall-local
589
590 # Run all tests in cwd
591 # FIXME: we should run this under xvfb
592 test: $(TEST_PROGS)
593         $(GTESTER) --verbose $(TEST_PROGS);
594
595 # test-report: run tests in cwd and generate report
596 # full-report: run tests in cwd with -m perf and -m slow and generate report
597 # perf-report: run tests in cwd with -m perf and generate report
598 test-report full-report perf-report: $(TEST_PROGS)
599         @ case $@ in \
600           test-report) test_options="-k";; \
601           full-report) test_options="-k -m=perf";; \
602           perf-report) test_options="-k -m=perf -m=slow";; \
603           esac ; \
604           $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
605           $(GTESTER_REPORT) test-report.xml > test-report.html ;
606
607 .PHONY: test test-report perf-report full-report
608 check-local: test