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