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