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