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