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