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