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