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