2010-05-11 Joseph Pecoraro <joepeck@webkit.org>
[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 GENSOURCESWEBKITDOM := $(top_builddir)/DerivedSources/webkit
39 GENPROGRAMS := $(top_builddir)/Programs
40
41 # Script for creating hash tables
42 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/create_hash_table
43
44 # Programs to run the WebKitGtk unit tests
45 GTESTER = gtester
46 GTESTER_REPORT = gtester-report
47
48 # Libraries and support components
49 bin_PROGRAMS :=
50 noinst_PROGRAMS :=
51 noinst_HEADERS :=
52 noinst_LTLIBRARIES :=
53 lib_LIBRARIES :=
54 IDL_BINDINGS :=
55 TEST_PROGS :=
56 POFILES :=
57 MOFILES :=
58 javascriptcore_h_api :=
59 javascriptcore_cppflags:=
60 javascriptcore_sources :=
61 javascriptcore_built_sources :=
62 javascriptcore_built_nosources :=
63 javascriptcore_dist :=
64 webcore_cppflags :=
65 webcore_sources :=
66 webcore_libadd :=
67 webcore_built_sources :=
68 webcore_built_nosources :=
69 webcore_dist :=
70 webcoregtk_cppflags :=
71 webcoregtk_sources :=
72 IDL_BINDINGS_GDOM :=
73 GDOM_AUTO_CLASSES :=
74 GDOM_FIXED_CLASSES :=
75 GDOM_CLASSES :=
76 GDOM_HEADERS_BUILT :=
77 GDOM_HEADERS_FIXED :=
78 libgdom_h_api :=
79 webkitgtk_h_api :=
80 webkitgtk_sources :=
81 webkitgtk_cppflags :=
82 webkitgtk_built_sources :=
83 webkitgtk_built_nosources :=
84 webkitgtk_cleanfiles :=
85 global_cppflags :=
86 global_cflags :=
87 global_cxxflags :=
88 corekit_cflags :=
89 corekit_cppflags :=
90 JSCORE_GIRSOURCES :=
91 WEBKIT_GIRSOURCES :=
92 typelibsdir :=
93 typelibs_DATA :=
94 EXTRA_DIST :=
95 BUILT_SOURCES :=
96 CLEANFILES :=
97 DISTCLEANFILES :=
98 MAINTAINERCLEANFILES :=
99
100 webcoregtk_cppflags += \
101         -I$(top_builddir)/DerivedSources/webkit \
102         -I$(srcdir)/WebCore/bindings \
103         -I$(srcdir)/WebCore/bindings/gobject
104
105 # CFLAGS/CXXFLAGS used by WebCore and WebKit
106 #
107 # gtk+.pc already include glib, cairo, freetype and pango CFLAGS
108 # Don't include them for now to reduce the noise when compiling
109 # $(GLIB_CFLAGS) $(CAIRO_CFLAGS) $(PANGO_CFLAGS)  $(FREETYPE_CFLAGS)
110 corekit_cflags += \
111         -fno-strict-aliasing \
112         $(COVERAGE_CFLAGS) \
113         $(ENCHANT_CFLAGS) \
114         $(GAIL_CFLAGS) \
115         $(GEOCLUE_CFLAGS) \
116         $(GLIB_CFLAGS) \
117         $(GSTREAMER_CFLAGS) \
118         $(GTK_CFLAGS) \
119         $(HILDON_CFLAGS) \
120         $(LIBSOUP_CFLAGS) \
121         $(LIBXML_CFLAGS) \
122         $(LIBXSLT_CFLAGS) \
123         $(SQLITE3_CFLAGS) \
124         $(UNICODE_CFLAGS) \
125         $(XT_CFLAGS)
126
127 # When building webcore/webkit, we want WebCore/config.h and NOT
128 # JavaScriptCore/config.h, hence, it's important that WebCore/ should come first
129 # before JavaScriptCore in the include path.
130 corekit_cppflags += \
131         $(global_cppflags) \
132         $(webcore_cppflags) \
133         $(webcoregtk_cppflags) \
134         $(javascriptcore_cppflags)
135
136 # For the Gtk port we want to use XP_UNIX both in X11 and Mac
137 if !TARGET_WIN32
138 corekit_cppflags += -DXP_UNIX
139 endif
140
141 # Default compiler flags
142 global_cflags += \
143         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
144         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
145         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
146         -Wno-unused-parameter -Wno-parentheses \
147         -fno-exceptions
148
149 global_cxxflags += \
150         $(global_cflags) \
151         $(SYMBOL_VISIBILITY_INLINES) \
152         -fno-rtti
153
154 # -no-undefined required for building DLLs on Windows
155 # It breaks the build on other platforms, so we use it conditionally
156 if OS_WIN32
157 no_undefined = -no-undefined
158 version_script = -export-symbols-regex "^(webkit_|JS).*"
159 endif
160
161 if OS_GNU
162 version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
163 endif
164
165 # Shared libraries
166 lib_LTLIBRARIES = \
167         libwebkit-1.0.la
168
169 # Convenience libraries
170 noinst_LTLIBRARIES += \
171         libJavaScriptCore.la
172
173 # JavaScriptCore
174 javascriptcore_cppflags += \
175         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
176         -I$(srcdir)/JavaScriptCore/parser \
177         -I$(srcdir)/JavaScriptCore/wtf \
178         -I$(srcdir)/JavaScriptCore/wtf/gtk \
179         -I$(srcdir)/JavaScriptCore/wtf/gobject \
180         -I$(top_builddir)/DerivedSources
181
182 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
183         $(javascriptcore_built_nosources)
184
185 nodist_libJavaScriptCore_la_SOURCES = \
186         $(javascriptcore_built_sources)
187
188 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
189 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
190
191 libJavaScriptCore_la_SOURCES = \
192         $(javascriptcore_sources)
193
194 libJavaScriptCore_la_LIBADD = \
195         $(UNICODE_LIBS) \
196         $(GLIB_LIBS) \
197         -lpthread
198
199 libJavaScriptCore_la_CXXFLAGS = \
200         $(global_cxxflags) \
201         $(libJavaScriptCore_la_CFLAGS)
202
203 libJavaScriptCore_la_CFLAGS = \
204         -fstrict-aliasing \
205         -O3 \
206         $(global_cflags) \
207         $(GLIB_CFLAGS) \
208         $(UNICODE_CFLAGS)
209
210 libJavaScriptCore_la_CPPFLAGS = \
211         $(global_cppflags) \
212         $(javascriptcore_cppflags)
213
214 # WebKit
215 nodist_EXTRA_libwebkit_1_0_la_SOURCES = \
216         $(webcore_built_nosources)
217
218 nodist_libwebkit_1_0_la_SOURCES = \
219         $(webcore_built_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         $(webcore_sources) \
229         $(webcoregtk_sources) \
230         $(webkitgtk_sources)
231
232 libwebkit_1_0_la_CXXFLAGS = \
233         $(global_cxxflags) \
234         $(corekit_cflags)
235
236 libwebkit_1_0_la_CFLAGS = \
237         $(global_cflags) \
238         $(corekit_cflags)
239
240 libwebkit_1_0_la_CPPFLAGS = \
241         $(corekit_cppflags) \
242         $(webkitgtk_cppflags) \
243         $(HILDON_CPPFLAGS)
244
245 libwebkit_1_0_la_LDFLAGS = \
246         -version-info @LIBWEBKITGTK_VERSION@ \
247         $(version_script) \
248         $(no_undefined)
249
250 libwebkit_1_0_la_LIBADD = \
251         -lpthread \
252         libJavaScriptCore.la \
253         libWebCoreJS.la \
254         libgdom.la \
255         $(webcore_ldflags) \
256         $(CAIRO_LIBS) \
257         $(COVERAGE_LDFLAGS) \
258         $(ENCHANT_LIBS) \
259         $(FREETYPE_LIBS) \
260         $(GAIL_LIBS) \
261         $(GEOCLUE_LIBS) \
262         $(GLIB_LIBS) \
263         $(GSTREAMER_LIBS) \
264         $(GTK_LIBS) \
265         $(HILDON_LIBS) \
266         $(JPEG_LIBS) \
267         $(LIBSOUP_LIBS) \
268         $(LIBXML_LIBS) \
269         $(LIBXSLT_LIBS) \
270         $(PANGO_LIBS) \
271         $(PNG_LIBS) \
272         $(SQLITE3_LIBS) \
273         $(UNICODE_LIBS) \
274         $(XT_LIBS)
275
276 libgdom_ladir = $(prefix)/include/webkit-1.0/webkit
277 libgdom_la_HEADERS = \
278         $(libgdom_h_api)
279
280 #
281 # Extra checks and flags
282 global_cppflags += \
283         -DBUILDING_CAIRO__=1 \
284         -DBUILDING_GTK__=1 \
285         -DWTF_CHANGES
286
287 if USE_ICU_UNICODE
288 global_cppflags += \
289         -DWTF_USE_ICU_UNICODE=1
290 endif
291
292 if USE_GLIB_UNICODE
293 global_cppflags += \
294         -DWTF_USE_GLIB_UNICODE=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/webkitgeolocationpolicydecision.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         $(libgdom_h_api)
350
351 webkitgtk_built_sources += \
352         DerivedSources/webkitenumtypes.cpp \
353         DerivedSources/webkitdomenumtypes.cpp \
354         DerivedSources/webkitmarshal.cpp \
355         DerivedSources/webkitmarshal.h \
356         WebKit/gtk/webkit/webkitenumtypes.h
357
358 webkitgtk_sources += \
359         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
360         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
361         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
362         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
363         WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \
364         WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \
365         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
366         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
367         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
368         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
369         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
370         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
371         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
372         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
373         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
374         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
375         WebKit/gtk/webkit/webkitapplicationcache.cpp \
376         WebKit/gtk/webkit/webkitdownload.cpp \
377         WebKit/gtk/webkit/webkiterror.cpp \
378         WebKit/gtk/webkit/webkithittestresult.cpp \
379         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
380         WebKit/gtk/webkit/webkitnetworkresponse.cpp \
381         WebKit/gtk/webkit/webkitprivate.cpp \
382         WebKit/gtk/webkit/webkitprivate.h \
383         WebKit/gtk/webkit/webkitsoupauthdialog.c \
384         WebKit/gtk/webkit/webkitversion.cpp \
385         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
386         WebKit/gtk/webkit/webkitwebdatasource.cpp \
387         WebKit/gtk/webkit/webkitwebframe.cpp \
388         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
389         WebKit/gtk/webkit/webkitwebinspector.cpp \
390         WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
391         WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
392         WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
393         WebKit/gtk/webkit/webkitwebresource.cpp \
394         WebKit/gtk/webkit/webkitwebdatabase.cpp \
395         WebKit/gtk/webkit/webkitsecurityorigin.cpp \
396         WebKit/gtk/webkit/webkitwebsettings.cpp \
397         WebKit/gtk/webkit/webkitwebview.cpp \
398         WebKit/gtk/webkit/webkitwebwindowfeatures.cpp \
399         WebKit/gtk/webkit/webkitworkers.cpp
400
401 webkitgtk_cppflags += \
402         -DBUILDING_WEBKIT \
403         -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
404         -DDATA_DIR=\"${datadir}\" \
405         -I$(srcdir)/WebKit/gtk \
406         -I$(srcdir)/WebKit/gtk/WebCoreSupport \
407         -I$(srcdir)/WebKit/gtk/webkit \
408         -I$(top_builddir)/WebKit/gtk \
409         -I$(top_builddir)/WebKit/gtk/webkit \
410         -I$(GENSOURCESWEBKITDOM)
411
412 webkitgtk_cleanfiles += \
413         $(top_builddir)/stamp-webkitmarshal.cpp \
414         $(top_builddir)/stamp-webkitmarshal.h \
415         $(top_builddir)/stamp-webkitenumtypes.cpp \
416         $(top_builddir)/stamp-webkitenumtypes.h \
417         $(top_builddir)/Programs/GtkLauncher \
418         $(top_builddir)/WebKit/gtk/docs/version.xml \
419         $(top_builddir)/WebKit/gtk/docs/GNUmakefile \
420         $(top_builddir)/WebKit/gtk/webkit-1.0.pc \
421         $(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h \
422         $(top_builddir)/WebKit/gtk/webkit/webkitversion.h
423
424 pkgconfigdir = $(libdir)/pkgconfig
425 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
426
427 if ENABLE_INTROSPECTION
428 JSCORE_GIRSOURCES += JSCore-1.0.gir
429 WEBKIT_GIRSOURCES += WebKit-1.0.gir
430
431 # JSCore-1.0.gir is handwritten - this is a hack to make the typelib
432 # generation work during make dist
433 JSCore-1.0.gir: $(srcdir)/WebKit/gtk/JSCore-1.0.gir
434         cp $(srcdir)/WebKit/gtk/JSCore-1.0.gir $(builddir)/
435
436 $(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER) libwebkit-1.0.la
437         $(AM_V_GEN)$(G_IR_SCANNER) -v --namespace WebKit --nsversion=1.0 \
438              --include=GObject-2.0 \
439              --include=Gtk-2.0 \
440              --include=JSCore-1.0 \
441              --include=Soup-2.4 \
442              --library=webkit-1.0 \
443              --libtool="$(LIBTOOL)" \
444              --pkg gobject-2.0 \
445              --pkg gtk+-2.0 \
446              --pkg libsoup-2.4 \
447              --output $@ \
448              --add-include-path $(top_srcdir)/WebKit/gtk \
449              -I$(top_srcdir)/WebKit/gtk \
450              -I$(top_builddir)/WebKit/gtk \
451              -I$(top_builddir)/DerivedSources \
452              -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \
453              -I$(top_srcdir) \
454              $(webkitgtk_h_api)
455
456 girdir = $(GIRDIR)
457 gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)
458
459 typelibsdir += $(GIRTYPELIBDIR)
460 typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
461
462 %.typelib: %.gir $(G_IR_COMPILER)
463         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(top_srcdir)/WebKit/gtk $< -o $@
464
465 CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
466
467 endif
468
469 EXTRA_DIST += WebKit/gtk/JSCore-1.0.gir
470
471 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
472 WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
473
474 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
475         @true
476
477 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
478         @true
479
480 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
481         $(AM_V_GEN) echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
482         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
483         echo timestamp > $(@F)
484
485 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
486         $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
487         echo timestamp > $(@F)
488
489 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
490         @true
491 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
492         $(AM_V_GEN)glib-mkenums \
493                         --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
494                         --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
495                         --fhead "#include <glib-object.h>\n\n" \
496                         --fhead "#include <webkit/webkitdefines.h>\n\n" \
497                         --fhead "G_BEGIN_DECLS\n\n" \
498                         --ftail "G_END_DECLS\n\n" \
499                         --ftail "#endif\n" \
500                         --fprod "#include <webkit/@basename@>\n\n" \
501                         --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
502                         --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
503                 $(webkitgtk_h_api) | \
504                 sed 's,web_kit,webkit,' | \
505                 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
506                 > xgen-gth \
507         && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
508         && rm -f xgen-gth \
509         && echo timestamp > $(@F)
510
511 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
512         $(AM_V_GEN)glib-mkenums \
513                         --fhead "#include <config.h>\n" \
514                         --fhead "#include <glib-object.h>\n" \
515                         --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
516                         --fhead "extern \"C\" {\n\n" \
517                         --fprod "\n/* enumerations from \"@filename@\" */" \
518                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
519                         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
520                         --vtail "    { 0, NULL, NULL }\n};\n\n" \
521                         --vtail "GType @enum_name@_get_type(void)\n{\n" \
522                         --vtail "    static GType type = 0;\n\n" \
523                         --vtail "    if (!type)\n" \
524                         --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
525                         --vtail "    return type;\n}\n\n" \
526                         --ftail "}\n" \
527                 $(webkitgtk_h_api) | \
528                 sed 's,web_kit,webkit,' \
529                 > xgen-gtc \
530         && cp xgen-gtc $@ \
531         && rm -f xgen-gtc
532
533 WebKit/gtk/webkit/webkitdomenumtypes.h: stamp-webkitdomenumtypes.h
534         @true
535 stamp-webkitdomenumtypes.h: $(libgdom_h_api) GNUmakefile
536         $(AM_V_GEN)glib-mkenums \
537                         --fhead "#ifndef WEBKIT_DOM_ENUM_TYPES_H\n" \
538                         --fhead "#define WEBKIT_DOM_ENUM_TYPES_H\n\n" \
539                         --fhead "#include <glib-object.h>\n\n" \
540                         --fhead "G_BEGIN_DECLS\n\n" \
541                         --ftail "G_END_DECLS\n\n" \
542                         --ftail "#endif\n" \
543                         --fprod "#include <webkit/@basename@>\n\n" \
544                         --eprod "#define WEBKIT_DOM_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
545                         --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);n\n" \
546                         $(libgdom_h_api) | \
547                 sed 's,web_kit,webkit_dom,' | \
548                 sed 's,WEBKIT_DOM_TYPE_KIT,WEBKIT_DOM_TYPE,' \
549                 > xgen-cgth \
550         && (cmp -s xgen-cgth WebKit/gtk/webkit/webkitdomenumtypes.h || cp xgen-cgth WebKit/gtk/webkit/webkitdomenumtypes.h) \
551         && rm -f xgen-cgth \
552         && echo timestamp > $(@F)
553
554 DerivedSources/webkitdomenumtypes.cpp: $(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h $(libgdom_h_api) GNUmakefile
555         $(AM_V_GEN)glib-mkenums \
556                         --fhead "#include <config.h>\n" \
557                         --fhead "#include <glib-object.h>\n" \
558                         --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h\"\n\n" \
559                         --fhead "extern \"C\" {\n\n" \
560                         --fprod "\n/* enumerations from \"@filename@\" */" \
561                         --vhead "static const G@Type@Value _@enum_name@_values] = {" \
562                         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
563                         --vtail "    { 0, NULL, NULL }\n};\n\n" \
564                         --vtail "GType @enum_name@_get_type(void)\n{\n" \
565                         --vtail "    static GType type = 0;\n\n" \
566                         --vtail "    if (!type)\n" \
567                         --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
568                         --vtail "    return type;\n}\n\n" \
569                         --ftail "}\n" \
570                 $(libgdom_h_api) | \
571                 sed 's,web_kit,webkitdom,' \
572                 > xgen-cgtc \
573         && cp xgen-cgtc $@ \
574         && rm -f xgen-cgtc
575
576 # Files that will be distributed
577 EXTRA_DIST += \
578         $(srcdir)/gtk-doc.make \
579         WebKit/LICENSE \
580         $(javascriptcore_dist) \
581         $(webcore_dist) \
582         $(srcdir)/autotools/symbols.filter \
583         $(srcdir)/WebKit/gtk/ChangeLog \
584         $(srcdir)/WebKit/gtk/NEWS \
585         $(srcdir)/WebKit/gtk/webkitmarshal.list \
586         $(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
587         $(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
588         $(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
589         $(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
590         $(srcdir)/WebKit/gtk/docs/version.xml.in \
591         $(srcdir)/WebKit/gtk/po/* \
592         $(srcdir)/WebKit/gtk/resources/* \
593         $(srcdir)/WebKit/gtk/tests/resources/* \
594         $(srcdir)/WebKit/gtk/tests/test_utils.h
595
596 # extra resource files
597 resourcesdir = ${datadir}/webkit-1.0/resources
598 dist_resources_DATA = \
599         $(shell ls $(srcdir)/WebKit/gtk/resources/*.html)
600
601 # END WEBKIT GTK+
602
603 # Include module makefiles
604 include JavaScriptCore/GNUmakefile.am
605 include WebCore/GNUmakefile.am
606 include WebKitTools/GNUmakefile.am
607 include WebKit/gtk/po/GNUmakefile.am
608
609 # Build unit tests
610 noinst_PROGRAMS += $(TEST_PROGS)
611
612 webkit_tests_cflags = \
613         -fno-strict-aliasing \
614         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
615         -I$(srcdir)/WebKit/gtk \
616         -I$(top_builddir)/WebKit/gtk \
617         -I$(top_builddir)/DerivedSources \
618         -I$(top_srcdir)/WebCore/bindings \
619         -I$(top_srcdir)/WebCore/bindings/gobject \
620         $(global_cflags) \
621         $(GLIB_CFLAGS) \
622         $(GTK_CFLAGS) \
623         $(LIBSOUP_CFLAGS)
624
625 webkit_tests_ldadd = \
626         libwebkit-1.0.la \
627         $(GTK_LIBS)     \
628         $(GLIB_LIBS) \
629         $(LIBSOUP_LIBS)
630
631 webkit_tests_ldflags = \
632         -no-install \
633         -no-fast-install
634
635 TEST_PROGS += \
636         Programs/unittests/testdomdocument \
637         Programs/unittests/testhttpbackend \
638         Programs/unittests/testloading \
639         Programs/unittests/testglobals \
640         Programs/unittests/testmimehandling \
641         Programs/unittests/testnetworkrequest \
642         Programs/unittests/testnetworkresponse \
643         Programs/unittests/testwebframe \
644         Programs/unittests/testwebbackforwardlist \
645         Programs/unittests/testwebhistoryitem \
646         Programs/unittests/testwindow \
647         Programs/unittests/testdownload \
648         Programs/unittests/testatk \
649         Programs/unittests/testatkroles \
650         Programs/unittests/testhittestresult \
651         Programs/unittests/testwebsettings \
652         Programs/unittests/testwebresource \
653         Programs/unittests/testwebdatasource \
654         Programs/unittests/testwebview \
655         Programs/unittests/testkeyevents
656
657 # Add additional tests here
658 Programs_unittests_testdomdocument_SOURCES = WebKit/gtk/tests/testdomdocument.c
659 Programs_unittests_testdomdocument_CFLAGS = $(webkit_tests_cflags)
660 Programs_unittests_testdomdocument_LDADD = $(webkit_tests_ldadd)
661 Programs_unittests_testdomdocument_LDFLAGS = $(webkit_tests_ldflags)
662
663 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
664 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
665 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
666 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
667
668 Programs_unittests_testglobals_SOURCES = WebKit/gtk/tests/testglobals.c
669 Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags)
670 Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd)
671 Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags)
672
673 Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
674 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
675 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
676 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
677
678 Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c
679 Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
680 Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
681 Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)
682
683 Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
684 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
685 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
686 Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
687
688 Programs_unittests_testnetworkresponse_SOURCES = WebKit/gtk/tests/testnetworkresponse.c
689 Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags)
690 Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd)
691 Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags)
692
693 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
694 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
695 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
696 Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
697
698 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
699 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
700 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
701 Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
702
703 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
704 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
705 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
706 Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
707
708 Programs_unittests_testwindow_SOURCES = WebKit/gtk/tests/testwindow.c
709 Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags)
710 Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd)
711 Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags)
712
713 Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
714 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
715 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
716 Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
717
718 Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c
719 Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
720 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
721 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
722
723 Programs_unittests_testatkroles_SOURCES = WebKit/gtk/tests/testatkroles.c
724 Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags)
725 Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd)
726 Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags)
727
728 Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
729 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
730 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
731 Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
732
733 Programs_unittests_testwebresource_SOURCES = WebKit/gtk/tests/testwebresource.c
734 Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags)
735 Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd)
736
737 Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasource.c
738 Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
739 Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)
740
741 Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c
742 Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
743 Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
744 Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)
745
746 Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c
747 Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
748 Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)
749
750 Programs_unittests_testkeyevents_SOURCES = WebKit/gtk/tests/testkeyevents.c
751 Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags)
752 Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd)
753 Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags)
754
755 # Autogenerated sources
756 BUILT_SOURCES += \
757         $(javascriptcore_built_sources) \
758         $(javascriptcore_built_nosources) \
759         $(webcore_built_sources) \
760         $(webcore_built_nosources) \
761         $(webkitgtk_built_sources) \
762         $(webkitgtk_built_nosources) \
763         $(gdom_built_nosources)
764
765 # Project-wide clean rules
766 # Files that will be cleaned
767 CLEANFILES += \
768         $(BUILT_SOURCES) \
769         $(webkitgtk_cleanfiles)
770
771 DISTCLEANFILES += \
772         $(CLEANFILES) \
773         $(builddir)/doltcompile \
774         $(builddir)/doltlibtool
775
776 MAINTAINERCLEANFILES += \
777         $(CLEANFILES) \
778         $(builddir)/doltcompile \
779         $(builddir)/doltlibtool \
780         $(srcdir)/aconfig.h.in \
781         $(srcdir)/autotools/config.* \
782         $(srcdir)/autotools/compile \
783         $(srcdir)/autotools/depcomp \
784         $(srcdir)/autotools/install-sh \
785         $(srcdir)/autotools/missing \
786         $(srcdir)/configure \
787         $(srcdir)/GNUmakefile.in \
788         $(srcdir)/INSTALL \
789         $(srcdir)/README \
790         $(top_builddir)/config.*
791
792 # Older automake versions (1.7) place Plo files in a different place so we need
793 # to create the output directory manually.
794 all-local: stamp-po
795         $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
796
797 # remove built sources and program directories
798 clean-local:
799         -rm -rf $(GENPROGRAMS)
800
801 maintainer-clean-local: distclean-local
802
803 distclean-local:
804         -rm -rf $(GENSOURCES) $(GENPROGRAMS)
805
806 install-data-local: po-install-data-local
807
808 installdirs-data-local: po-installdirs-data-local
809
810 uninstall-local: po-uninstall-local
811
812 # Run all tests in cwd
813 # FIXME: we should run this under xvfb
814 test: $(TEST_PROGS)
815         $(GTESTER) --verbose $(TEST_PROGS);
816
817 # test-report: run tests in cwd and generate report
818 # full-report: run tests in cwd with -m perf and -m slow and generate report
819 # perf-report: run tests in cwd with -m perf and generate report
820 test-report full-report perf-report: $(TEST_PROGS)
821         @ case $@ in \
822           test-report) test_options="-k";; \
823           full-report) test_options="-k -m=perf";; \
824           perf-report) test_options="-k -m=perf -m=slow";; \
825           esac ; \
826           $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
827           $(GTESTER_REPORT) test-report.xml > test-report.html ;
828
829 .PHONY: test test-report perf-report full-report
830 check-local: test