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