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 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 if ENABLE_INTROSPECTION
507 JSCORE_GIRSOURCES = JSCore-1.0.gir # JSCore-1.0.gir is handwritten
508 WEBKIT_GIRSOURCES = WebKit-1.0.gir
509
510 $(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER)
511         $(AM_V_GEN)$(G_IR_SCANNER) -v --namespace WebKit --nsversion=1.0 \
512             --add-include-path=$(srcdir) --add-include-path=. \
513              --include=GObject-2.0 \
514              --include=Gtk-2.0 \
515              --include=JSCore-1.0 \
516              --include=Soup-2.4 \
517              --library=webkit-1.0 \
518              --libtool="$(LIBTOOL)" \
519              --pkg gobject-2.0 \
520              --pkg gtk+-2.0 \
521              --pkg webkit-1.0 \
522              --output $@ \
523              $(webkitgtk_h_api)
524
525 girdir = $(GIRDIR)
526 gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)
527
528 typelibsdir = $(GIRTYPELIBDIR)
529 typelibs_DATA = $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
530
531 %.typelib: %.gir $(G_IR_COMPILER)
532         $(AM_V_GEN)$(G_IR_COMPILER) $< -o $@
533
534 EXTRA_DIST += $(JSCORE_GIRSOURCES)
535 CLEANFILES += $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
536 endif
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
582 # Add additional tests here
583 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
584 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
585 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
586 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
587
588 Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
589 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
590 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
591 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
592
593 Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
594 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
595 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
596 Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
597
598 Programs_unittests_testnetworkresponse_SOURCES = WebKit/gtk/tests/testnetworkresponse.c
599 Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags)
600 Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd)
601 Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags)
602
603 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
604 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
605 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
606 Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
607
608 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
609 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
610 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
611 Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
612
613 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
614 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
615 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
616 Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
617
618 Programs_unittests_testwindow_SOURCES = WebKit/gtk/tests/testwindow.c
619 Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags)
620 Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd)
621 Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags)
622
623 Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
624 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
625 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
626 Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
627
628 Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c
629 Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
630 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
631 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
632
633 Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
634 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
635 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
636 Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
637
638 Programs_unittests_testwebresource_SOURCES = WebKit/gtk/tests/testwebresource.c
639 Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags)
640 Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd)
641
642 Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasource.c
643 Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
644 Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)
645
646 Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c
647 Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
648 Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)
649
650 # Autogenerated sources
651 BUILT_SOURCES := \
652         $(javascriptcore_built_sources) \
653         $(javascriptcore_built_nosources) \
654         $(webcore_built_sources) \
655         $(webcore_built_nosources) \
656         $(webkitgtk_built_sources) \
657         $(webkitgtk_built_nosources)
658
659 # Project-wide clean rules
660 CLEANFILES += \
661         $(webkitgtk_cleanfiles)
662
663 MAINTAINERCLEANFILES += \
664         $(srcdir)/aconfig.h.in \
665         $(srcdir)/autotools/config.* \
666         $(srcdir)/autotools/compile \
667         $(srcdir)/autotools/depcomp \
668         $(srcdir)/autotools/install-sh \
669         $(srcdir)/autotools/missing \
670         $(srcdir)/configure \
671         $(srcdir)/GNUmakefile.in \
672         $(srcdir)/INSTALL \
673         $(srcdir)/README \
674         $(top_builddir)/config.*
675
676 # Older automake versions (1.7) place Plo files in a different place so we need
677 # to create the output directory manually.
678 all-local: stamp-po
679         $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
680
681 # remove built sources and program directories
682 clean-local:
683         -rm -rf $(GENPROGRAMS)
684
685 maintainer-clean-local: distclean-local
686
687 distclean-local:
688         -rm -rf $(GENSOURCES) $(GENPROGRAMS)
689
690 install-data-local: po-install-data-local
691
692 installdirs-data-local: po-installdirs-data-local
693
694 uninstall-local: po-uninstall-local
695
696 # Run all tests in cwd
697 # FIXME: we should run this under xvfb
698 test: $(TEST_PROGS)
699         $(GTESTER) --verbose $(TEST_PROGS);
700
701 # test-report: run tests in cwd and generate report
702 # full-report: run tests in cwd with -m perf and -m slow and generate report
703 # perf-report: run tests in cwd with -m perf and generate report
704 test-report full-report perf-report: $(TEST_PROGS)
705         @ case $@ in \
706           test-report) test_options="-k";; \
707           full-report) test_options="-k -m=perf";; \
708           perf-report) test_options="-k -m=perf -m=slow";; \
709           esac ; \
710           $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
711           $(GTESTER_REPORT) test-report.xml > test-report.html ;
712
713 .PHONY: test test-report perf-report full-report
714 check-local: test