1 # Top-level Makefile rule for automake
3 # Variable conventions:
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
12 # _cleanfiles = files that will be removed by the clean target
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
22 # global_cppflags = CPPFLAGS that apply to JSC, WebCore, and to any
24 # global_cflags = CFLAGS that apply to JSC, WebCore, and to
26 # global_cxxflags = CXXFLAGS that apply to JSC, WebCore, and to any
32 # Directory for autogenerated sources
33 GENSOURCES := $(top_builddir)/DerivedSources
34 GENPROGRAMS := $(top_builddir)/Programs
36 # Script for creating hash tables
37 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/create_hash_table
39 # Programs to run the WebKitGtk unit tests
41 GTESTER_REPORT = gtester-report
43 # Libraries and support components
52 javascriptcore_h_api :=
53 javascriptcore_cppflags:=
54 javascriptcore_sources :=
55 javascriptcore_built_sources :=
56 javascriptcore_built_nosources :=
57 javascriptcore_dist :=
61 webcore_built_sources :=
62 webcore_built_nosources :=
64 webcoregtk_cppflags :=
69 webkitgtk_built_sources :=
70 webkitgtk_built_nosources :=
71 webkitgtk_cleanfiles :=
78 # CFLAGS/CXXFLAGS used by WebCore and WebKit
80 # gtk+.pc already include glib, cairo, freetype and pango CFLAGS
81 # Don't include them for now to reduce the noise when compiling
82 # $(GLIB_CFLAGS) $(CAIRO_CFLAGS) $(PANGO_CFLAGS) $(FREETYPE_CFLAGS)
84 -fno-strict-aliasing \
90 $(GNOMEKEYRING_CFLAGS) \
101 # When building webcore/webkit, we want WebCore/config.h and NOT
102 # JavaScriptCore/config.h, hence, it's important that WebCore/ should come first
103 # before JavaScriptCore in the include path.
104 corekit_cppflags += \
106 $(webcore_cppflags) \
107 $(webcoregtk_cppflags) \
108 $(javascriptcore_cppflags)
111 corekit_cppflags += -DXP_UNIX
114 # Default compiler flags
116 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
117 -Wformat -Wformat-security -Wno-format-y2k -Wundef \
118 -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
119 -Wno-unused-parameter -Wno-parentheses \
124 $(SYMBOL_VISIBILITY_INLINES) \
127 # -no-undefined required for building DLLs on Windows
128 # It breaks the build on other platforms, so we use it conditionally
130 no_undefined = -no-undefined
134 version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
141 # Convenience libraries
142 noinst_LTLIBRARIES = \
143 libJavaScriptCore.la \
147 javascriptcore_cppflags += \
148 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
149 -I$(srcdir)/JavaScriptCore/parser \
150 -I$(srcdir)/JavaScriptCore/wtf \
151 -I$(top_builddir)/DerivedSources
153 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
154 $(javascriptcore_built_nosources)
156 nodist_libJavaScriptCore_la_SOURCES = \
157 $(javascriptcore_built_sources)
159 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
160 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
162 libJavaScriptCore_la_SOURCES = \
163 $(javascriptcore_sources)
165 libJavaScriptCore_la_LIBADD = \
170 libJavaScriptCore_la_CXXFLAGS = \
172 $(libJavaScriptCore_la_CFLAGS)
174 libJavaScriptCore_la_CFLAGS = \
181 libJavaScriptCore_la_CPPFLAGS = \
183 $(javascriptcore_cppflags)
186 nodist_EXTRA_libWebCore_la_SOURCES = \
187 $(webcore_built_nosources)
189 nodist_libWebCore_la_SOURCES = \
190 $(webcore_built_sources)
192 libWebCore_la_SOURCES = \
194 $(webcoregtk_sources)
196 libWebCore_la_CXXFLAGS = \
200 libWebCore_la_CFLAGS = \
204 libWebCore_la_CPPFLAGS = \
208 nodist_libwebkit_1_0_la_SOURCES = \
209 $(webkitgtk_built_sources)
211 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
212 libwebkit_1_0_la_HEADERS = \
214 WebKit/gtk/webkit/webkitenumtypes.h
216 libwebkit_1_0_la_SOURCES = \
219 libwebkit_1_0_la_CXXFLAGS = \
223 libwebkit_1_0_la_CFLAGS = \
227 libwebkit_1_0_la_CPPFLAGS = \
228 $(corekit_cppflags) \
229 $(webkitgtk_cppflags) \
232 libwebkit_1_0_la_LDFLAGS = \
233 -version-info @LIBWEBKITGTK_VERSION@ \
237 libwebkit_1_0_la_LIBADD = \
239 libJavaScriptCore.la \
244 $(COVERAGE_LDFLAGS) \
250 $(GNOMEKEYRING_LIBS) \
265 # Extra checks and flags
267 -DBUILDING_CAIRO__=1 \
273 -DWTF_USE_ICU_UNICODE=1
277 # https://bugs.webkit.org/show_bug.cgi?id=15914
278 # In patch 1/4 we are compiling a hybrid version of GLib WTF Unicode
279 # functionality mixed with ICU-based text codecs and TextBreakIterator.
280 # For the transition, introducing an interim HYBRID macro.
281 # This macro is required for compiling WTF with GLib Unicode backend,
282 # but at the same time keeping ICU dependency for codecs and break iterator.
283 # It will be removed with patch 3/4 of the above bug.
285 -DWTF_USE_GLIB_UNICODE=1 \
286 -DWTF_USE_GLIB_ICU_UNICODE_HYBRID=1
289 if !ENABLE_FAST_MALLOC
295 global_cppflags += -DNDEBUG
296 global_cflags += $(SYMBOL_VISIBILITY)
299 webcoregtk_cppflags += \
300 -DG_DISABLE_DEPRECATED \
301 -DGDK_PIXBUF_DISABLE_DEPRECATED \
302 -DGDK_DISABLE_DEPRECATED \
303 -DGTK_DISABLE_DEPRECATED \
304 -DPANGO_DISABLE_DEPRECATED
306 # Might be useful in the future
307 # -DGDK_MULTIHEAD_SAFE \
308 # -DGTK_MULTIHEAD_SAFE
313 -DGCC_GENERATE_TEST_COVERAGE_FILES \
314 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
318 WebKit/gtk/webkit/webkit.h \
319 WebKit/gtk/webkit/webkitdefines.h \
320 WebKit/gtk/webkit/webkitdownload.h \
321 WebKit/gtk/webkit/webkiterror.h \
322 WebKit/gtk/webkit/webkitnetworkrequest.h \
323 WebKit/gtk/webkit/webkitsoupauthdialog.h \
324 WebKit/gtk/webkit/webkitversion.h \
325 WebKit/gtk/webkit/webkitwebbackforwardlist.h \
326 WebKit/gtk/webkit/webkitwebframe.h \
327 WebKit/gtk/webkit/webkitwebhistoryitem.h \
328 WebKit/gtk/webkit/webkitwebinspector.h \
329 WebKit/gtk/webkit/webkitwebnavigationaction.h \
330 WebKit/gtk/webkit/webkitwebpolicydecision.h \
331 WebKit/gtk/webkit/webkitwebsettings.h \
332 WebKit/gtk/webkit/webkitwebwindowfeatures.h \
333 WebKit/gtk/webkit/webkitwebview.h
335 webkitgtk_built_sources += \
336 DerivedSources/webkitenumtypes.cpp \
337 DerivedSources/webkitmarshal.cpp \
338 DerivedSources/webkitmarshal.h \
339 WebKit/gtk/webkit/webkitenumtypes.h
341 webkitgtk_sources += \
342 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
343 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
344 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
345 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
346 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
347 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
348 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
349 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
350 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
351 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
352 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
353 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
354 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
355 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
356 WebKit/gtk/webkit/webkitapplicationcache.cpp \
357 WebKit/gtk/webkit/webkitdownload.cpp \
358 WebKit/gtk/webkit/webkiterror.cpp \
359 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
360 WebKit/gtk/webkit/webkitprivate.cpp \
361 WebKit/gtk/webkit/webkitprivate.h \
362 WebKit/gtk/webkit/webkitsoupauthdialog.c \
363 WebKit/gtk/webkit/webkitversion.cpp \
364 WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
365 WebKit/gtk/webkit/webkitwebframe.cpp \
366 WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
367 WebKit/gtk/webkit/webkitwebinspector.cpp \
368 WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
369 WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
370 WebKit/gtk/webkit/webkitwebsettings.cpp \
371 WebKit/gtk/webkit/webkitwebview.cpp \
372 WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
374 webkitgtk_cppflags += \
376 -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
377 -DDATA_DIR=\"${datadir}\" \
378 -I$(srcdir)/WebKit/gtk \
379 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
380 -I$(srcdir)/WebKit/gtk/webkit \
381 -I$(top_builddir)/WebKit/gtk/webkit
384 webkitgtk_cppflags += \
385 -DWTF_USE_GNOMEKEYRING=1
388 webkitgtk_cleanfiles += \
389 $(top_builddir)/WebKit/gtk/docs/version.xml \
390 $(top_builddir)/WebKit/gtk/docs/GNUmakefile \
391 $(top_builddir)/Programs/GtkLauncher \
392 $(top_builddir)/WebKit/gtk/webkit-1.0.pc \
393 $(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h \
394 $(top_builddir)/WebKit/gtk/webkit/webkitversion.h
396 pkgconfigdir = $(libdir)/pkgconfig
397 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
400 stamp-webkitmarshal.cpp \
401 stamp-webkitmarshal.h \
402 stamp-webkitenumtypes.cpp \
403 stamp-webkitenumtypes.h
405 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
406 WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
408 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
411 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
414 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
415 echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
416 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
417 echo timestamp > $(@F)
419 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
420 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
421 echo timestamp > $(@F)
423 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
425 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
428 --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
429 --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
430 --fhead "#include <glib-object.h>\n\n" \
431 --fhead "#include <webkit/webkitdefines.h>\n\n" \
432 --fhead "G_BEGIN_DECLS\n\n" \
433 --ftail "G_END_DECLS\n\n" \
435 --fprod "#include <@filename@>\n\n" \
436 --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
437 --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
438 $(webkitgtk_h_api) | \
439 sed 's,WebKit/gtk/,,' | \
440 sed 's,web_kit,webkit,' | \
441 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
443 && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
445 && echo timestamp > $(@F)
447 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
450 --fhead "#include <config.h>\n" \
451 --fhead "#include <glib-object.h>\n" \
452 --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
453 --fhead "extern \"C\" {\n\n" \
454 --fprod "\n/* enumerations from \"@filename@\" */" \
455 --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
456 --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
457 --vtail " { 0, NULL, NULL }\n};\n\n" \
458 --vtail "GType @enum_name@_get_type(void)\n{\n" \
459 --vtail " static GType type = 0;\n\n" \
460 --vtail " if (!type)\n" \
461 --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
462 --vtail " return type;\n}\n\n" \
464 $(webkitgtk_h_api) | \
465 sed 's,web_kit,webkit,' \
470 # Files that will be distributed
472 $(srcdir)/gtk-doc.make \
474 $(javascriptcore_dist) \
476 $(srcdir)/autotools/symbols.filter \
477 $(srcdir)/WebKit/gtk/ChangeLog \
478 $(srcdir)/WebKit/gtk/NEWS \
479 $(srcdir)/WebKit/gtk/webkitmarshal.list \
480 $(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
481 $(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
482 $(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
483 $(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
484 $(srcdir)/WebKit/gtk/docs/version.xml.in \
485 $(srcdir)/WebKit/gtk/po/* \
486 $(srcdir)/WebKit/gtk/resources/*
488 # extra resource files
489 resourcesdir = ${datadir}/webkit-1.0/resources
490 dist_resources_DATA = \
491 $(shell ls $(srcdir)/WebKit/gtk/resources/*.html)
495 # Files that will be cleaned
496 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES) doltcompile doltlibtool
497 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES) doltcompile doltlibtool
498 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
500 # Include module makefiles
501 include JavaScriptCore/GNUmakefile.am
502 include WebCore/GNUmakefile.am
503 include WebKitTools/GNUmakefile.am
504 include WebKit/gtk/po/GNUmakefile.am
507 noinst_PROGRAMS += $(TEST_PROGS)
509 webkit_tests_cflags = \
510 -fno-strict-aliasing \
511 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
512 -I$(srcdir)/WebKit/gtk \
513 -I$(top_builddir)/WebKit/gtk \
519 webkit_tests_ldadd = \
525 webkit_tests_ldflags = \
529 TEST_PROGS += Programs/unittests/testhttpbackend \
530 Programs/unittests/testloading \
531 Programs/unittests/testnetworkrequest \
532 Programs/unittests/testwebframe \
533 Programs/unittests/testwebbackforwardlist \
534 Programs/unittests/testwebhistoryitem \
535 Programs/unittests/testdownload \
536 Programs/unittests/testatk \
537 Programs/unittests/testwebsettings
539 # Add additional tests here
540 Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
541 Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
542 Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
543 Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)
545 Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
546 Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
547 Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
548 Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)
550 Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
551 Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
552 Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
553 Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)
555 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
556 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
557 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
558 Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
560 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
561 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
562 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
563 Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
565 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
566 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
567 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
568 Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
570 Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
571 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
572 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
573 Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
575 Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c
576 Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
577 Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
578 Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)
580 Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
581 Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
582 Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
583 Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)
585 # Autogenerated sources
587 $(javascriptcore_built_sources) \
588 $(javascriptcore_built_nosources) \
589 $(webcore_built_sources) \
590 $(webcore_built_nosources) \
591 $(webkitgtk_built_sources) \
592 $(webkitgtk_built_nosources)
594 # Project-wide clean rules
596 $(webkitgtk_cleanfiles)
598 MAINTAINERCLEANFILES += \
599 $(srcdir)/aconfig.h.in \
600 $(srcdir)/autotools/config.* \
601 $(srcdir)/autotools/compile \
602 $(srcdir)/autotools/depcomp \
603 $(srcdir)/autotools/install-sh \
604 $(srcdir)/autotools/missing \
605 $(srcdir)/configure \
606 $(srcdir)/GNUmakefile.in \
609 $(top_builddir)/config.*
611 # Older automake versions (1.7) place Plo files in a different place so we need
612 # to create the output directory manually.
614 $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
616 # remove built sources and program directories
618 -rm -rf $(GENPROGRAMS)
620 maintainer-clean-local: distclean-local
623 -rm -rf $(GENSOURCES) $(GENPROGRAMS)
625 install-data-local: po-install-data-local
627 installdirs-data-local: po-installdirs-data-local
629 uninstall-local: po-uninstall-local
631 # Run all tests in cwd
632 # FIXME: we should run this under xvfb
634 $(GTESTER) --verbose $(TEST_PROGS);
636 # test-report: run tests in cwd and generate report
637 # full-report: run tests in cwd with -m perf and -m slow and generate report
638 # perf-report: run tests in cwd with -m perf and generate report
639 test-report full-report perf-report: $(TEST_PROGS)
641 test-report) test_options="-k";; \
642 full-report) test_options="-k -m=perf";; \
643 perf-report) test_options="-k -m=perf -m=slow";; \
645 $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
646 $(GTESTER_REPORT) test-report.xml > test-report.html ;
648 .PHONY: test test-report perf-report full-report