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