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