2010-09-21 Fridrich Strba <fridrich.strba@bluewin.ch>
[WebKit-https.git] / GNUmakefile.am
1 # Top-level Makefile rule for automake
2 #
3 # Variable conventions:
4 #
5 # _h_api            = API headers that will be installed and included in the distribution
6 # _cppflags         = flags that will be passed to the C/CXX Preprocessor
7 # _sources          = sources that will be compiled and included in the distribution
8 # _built_sources    = files that will be autogenerated by the build system and
9 #                     will be part of the _SOURCES primary
10 # _built_nosources  = files that are autogenerated but are not part of the
11 #                     _SOURCES primary
12 # _cleanfiles       = files that will be removed by the clean target
13 #
14 # Sources, headers, flags, etc... should be added to the respective variables
15 # with the above suffix, e.g, webcore-specific sources should go to
16 # webcore_sources, gtk port API and WebCoreSupport parts to webkitgtk_sources,
17 # etc... The only exceptions are the global variables. See Global Variables
18 # below.
19
20 # Global Variables Reference
21 # global_cppflags   = CPPFLAGS that apply to all C/C++ files that are built for any project.
22 # global_cflags     = CFLAGS that apply to all C files that are built for any project.
23 # global_cxxflags   = CXXFLAGS that apply to all C++ files that are bult for any project.
24
25 srcdir = @srcdir@
26 VPATH = @srcdir@
27
28 DISTCHECK_CONFIGURE_FLAGS = \
29         --enable-introspection  \
30         --enable-gtk-doc
31
32 # Directory for autogenerated sources
33 GENSOURCES := $(top_builddir)/DerivedSources
34 GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
35 GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
36 GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
37 GENPROGRAMS := $(top_builddir)/Programs
38 GENSOURCES_INSPECTOR := $(GENPROGRAMS)/resources/inspector
39 WebCore := $(srcdir)/WebCore
40
41 # Programs to run the WebKitGtk unit tests
42 GTESTER = gtester
43 GTESTER_REPORT = gtester-report
44
45 # Libraries and support components
46 bin_PROGRAMS :=
47 noinst_PROGRAMS :=
48 noinst_HEADERS :=
49 noinst_LTLIBRARIES :=
50 lib_LTLIBRARIES :=
51 IDL_BINDINGS :=
52 TEST_PROGS :=
53 POFILES :=
54 MOFILES :=
55 javascriptcore_h_api :=
56 javascriptcore_cppflags:=
57 javascriptcore_sources :=
58 javascriptcore_built_sources :=
59 javascriptcore_built_nosources :=
60 webcore_cppflags :=
61 webcore_sources :=
62 webcore_libadd :=
63 webcore_built_sources :=
64 webcore_built_nosources :=
65 webcoregtk_sources :=
66 webcoregtk_cppflags :=
67 webkitgtk_built_h_api :=
68 webkitgtk_static_h_api :=
69 webkitgtk_h_api :=
70 webkitgtk_sources :=
71 webkitgtk_cppflags :=
72 webkitgtk_gdom_built_sources :=
73 webkitgtk_built_sources :=
74 webkitgtk_built_nosources :=
75 global_cppflags :=
76 global_cflags :=
77 global_cxxflags :=
78 JSCORE_GIRSOURCES :=
79 WEBKIT_GIRSOURCES :=
80 FEATURE_DEFINES :=
81 typelibsdir :=
82 typelibs_DATA :=
83 EXTRA_DIST :=
84 BUILT_SOURCES :=
85 CLEANFILES :=
86 DISTCLEANFILES :=
87 MAINTAINERCLEANFILES :=
88
89 global_cppflags += \
90         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
91         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
92         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
93         -Wno-unused-parameter -Wno-parentheses \
94         -fno-exceptions
95
96 global_cxxflags += \
97         $(SYMBOL_VISIBILITY_INLINES) \
98         -fno-rtti
99
100 # -no-undefined required for building DLLs on Windows
101 # It breaks the build on other platforms, so we use it conditionally
102 if OS_WIN32
103 no_undefined = -no-undefined
104 version_script = -export-symbols-regex "^(webkit_|k?JS).*"
105 endif
106
107 if OS_GNU
108 version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
109 endif
110
111 # Shared libraries
112 lib_LTLIBRARIES += \
113         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
114
115 # Convenience libraries
116 noinst_LTLIBRARIES += \
117         libJavaScriptCore.la
118
119 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
120         $(javascriptcore_built_nosources)
121
122 nodist_libJavaScriptCore_la_SOURCES = \
123         $(javascriptcore_built_sources)
124
125 libJavaScriptCore_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/JavaScriptCore
126 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
127
128 libJavaScriptCore_la_SOURCES = \
129         $(javascriptcore_sources)
130
131 libJavaScriptCore_la_LIBADD = \
132         $(UNICODE_LIBS) \
133         $(GLIB_LIBS) \
134         -lpthread
135
136 libJavaScriptCore_la_CXXFLAGS = \
137         $(global_cxxflags) \
138         $(libJavaScriptCore_la_CFLAGS)
139
140 libJavaScriptCore_la_CFLAGS = \
141         -fstrict-aliasing \
142         -O3 \
143         $(global_cflags) \
144         $(GLIB_CFLAGS) \
145         $(UNICODE_CFLAGS)
146
147 libJavaScriptCore_la_CPPFLAGS = \
148         $(global_cppflags) \
149         $(javascriptcore_cppflags)
150
151 # WebKit
152 nodist_EXTRA_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
153         $(webcore_built_nosources)
154
155 nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
156         $(webcore_built_sources) \
157         $(webkitgtk_built_sources)
158
159 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/webkit
160 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
161         $(webkitgtk_static_h_api)
162
163 nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
164         $(webkitgtk_built_h_api) \
165         WebKit/gtk/webkit/webkitenumtypes.h
166
167 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
168         $(webcore_sources) \
169         $(webcoregtk_sources) \
170         $(webkitgtk_sources)
171
172 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
173         $(global_cxxflags)
174
175 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
176         $(global_cflags)
177
178 # When building WebCore/WebKit, we want WebCore/config.h and NOT JavaScriptCore/config.h,
179 # hence, it's important that WebCore/ should come first before JavaScriptCore in the
180 # include path.
181 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
182         -DBUILDING_WEBKIT \
183         -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
184         -DDATA_DIR=\"${datadir}\" \
185         -I$(top_builddir)/DerivedSources/webkit \
186         -I$(srcdir)/WebCore/bindings \
187         -I$(srcdir)/WebCore/bindings/gobject \
188         -I$(srcdir)/WebKit/gtk \
189         -I$(srcdir)/WebKit/gtk/WebCoreSupport \
190         -I$(srcdir)/WebKit/gtk/webkit \
191         -I$(top_builddir)/WebKit/gtk \
192         -I$(top_builddir)/WebKit/gtk/webkit \
193         -I$(GENSOURCES_WEBKIT) \
194         $(global_cppflags) \
195         $(webcore_cppflags) \
196         $(webcoregtk_cppflags) \
197         $(javascriptcore_cppflags) \
198         -fno-strict-aliasing \
199         $(HILDON_CPPFLAGS) \
200         $(COVERAGE_CFLAGS) \
201         $(ENCHANT_CFLAGS) \
202         $(GAIL_CFLAGS) \
203         $(GEOCLUE_CFLAGS) \
204         $(GLIB_CFLAGS) \
205         $(GSTREAMER_CFLAGS) \
206         $(GTK_CFLAGS) \
207         $(HILDON_CFLAGS) \
208         $(LIBSOUP_CFLAGS) \
209         $(LIBXML_CFLAGS) \
210         $(LIBXSLT_CFLAGS) \
211         $(SQLITE3_CFLAGS) \
212         $(UNICODE_CFLAGS) \
213         $(XT_CFLAGS)
214
215 # For the Gtk port we want to use XP_UNIX both in X11 and Mac
216 if !TARGET_WIN32
217 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
218         -DXP_UNIX
219 endif
220
221 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
222         -version-info @LIBWEBKITGTK_VERSION@ \
223         $(version_script) \
224         $(no_undefined)
225
226 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
227         -lpthread \
228         libJavaScriptCore.la \
229         $(webcore_ldflags) \
230         $(CAIRO_LIBS) \
231         $(COVERAGE_LDFLAGS) \
232         $(ENCHANT_LIBS) \
233         $(FREETYPE_LIBS) \
234         $(GAIL_LIBS) \
235         $(GEOCLUE_LIBS) \
236         $(GLIB_LIBS) \
237         $(GSTREAMER_LIBS) \
238         $(GTK_LIBS) \
239         $(HILDON_LIBS) \
240         $(JPEG_LIBS) \
241         $(LIBSOUP_LIBS) \
242         $(LIBXML_LIBS) \
243         $(LIBXSLT_LIBS) \
244         $(PANGO_LIBS) \
245         $(PNG_LIBS) \
246         $(SQLITE3_LIBS) \
247         $(UNICODE_LIBS) \
248         $(XT_LIBS) \
249         $(WINMM_LIBS) \
250         $(SHLWAPI_LIBS) \
251         $(OLE32_LIBS)
252
253 #
254 # Extra checks and flags
255 global_cppflags += \
256         -DBUILDING_CAIRO__=1 \
257         -DBUILDING_GTK__=1 \
258         -DWTF_CHANGES
259
260 if USE_ICU_UNICODE
261 global_cppflags += \
262         -DWTF_USE_ICU_UNICODE=1
263 endif
264
265 if USE_GLIB_UNICODE
266 global_cppflags += \
267         -DWTF_USE_GLIB_UNICODE=1
268 endif
269
270 if !ENABLE_FAST_MALLOC
271 global_cppflags += \
272         -DUSE_SYSTEM_MALLOC
273 endif
274
275 # ----
276 # GTK+ 2.x/3.x support
277 # ----
278 if GTK_API_VERSION_2
279 global_cppflags += \
280         -DGTK_API_VERSION_2=1
281 endif
282
283 if !ENABLE_DEBUG
284 global_cppflags += -DNDEBUG
285 global_cflags += $(SYMBOL_VISIBILITY)
286 else
287 global_cppflags += \
288         -DG_DISABLE_DEPRECATED \
289         -DGDK_PIXBUF_DISABLE_DEPRECATED \
290         -DGDK_DISABLE_DEPRECATED \
291         -DGTK_DISABLE_DEPRECATED \
292         -DPANGO_DISABLE_DEPRECATED
293 # Might be useful in the future
294 #       -DGDK_MULTIHEAD_SAFE \
295 #       -DGTK_MULTIHEAD_SAFE
296 endif
297
298 if ENABLE_COVERAGE
299 global_cppflags += \
300         -DGCC_GENERATE_TEST_COVERAGE_FILES \
301         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
302 endif
303
304 webkitgtk_static_h_api += \
305         $(srcdir)/WebKit/gtk/webkit/webkit.h \
306         $(srcdir)/WebKit/gtk/webkit/webkitdefines.h \
307         $(srcdir)/WebKit/gtk/webkit/webkitdownload.h \
308         $(srcdir)/WebKit/gtk/webkit/webkiterror.h \
309         $(srcdir)/WebKit/gtk/webkit/webkithittestresult.h \
310         $(srcdir)/WebKit/gtk/webkit/webkitnetworkrequest.h \
311         $(srcdir)/WebKit/gtk/webkit/webkitnetworkresponse.h \
312         $(srcdir)/WebKit/gtk/webkit/webkitsoupauthdialog.h \
313         $(srcdir)/WebKit/gtk/webkit/webkitwebbackforwardlist.h \
314         $(srcdir)/WebKit/gtk/webkit/webkitwebdatasource.h \
315         $(srcdir)/WebKit/gtk/webkit/webkitwebframe.h \
316         $(srcdir)/WebKit/gtk/webkit/webkitwebhistoryitem.h \
317         $(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \
318         $(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
319         $(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
320         $(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
321         $(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
322         $(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
323         $(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
324         $(srcdir)/WebKit/gtk/webkit/webkitwebview.h \
325         $(srcdir)/WebKit/gtk/webkit/webkitwebdatabase.h \
326         $(srcdir)/WebKit/gtk/webkit/webkitsecurityorigin.h
327
328 webkitgtk_built_h_api += \
329         WebKit/gtk/webkit/webkitversion.h
330
331 webkitgtk_h_api += \
332         $(webkitgtk_built_h_api) \
333         $(webkitgtk_static_h_api)
334
335 # webkitenumtypes.{h,cpp} cannot be in webkitgtk_built_h_api, because
336 # the rule that builds it depends on webkitgtk_built_h_api (circular dependency).
337 webkitgtk_built_sources += \
338         $(webkitgtk_built_h_api) \
339         $(webkitgtk_gdom_built_sources) \
340         DerivedSources/webkit/webkitmarshal.cpp \
341         DerivedSources/webkit/webkitmarshal.h \
342         WebKit/gtk/webkit/webkitenumtypes.cpp \
343         WebKit/gtk/webkit/webkitenumtypes.h
344
345 webkitgtk_sources += \
346         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
347         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
348         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
349         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
350         WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \
351         WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \
352         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
353         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
354         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
355         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
356         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
357         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
358         WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h \
359         WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp \
360         WebKit/gtk/WebCoreSupport/FullscreenVideoController.h \
361         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
362         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
363         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
364         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
365         WebKit/gtk/webkit/webkitapplicationcache.cpp \
366         WebKit/gtk/webkit/webkitdownload.cpp \
367         WebKit/gtk/webkit/webkiterror.cpp \
368         WebKit/gtk/webkit/webkithittestresult.cpp \
369         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
370         WebKit/gtk/webkit/webkitnetworkresponse.cpp \
371         WebKit/gtk/webkit/webkitprivate.cpp \
372         WebKit/gtk/webkit/webkitprivate.h \
373         WebKit/gtk/webkit/webkitsoupauthdialog.c \
374         WebKit/gtk/webkit/webkitversion.cpp \
375         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
376         WebKit/gtk/webkit/webkitwebdatasource.cpp \
377         WebKit/gtk/webkit/webkitwebframe.cpp \
378         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
379         WebKit/gtk/webkit/webkitwebinspector.cpp \
380         WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
381         WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
382         WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
383         WebKit/gtk/webkit/webkitwebresource.cpp \
384         WebKit/gtk/webkit/webkitwebdatabase.cpp \
385         WebKit/gtk/webkit/webkitsecurityorigin.cpp \
386         WebKit/gtk/webkit/webkitwebsettings.cpp \
387         WebKit/gtk/webkit/webkitwebview.cpp \
388         WebKit/gtk/webkit/webkitwebwindowfeatures.cpp \
389         WebKit/gtk/webkit/webkitworkers.cpp
390
391 pkgconfigdir = $(libdir)/pkgconfig
392 pkgconfig_DATA = WebKit/gtk/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc
393
394 if ENABLE_INTROSPECTION
395
396 JSCore-@WEBKITGTK_API_VERSION@.gir: $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir
397         $(AM_V_GEN)cp $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir $(builddir)/
398
399 JSCORE_GIRSOURCES += JSCore-@WEBKITGTK_API_VERSION@.gir
400 WEBKIT_GIRSOURCES += WebKit-@WEBKITGTK_API_VERSION@.gir
401
402 $(WEBKIT_GIRSOURCES): $(G_IR_SCANNER) $(JSCORE_GIRSOURCES) libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
403         $(AM_V_GEN)$(G_IR_SCANNER) -v --warn-all \
404              --symbol-prefix=webkit \
405              --identifier-prefix=WebKit \
406              --namespace=WebKit \
407              --nsversion=@WEBKITGTK_API_VERSION@ \
408              --include=GObject-2.0 \
409              --include=Gtk-@GTK_API_VERSION@ \
410              --include=JSCore-@WEBKITGTK_API_VERSION@ \
411              --include=Soup-2.4 \
412              --library=webkitgtk-@WEBKITGTK_API_VERSION@ \
413              --libtool="$(LIBTOOL)" \
414              --pkg=gobject-2.0 \
415              --pkg=gtk+-@GTK_API_VERSION@ \
416              --pkg=libsoup-2.4 \
417              --output=$@ \
418              --add-include-path=$(top_srcdir)/WebKit/gtk \
419              --add-include-path=$(builddir) \
420              -I$(top_srcdir)/WebKit/gtk \
421              -I$(top_builddir)/WebKit/gtk \
422              -I$(top_builddir)/DerivedSources \
423              -I$(top_builddir)/DerivedSources/webkit \
424              -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \
425              -I$(top_srcdir) \
426              $(webkitgtk_h_api) \
427              $(top_srcdir)/WebKit/gtk/webkit/*.cpp
428
429 girdir = $(datadir)/gir-1.0
430 gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)
431
432 typelibsdir += $(libdir)/girepository-1.0
433 typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
434
435 %.typelib: %.gir $(G_IR_COMPILER)
436         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(top_srcdir)/WebKit/gtk --includedir $(builddir) $< -o $@
437
438 CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
439
440 endif
441
442 EXTRA_DIST += $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir
443
444 WEBKIT_MARSHAL = $(GENSOURCES_WEBKIT)/webkitmarshal
445 WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
446 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
447         @true
448
449 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
450         @true
451
452 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
453         $(AM_V_GEN) echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
454         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
455         echo timestamp > $(@F)
456
457 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
458         $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
459         echo timestamp > $(@F)
460
461 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
462         @true
463 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
464         $(AM_V_GEN)glib-mkenums \
465                         --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
466                         --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
467                         --fhead "#include <glib-object.h>\n\n" \
468                         --fhead "#include <webkit/webkitdefines.h>\n\n" \
469                         --fhead "G_BEGIN_DECLS\n\n" \
470                         --ftail "G_END_DECLS\n\n" \
471                         --ftail "#endif\n" \
472                         --fprod "#include <webkit/@basename@>\n\n" \
473                         --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
474                         --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
475                 $(webkitgtk_h_api) | \
476                 sed 's,web_kit,webkit,' | \
477                 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
478                 > xgen-gth \
479         && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
480         && rm -f xgen-gth \
481         && echo timestamp > $(@F)
482
483 WebKit/gtk/webkit/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
484         $(AM_V_GEN)glib-mkenums \
485                         --fhead "#include <config.h>\n" \
486                         --fhead "#include <glib-object.h>\n" \
487                         --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
488                         --fhead "extern \"C\" {\n\n" \
489                         --fprod "\n/* enumerations from \"@filename@\" */" \
490                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
491                         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
492                         --vtail "    { 0, NULL, NULL }\n};\n\n" \
493                         --vtail "GType @enum_name@_get_type(void)\n{\n" \
494                         --vtail "    static GType type = 0;\n\n" \
495                         --vtail "    if (!type)\n" \
496                         --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
497                         --vtail "    return type;\n}\n\n" \
498                         --ftail "}\n" \
499                 $(webkitgtk_h_api) | \
500                 sed 's,web_kit,webkit,' \
501                 > xgen-gtc \
502         && cp xgen-gtc $@ \
503         && rm -f xgen-gtc
504
505 # GSettings
506 if USE_GSETTINGS
507 gsettings_SCHEMAS = $(top_builddir)/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml
508
509 @GSETTINGS_RULES@
510 endif
511
512 # Files that will be distributed
513 EXTRA_DIST += \
514         $(srcdir)/gtk-doc.make \
515         WebKit/LICENSE \
516         $(srcdir)/autotools/symbols.filter \
517         $(srcdir)/WebKit/gtk/ChangeLog \
518         $(srcdir)/WebKit/gtk/NEWS \
519         $(srcdir)/WebKit/gtk/webkitmarshal.list \
520         $(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
521         $(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
522         $(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
523         $(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
524         $(srcdir)/WebKit/gtk/docs/version.xml.in \
525         $(srcdir)/WebKit/gtk/po/* \
526         $(srcdir)/WebKit/gtk/resources/* \
527         $(srcdir)/WebKit/gtk/tests/resources/* \
528         $(srcdir)/WebKit/gtk/tests/test_utils.h \
529         $(srcdir)/WebKit/gtk/org.webkitgtk.gschema.xml.in
530
531 # extra resource files
532 resourcesdir = ${datadir}/webkit-@WEBKITGTK_API_VERSION@/resources
533 dist_resources_DATA = \
534         $(shell ls $(srcdir)/WebKit/gtk/resources/*.html)
535
536 # END WEBKIT GTK+
537
538 # Include module makefiles
539 include JavaScriptCore/GNUmakefile.am
540 include WebCore/GNUmakefile.am
541 include WebCore/bindings/gobject/GNUmakefile.am
542 include WebKitTools/GNUmakefile.am
543 include WebKit/gtk/po/GNUmakefile.am
544
545 # Build unit tests
546 noinst_PROGRAMS += $(TEST_PROGS)
547
548 webkit_tests_cflags = \
549         -fno-strict-aliasing \
550         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
551         -I$(srcdir)/WebKit/gtk \
552         -I$(top_builddir)/WebKit/gtk \
553         -I$(top_builddir)/DerivedSources \
554         -I$(top_srcdir)/WebCore/bindings \
555         -I$(top_srcdir)/WebCore/bindings/gobject \
556         $(global_cppflags) \
557         $(global_cflags) \
558         $(GLIB_CFLAGS) \
559         $(GTK_CFLAGS) \
560         $(LIBSOUP_CFLAGS)
561
562 webkit_tests_ldadd = \
563         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
564         $(GTK_LIBS) \
565         $(GLIB_LIBS) \
566         $(LIBSOUP_LIBS)
567
568 webkit_tests_ldflags = \
569         -no-install \
570         -no-fast-install
571
572 TEST_PROGS += \
573         Programs/unittests/testdomdocument \
574         Programs/unittests/testdomdomwindow \
575         Programs/unittests/testdomnode \
576         Programs/unittests/testhttpbackend \
577         Programs/unittests/testloading \
578         Programs/unittests/testglobals \
579         Programs/unittests/testmimehandling \
580         Programs/unittests/testnetworkrequest \
581         Programs/unittests/testnetworkresponse \
582         Programs/unittests/testwebframe \
583         Programs/unittests/testwebbackforwardlist \
584         Programs/unittests/testwebhistoryitem \
585         Programs/unittests/testwindow \
586         Programs/unittests/testdownload \
587         Programs/unittests/testatk \
588         Programs/unittests/testatkroles \
589         Programs/unittests/testhittestresult \
590         Programs/unittests/testwebsettings \
591         Programs/unittests/testwebresource \
592         Programs/unittests/testwebdatasource \
593         Programs/unittests/testwebview \
594         Programs/unittests/testkeyevents \
595         Programs/unittests/testcopyandpaste
596
597 # Add additional tests here
598 Programs_unittests_testdomdocument_SOURCES = WebKit/gtk/tests/testdomdocument.c
599 Programs_unittests_testdomdocument_CFLAGS = $(webkit_tests_cflags)
600 Programs_unittests_testdomdocument_LDADD = $(webkit_tests_ldadd)
601 Programs_unittests_testdomdocument_LDFLAGS = $(webkit_tests_ldflags)
602
603 Programs_unittests_testdomdomwindow_SOURCES = WebKit/gtk/tests/testdomdomwindow.c
604 Programs_unittests_testdomdomwindow_CFLAGS = $(webkit_tests_cflags)
605 Programs_unittests_testdomdomwindow_LDADD = $(webkit_tests_ldadd)
606 Programs_unittests_testdomdomwindow_LDFLAGS = $(webkit_tests_ldflags)
607
608 Programs_unittests_testdomnode_SOURCES = WebKit/gtk/tests/testdomnode.c
609 Programs_unittests_testdomnode_CFLAGS = $(webkit_tests_cflags)
610 Programs_unittests_testdomnode_LDADD = $(webkit_tests_ldadd)
611 Programs_unittests_testdomnode_LDFLAGS = $(webkit_tests_ldflags)
612
613 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
614 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
615 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
616 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
617
618 Programs_unittests_testglobals_SOURCES = WebKit/gtk/tests/testglobals.c
619 Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags)
620 Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd)
621 Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags)
622
623 Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
624 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
625 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
626 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
627
628 Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c
629 Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
630 Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
631 Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)
632
633 Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
634 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
635 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
636 Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
637
638 Programs_unittests_testnetworkresponse_SOURCES = WebKit/gtk/tests/testnetworkresponse.c
639 Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags)
640 Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd)
641 Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags)
642
643 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
644 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
645 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
646 Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
647
648 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
649 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
650 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
651 Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
652
653 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
654 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
655 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
656 Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
657
658 Programs_unittests_testwindow_SOURCES = WebKit/gtk/tests/testwindow.c
659 Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags)
660 Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd)
661 Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags)
662
663 Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
664 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
665 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
666 Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
667
668 Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c
669 Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
670 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
671 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
672
673 Programs_unittests_testatkroles_SOURCES = WebKit/gtk/tests/testatkroles.c
674 Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags)
675 Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd)
676 Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags)
677
678 Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
679 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
680 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
681 Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
682
683 Programs_unittests_testwebresource_SOURCES = WebKit/gtk/tests/testwebresource.c
684 Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags)
685 Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd)
686
687 Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasource.c
688 Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
689 Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)
690
691 Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c
692 Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
693 Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
694 Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)
695
696 Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c
697 Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
698 Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)
699
700 Programs_unittests_testkeyevents_SOURCES = WebKit/gtk/tests/testkeyevents.c
701 Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags)
702 Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd)
703 Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags)
704
705 Programs_unittests_testcopyandpaste_SOURCES = WebKit/gtk/tests/testcopyandpaste.c \
706         WebCore/platform/gtk/GtkVersioning.c
707 Programs_unittests_testcopyandpaste_CFLAGS = $(webkit_tests_cflags) \
708         -I$(srcdir)/WebCore/platform/gtk \
709         -I$(srcdir)/WebCore
710 Programs_unittests_testcopyandpaste_LDADD = $(webkit_tests_ldadd)
711 Programs_unittests_testcopyandpaste_LDFLAGS = $(webkit_tests_ldflags)
712
713 # Autogenerated sources
714 BUILT_SOURCES += \
715         $(javascriptcore_built_sources) \
716         $(javascriptcore_built_nosources) \
717         $(webcore_built_sources) \
718         $(webcore_built_nosources) \
719         $(webkitgtk_built_sources) \
720         $(webkitgtk_built_nosources)
721
722 # Project-wide clean rules
723 # Files that will be cleaned
724 CLEANFILES += \
725         $(BUILT_SOURCES) \
726         $(top_builddir)/stamp-webkitmarshal.cpp \
727         $(top_builddir)/stamp-webkitmarshal.h \
728         $(top_builddir)/stamp-webkitenumtypes.cpp \
729         $(top_builddir)/stamp-webkitenumtypes.h \
730         $(top_builddir)/Programs/GtkLauncher
731
732 DISTCLEANFILES += \
733         $(CLEANFILES) \
734         $(builddir)/doltcompile \
735         $(builddir)/doltlibtool \
736         $(top_builddir)/WebKit/gtk/docs/version.xml \
737         $(top_builddir)/WebKit/gtk/docs/GNUmakefile \
738         $(top_builddir)/WebKit/gtk/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc \
739         $(top_builddir)/WebKit/gtk/webkit/webkitversion.h \
740         $(top_builddir)/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml
741
742 MAINTAINERCLEANFILES += \
743         $(CLEANFILES) \
744         $(builddir)/doltcompile \
745         $(builddir)/doltlibtool \
746         $(srcdir)/aconfig.h.in \
747         $(srcdir)/autotools/config.* \
748         $(srcdir)/autotools/compile \
749         $(srcdir)/autotools/depcomp \
750         $(srcdir)/autotools/install-sh \
751         $(srcdir)/autotools/missing \
752         $(srcdir)/configure \
753         $(srcdir)/GNUmakefile.in \
754         $(srcdir)/INSTALL \
755         $(srcdir)/README \
756         $(top_builddir)/config.*
757
758 # Older automake versions (1.7) place Plo files in a different place so we need
759 # to create the output directory manually.
760 all-local: stamp-po
761         $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
762
763 # remove built sources and program directories
764 clean-local:
765         -rm -rf $(GENPROGRAMS)
766
767 maintainer-clean-local: distclean-local
768
769 distclean-local:
770         -rm -rf $(GENSOURCES) $(GENPROGRAMS)
771
772 dist-hook:
773         cp $(srcdir)/WebKit/gtk/NEWS $(distdir)
774
775 install-data-local: po-install-data-local
776
777 installdirs-data-local: po-installdirs-data-local
778
779 uninstall-local: po-uninstall-local
780
781 # Run all tests in cwd
782 # FIXME: we should run this under xvfb
783 test: $(TEST_PROGS)
784         $(GTESTER) --verbose $(TEST_PROGS);
785
786 # test-report: run tests in cwd and generate report
787 # full-report: run tests in cwd with -m perf and -m slow and generate report
788 # perf-report: run tests in cwd with -m perf and generate report
789 test-report full-report perf-report: $(TEST_PROGS)
790         @ case $@ in \
791           test-report) test_options="-k";; \
792           full-report) test_options="-k -m=perf";; \
793           perf-report) test_options="-k -m=perf -m=slow";; \
794           esac ; \
795           $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
796           $(GTESTER_REPORT) test-report.xml > test-report.html ;
797
798 .PHONY: test test-report perf-report full-report
799 check-local: test