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