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