2010-07-23 Adam Barth <abarth@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 GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
39 GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
40 GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
41 GENPROGRAMS := $(top_builddir)/Programs
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 noinst_LTLIBRARIES :=
52 lib_LTLIBRARIES :=
53 IDL_BINDINGS :=
54 TEST_PROGS :=
55 POFILES :=
56 MOFILES :=
57 javascriptcore_h_api :=
58 javascriptcore_cppflags:=
59 javascriptcore_sources :=
60 javascriptcore_built_sources :=
61 javascriptcore_built_nosources :=
62 webcore_cppflags :=
63 webcore_sources :=
64 webcore_libadd :=
65 webcore_built_sources :=
66 webcore_built_nosources :=
67 webcoregtk_cppflags :=
68 webcoregtk_sources :=
69 IDL_BINDINGS_GDOM :=
70 GDOM_AUTO_CLASSES :=
71 GDOM_FIXED_CLASSES :=
72 GDOM_CLASSES :=
73 GDOM_HEADERS_BUILT :=
74 GDOM_HEADERS_FIXED :=
75 libgdom_h_api :=
76 libgdom_cleanfiles :=
77 webkitgtk_h_api :=
78 webkitgtk_sources :=
79 webkitgtk_cppflags :=
80 webkitgtk_built_sources :=
81 webkitgtk_built_nosources :=
82 webkitgtk_cleanfiles :=
83 global_cppflags :=
84 global_cflags :=
85 global_cxxflags :=
86 corekit_cflags :=
87 corekit_cppflags :=
88 JSCORE_GIRSOURCES :=
89 WEBKIT_GIRSOURCES :=
90 typelibsdir :=
91 typelibs_DATA :=
92 EXTRA_DIST :=
93 BUILT_SOURCES :=
94 CLEANFILES :=
95 DISTCLEANFILES :=
96 MAINTAINERCLEANFILES :=
97
98 webcoregtk_cppflags += \
99         -I$(top_builddir)/DerivedSources/webkit \
100         -I$(srcdir)/WebCore/bindings \
101         -I$(srcdir)/WebCore/bindings/gobject
102
103 # CFLAGS/CXXFLAGS used by WebCore and WebKit
104 #
105 # gtk+.pc already include glib, cairo, freetype and pango CFLAGS
106 # Don't include them for now to reduce the noise when compiling
107 # $(GLIB_CFLAGS) $(CAIRO_CFLAGS) $(PANGO_CFLAGS)  $(FREETYPE_CFLAGS)
108 corekit_cflags += \
109         -fno-strict-aliasing \
110         $(COVERAGE_CFLAGS) \
111         $(ENCHANT_CFLAGS) \
112         $(GAIL_CFLAGS) \
113         $(GEOCLUE_CFLAGS) \
114         $(GLIB_CFLAGS) \
115         $(GSTREAMER_CFLAGS) \
116         $(GTK_CFLAGS) \
117         $(HILDON_CFLAGS) \
118         $(LIBSOUP_CFLAGS) \
119         $(LIBXML_CFLAGS) \
120         $(LIBXSLT_CFLAGS) \
121         $(SQLITE3_CFLAGS) \
122         $(UNICODE_CFLAGS) \
123         $(XT_CFLAGS)
124
125 # When building webcore/webkit, we want WebCore/config.h and NOT
126 # JavaScriptCore/config.h, hence, it's important that WebCore/ should come first
127 # before JavaScriptCore in the include path.
128 corekit_cppflags += \
129         $(global_cppflags) \
130         $(webcore_cppflags) \
131         $(webcoregtk_cppflags) \
132         $(javascriptcore_cppflags)
133
134 # For the Gtk port we want to use XP_UNIX both in X11 and Mac
135 if !TARGET_WIN32
136 corekit_cppflags += -DXP_UNIX
137 endif
138
139 # Default compiler flags
140 global_cflags += \
141         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
142         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
143         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
144         -Wno-unused-parameter -Wno-parentheses \
145         -fno-exceptions
146
147 global_cxxflags += \
148         $(global_cflags) \
149         $(SYMBOL_VISIBILITY_INLINES) \
150         -fno-rtti
151
152 # -no-undefined required for building DLLs on Windows
153 # It breaks the build on other platforms, so we use it conditionally
154 if OS_WIN32
155 no_undefined = -no-undefined
156 version_script = -export-symbols-regex "^(webkit_|JS).*"
157 endif
158
159 if OS_GNU
160 version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
161 endif
162
163 # Shared libraries
164 lib_LTLIBRARIES += \
165         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
166
167 # Convenience libraries
168 noinst_LTLIBRARIES += \
169         libJavaScriptCore.la
170
171 # JavaScriptCore
172 javascriptcore_cppflags += \
173         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
174         -I$(srcdir)/JavaScriptCore/parser \
175         -I$(srcdir)/JavaScriptCore/wtf \
176         -I$(srcdir)/JavaScriptCore/wtf/gtk \
177         -I$(srcdir)/JavaScriptCore/wtf/gobject \
178         -I$(top_builddir)/DerivedSources/JavaScriptCore
179
180 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
181         $(javascriptcore_built_nosources)
182
183 nodist_libJavaScriptCore_la_SOURCES = \
184         $(javascriptcore_built_sources)
185
186 libJavaScriptCore_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/JavaScriptCore
187 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
188
189 libJavaScriptCore_la_SOURCES = \
190         $(javascriptcore_sources)
191
192 libJavaScriptCore_la_LIBADD = \
193         $(UNICODE_LIBS) \
194         $(GLIB_LIBS) \
195         -lpthread
196
197 libJavaScriptCore_la_CXXFLAGS = \
198         $(global_cxxflags) \
199         $(libJavaScriptCore_la_CFLAGS)
200
201 libJavaScriptCore_la_CFLAGS = \
202         -fstrict-aliasing \
203         -O3 \
204         $(global_cflags) \
205         $(GLIB_CFLAGS) \
206         $(UNICODE_CFLAGS)
207
208 libJavaScriptCore_la_CPPFLAGS = \
209         $(global_cppflags) \
210         $(javascriptcore_cppflags)
211
212 # WebKit
213 nodist_EXTRA_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
214         $(webcore_built_nosources)
215
216 nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
217         $(webcore_built_sources) \
218         $(webkitgtk_built_sources)
219
220 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/webkit
221 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
222         $(webkitgtk_h_api) \
223         WebKit/gtk/webkit/webkitenumtypes.h
224
225 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
226         $(webcore_sources) \
227         $(webcoregtk_sources) \
228         $(webkitgtk_sources)
229
230 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
231         $(global_cxxflags) \
232         $(corekit_cflags)
233
234 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
235         $(global_cflags) \
236         $(corekit_cflags)
237
238 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
239         $(corekit_cppflags) \
240         $(webkitgtk_cppflags) \
241         $(HILDON_CPPFLAGS)
242
243 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
244         -version-info @LIBWEBKITGTK_VERSION@ \
245         $(version_script) \
246         $(no_undefined)
247
248 libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
249         -lpthread \
250         libJavaScriptCore.la \
251         libgdom.la \
252         $(webcore_ldflags) \
253         $(CAIRO_LIBS) \
254         $(COVERAGE_LDFLAGS) \
255         $(ENCHANT_LIBS) \
256         $(FREETYPE_LIBS) \
257         $(GAIL_LIBS) \
258         $(GEOCLUE_LIBS) \
259         $(GLIB_LIBS) \
260         $(GSTREAMER_LIBS) \
261         $(GTK_LIBS) \
262         $(HILDON_LIBS) \
263         $(JPEG_LIBS) \
264         $(LIBSOUP_LIBS) \
265         $(LIBXML_LIBS) \
266         $(LIBXSLT_LIBS) \
267         $(PANGO_LIBS) \
268         $(PNG_LIBS) \
269         $(SQLITE3_LIBS) \
270         $(UNICODE_LIBS) \
271         $(XT_LIBS)
272
273 libgdom_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/webkit
274 nodist_libgdom_la_HEADERS = \
275         $(libgdom_h_api)
276
277 libgdom_cleanfiles += \
278         $(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h \
279         $(top_builddir)/libgdom.la \
280         $(top_builddir)/stamp-webkitdomenumtypes.h
281
282 #
283 # Extra checks and flags
284 global_cppflags += \
285         -DBUILDING_CAIRO__=1 \
286         -DBUILDING_GTK__=1 \
287         -DWTF_CHANGES
288
289 if USE_ICU_UNICODE
290 global_cppflags += \
291         -DWTF_USE_ICU_UNICODE=1
292 endif
293
294 if USE_GLIB_UNICODE
295 global_cppflags += \
296         -DWTF_USE_GLIB_UNICODE=1
297 endif
298
299 if !ENABLE_FAST_MALLOC
300 global_cppflags += \
301         -DUSE_SYSTEM_MALLOC
302 endif
303
304 if !ENABLE_DEBUG
305 global_cppflags += -DNDEBUG
306 global_cflags += $(SYMBOL_VISIBILITY)
307 else
308 webcoregtk_cppflags += \
309         -DG_DISABLE_DEPRECATED \
310         -DGDK_PIXBUF_DISABLE_DEPRECATED \
311         -DGDK_DISABLE_DEPRECATED \
312         -DGTK_DISABLE_DEPRECATED \
313         -DPANGO_DISABLE_DEPRECATED
314
315 # Might be useful in the future
316 #       -DGDK_MULTIHEAD_SAFE \
317 #       -DGTK_MULTIHEAD_SAFE
318 endif
319
320 if ENABLE_COVERAGE
321 global_cppflags += \
322         -DGCC_GENERATE_TEST_COVERAGE_FILES \
323         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
324 endif
325
326 webkitgtk_h_api += \
327         $(srcdir)/WebKit/gtk/webkit/webkit.h \
328         $(srcdir)/WebKit/gtk/webkit/webkitdefines.h \
329         $(srcdir)/WebKit/gtk/webkit/webkitdownload.h \
330         $(srcdir)/WebKit/gtk/webkit/webkiterror.h \
331         $(srcdir)/WebKit/gtk/webkit/webkithittestresult.h \
332         $(srcdir)/WebKit/gtk/webkit/webkitnetworkrequest.h \
333         $(srcdir)/WebKit/gtk/webkit/webkitnetworkresponse.h \
334         $(srcdir)/WebKit/gtk/webkit/webkitsoupauthdialog.h \
335         $(srcdir)/WebKit/gtk/webkit/webkitwebbackforwardlist.h \
336         $(srcdir)/WebKit/gtk/webkit/webkitwebdatasource.h \
337         $(srcdir)/WebKit/gtk/webkit/webkitwebframe.h \
338         $(srcdir)/WebKit/gtk/webkit/webkitwebhistoryitem.h \
339         $(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \
340         $(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
341         $(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
342         $(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
343         $(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
344         $(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
345         $(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
346         $(srcdir)/WebKit/gtk/webkit/webkitwebview.h \
347         $(srcdir)/WebKit/gtk/webkit/webkitwebdatabase.h \
348         $(srcdir)/WebKit/gtk/webkit/webkitsecurityorigin.h \
349         $(top_builddir)/WebKit/gtk/webkit/webkitversion.h
350
351 webkitgtk_built_sources += \
352         DerivedSources/webkit/webkitenumtypes.cpp \
353         DerivedSources/webkit/webkitdomenumtypes.cpp \
354         DerivedSources/webkit/webkitmarshal.cpp \
355         DerivedSources/webkit/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$(GENSOURCES_WEBKIT)
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/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.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/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc
426
427 if ENABLE_INTROSPECTION
428
429 JSCore-@WEBKITGTK_API_VERSION@.gir: $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir
430         cp $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir $(builddir)/
431
432 JSCORE_GIRSOURCES += JSCore-@WEBKITGTK_API_VERSION@.gir
433 WEBKIT_GIRSOURCES += WebKit-@WEBKITGTK_API_VERSION@.gir
434
435 $(WEBKIT_GIRSOURCES): $(G_IR_SCANNER) $(JSCORE_GIRSOURCES) libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
436         $(AM_V_GEN)$(G_IR_SCANNER) -v --namespace WebKit --nsversion=@WEBKITGTK_API_VERSION@ \
437              --include=GObject-2.0 \
438              --include=Gtk-@GTK_API_VERSION@ \
439              --include=JSCore-@WEBKITGTK_API_VERSION@ \
440              --include=Soup-2.4 \
441              --library=webkitgtk-@WEBKITGTK_API_VERSION@ \
442              --libtool="$(LIBTOOL)" \
443              --pkg gobject-2.0 \
444              --pkg gtk+-@GTK_API_VERSION@ \
445              --pkg libsoup-2.4 \
446              --output $@ \
447              --add-include-path $(top_srcdir)/WebKit/gtk \
448              --add-include-path $(builddir) \
449              -I$(top_srcdir)/WebKit/gtk \
450              -I$(top_builddir)/WebKit/gtk \
451              -I$(top_builddir)/DerivedSources \
452              -I$(top_builddir)/DerivedSources/webkit \
453              -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \
454              -I$(top_srcdir) \
455              $(webkitgtk_h_api) \
456              $(libgdom_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 --includedir $(builddir) $< -o $@
466
467 CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
468
469 endif
470
471 EXTRA_DIST += $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir
472
473 WEBKIT_MARSHAL = $(GENSOURCES_WEBKIT)/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/webkit/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/webkit/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         $(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-@WEBKITGTK_API_VERSION@/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         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.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/testdomdomwindow \
638         Programs/unittests/testdomnode \
639         Programs/unittests/testhttpbackend \
640         Programs/unittests/testloading \
641         Programs/unittests/testglobals \
642         Programs/unittests/testmimehandling \
643         Programs/unittests/testnetworkrequest \
644         Programs/unittests/testnetworkresponse \
645         Programs/unittests/testwebframe \
646         Programs/unittests/testwebbackforwardlist \
647         Programs/unittests/testwebhistoryitem \
648         Programs/unittests/testwindow \
649         Programs/unittests/testdownload \
650         Programs/unittests/testatk \
651         Programs/unittests/testatkroles \
652         Programs/unittests/testhittestresult \
653         Programs/unittests/testwebsettings \
654         Programs/unittests/testwebresource \
655         Programs/unittests/testwebdatasource \
656         Programs/unittests/testwebview \
657         Programs/unittests/testkeyevents \
658         Programs/unittests/testcopyandpaste
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_testdomnode_SOURCES = WebKit/gtk/tests/testdomnode.c
672 Programs_unittests_testdomnode_CFLAGS = $(webkit_tests_cflags)
673 Programs_unittests_testdomnode_LDADD = $(webkit_tests_ldadd)
674 Programs_unittests_testdomnode_LDFLAGS = $(webkit_tests_ldflags)
675
676 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
677 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
678 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
679 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
680
681 Programs_unittests_testglobals_SOURCES = WebKit/gtk/tests/testglobals.c
682 Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags)
683 Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd)
684 Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags)
685
686 Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
687 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
688 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
689 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
690
691 Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c
692 Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
693 Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
694 Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)
695
696 Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
697 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
698 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
699 Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
700
701 Programs_unittests_testnetworkresponse_SOURCES = WebKit/gtk/tests/testnetworkresponse.c
702 Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags)
703 Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd)
704 Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags)
705
706 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
707 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
708 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
709 Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
710
711 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
712 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
713 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
714 Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
715
716 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
717 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
718 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
719 Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
720
721 Programs_unittests_testwindow_SOURCES = WebKit/gtk/tests/testwindow.c
722 Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags)
723 Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd)
724 Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags)
725
726 Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
727 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
728 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
729 Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
730
731 Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c
732 Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
733 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
734 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
735
736 Programs_unittests_testatkroles_SOURCES = WebKit/gtk/tests/testatkroles.c
737 Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags)
738 Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd)
739 Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags)
740
741 Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
742 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
743 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
744 Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
745
746 Programs_unittests_testwebresource_SOURCES = WebKit/gtk/tests/testwebresource.c
747 Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags)
748 Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd)
749
750 Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasource.c
751 Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
752 Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)
753
754 Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c
755 Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
756 Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
757 Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)
758
759 Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c
760 Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
761 Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)
762
763 Programs_unittests_testkeyevents_SOURCES = WebKit/gtk/tests/testkeyevents.c
764 Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags)
765 Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd)
766 Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags)
767
768 Programs_unittests_testcopyandpaste_SOURCES = WebKit/gtk/tests/testcopyandpaste.c
769 Programs_unittests_testcopyandpaste_CFLAGS = $(webkit_tests_cflags)
770 Programs_unittests_testcopyandpaste_LDADD = $(webkit_tests_ldadd)
771 Programs_unittests_testcopyandpaste_LDFLAGS = $(webkit_tests_ldflags)
772
773 # Autogenerated sources
774 BUILT_SOURCES += \
775         $(javascriptcore_built_sources) \
776         $(javascriptcore_built_nosources) \
777         $(webcore_built_sources) \
778         $(webcore_built_nosources) \
779         $(webkitgtk_built_sources) \
780         $(webkitgtk_built_nosources) \
781         $(gdom_built_nosources)
782
783 # Project-wide clean rules
784 # Files that will be cleaned
785 CLEANFILES += \
786         $(BUILT_SOURCES) \
787         $(webkitgtk_cleanfiles) \
788         $(libgdom_cleanfiles)
789
790 DISTCLEANFILES += \
791         $(CLEANFILES) \
792         $(builddir)/doltcompile \
793         $(builddir)/doltlibtool
794
795 MAINTAINERCLEANFILES += \
796         $(CLEANFILES) \
797         $(builddir)/doltcompile \
798         $(builddir)/doltlibtool \
799         $(srcdir)/aconfig.h.in \
800         $(srcdir)/autotools/config.* \
801         $(srcdir)/autotools/compile \
802         $(srcdir)/autotools/depcomp \
803         $(srcdir)/autotools/install-sh \
804         $(srcdir)/autotools/missing \
805         $(srcdir)/configure \
806         $(srcdir)/GNUmakefile.in \
807         $(srcdir)/INSTALL \
808         $(srcdir)/README \
809         $(top_builddir)/config.*
810
811 # Older automake versions (1.7) place Plo files in a different place so we need
812 # to create the output directory manually.
813 all-local: stamp-po
814         $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
815
816 # remove built sources and program directories
817 clean-local:
818         -rm -rf $(GENPROGRAMS)
819
820 maintainer-clean-local: distclean-local
821
822 distclean-local:
823         -rm -rf $(GENSOURCES) $(GENPROGRAMS)
824
825 dist-hook:
826         cp $(srcdir)/WebKit/gtk/NEWS $(distdir)
827
828 install-data-local: po-install-data-local
829
830 installdirs-data-local: po-installdirs-data-local
831
832 uninstall-local: po-uninstall-local
833
834 # Run all tests in cwd
835 # FIXME: we should run this under xvfb
836 test: $(TEST_PROGS)
837         $(GTESTER) --verbose $(TEST_PROGS);
838
839 # test-report: run tests in cwd and generate report
840 # full-report: run tests in cwd with -m perf and -m slow and generate report
841 # perf-report: run tests in cwd with -m perf and generate report
842 test-report full-report perf-report: $(TEST_PROGS)
843         @ case $@ in \
844           test-report) test_options="-k";; \
845           full-report) test_options="-k -m=perf";; \
846           perf-report) test_options="-k -m=perf -m=slow";; \
847           esac ; \
848           $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
849           $(GTESTER_REPORT) test-report.xml > test-report.html ;
850
851 .PHONY: test test-report perf-report full-report
852 check-local: test