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