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