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