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