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