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