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 # Libraries and support components
61 -DWTF_USE_ICU_UNICODE=1
63 # Default compiler flags
65 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
66 -Wformat -Wformat-security -Wno-format-y2k -Wundef \
67 -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
68 -Wno-unused-parameter -Wno-parentheses \
72 $(SYMBOL_VISIBILITY_INLINES) \
80 # -no-undefined required for building DLLs on Windows
81 # It breaks the build on other platforms, so we use it conditionally
83 no_undefined = -no-undefined
87 version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
94 # Convenience libraries
95 noinst_LTLIBRARIES = \
96 libJavaScriptCore.la \
101 javascriptcore_h_api :=
102 javascriptcore_cppflags:=
103 javascriptcore_sources :=
104 javascriptcore_built_sources :=
105 javascriptcore_built_nosources :=
106 javascriptcore_dist :=
108 javascriptcore_cppflags += \
109 -I$(srcdir)/JavaScriptCore \
110 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
111 -I$(srcdir)/JavaScriptCore/parser \
112 -I$(srcdir)/JavaScriptCore/wtf \
113 -I$(top_builddir)/DerivedSources
115 # The variables above are already included below so no need to touch
116 # these variables unless you really have to
117 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
118 $(javascriptcore_built_nosources)
120 nodist_libJavaScriptCore_la_SOURCES = \
121 $(javascriptcore_built_sources)
123 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
124 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
126 libJavaScriptCore_la_SOURCES = \
127 $(javascriptcore_sources)
129 libJavaScriptCore_la_LIBADD = \
134 libJavaScriptCore_la_CXXFLAGS = \
136 $(libJavaScriptCore_la_CFLAGS)
138 libJavaScriptCore_la_CFLAGS = \
145 libJavaScriptCore_la_CPPFLAGS = \
147 $(javascriptcore_cppflags)
154 webcore_built_sources :=
155 webcore_built_nosources :=
157 webcoregtk_cppflags :=
158 webcoregtk_sources :=
160 nodist_EXTRA_libWebCore_la_SOURCES = \
161 $(webcore_built_nosources)
163 nodist_libWebCore_la_SOURCES = \
164 $(webcore_built_sources)
166 libWebCore_la_SOURCES = \
168 $(webcoregtk_sources)
170 libWebCore_la_CXXFLAGS = \
172 $(libWebCore_la_CFLAGS)
174 libWebCore_la_CFLAGS = \
175 -fno-strict-aliasing \
187 $(GSTREAMER_CFLAGS) \
194 libWebCore_la_CPPFLAGS = \
196 $(webcore_cppflags) \
197 $(javascriptcore_cppflags) \
198 $(webcoregtk_cppflags) \
201 libWebCore_la_LIBADD = \
202 libJavaScriptCore.la \
226 webkitgtk_cppflags :=
227 webkitgtk_built_sources :=
228 webkitgtk_built_nosources :=
229 webkitgtk_cleanfiles :=
231 nodist_libwebkit_1_0_la_SOURCES = \
232 $(webkitgtk_built_sources)
234 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
235 libwebkit_1_0_la_HEADERS = \
237 WebKit/gtk/webkit/webkitenumtypes.h
239 libwebkit_1_0_la_SOURCES = \
242 libwebkit_1_0_la_CXXFLAGS = \
243 $(libWebCore_la_CXXFLAGS)
245 libwebkit_1_0_la_CFLAGS = \
246 $(libWebCore_la_CFLAGS) \
247 $(GNOMEKEYRING_CFLAGS)
249 libwebkit_1_0_la_CPPFLAGS = \
250 $(libWebCore_la_CPPFLAGS) \
251 $(webkitgtk_cppflags)
253 libwebkit_1_0_la_LDFLAGS = \
254 $(COVERAGE_LDFLAGS) \
255 -version-info @LIBWEBKITGTK_VERSION@ \
259 libwebkit_1_0_la_LIBADD = \
265 # Extra checks and flags
267 -DBUILDING_CAIRO__=1 \
270 -DPACKAGE_LOCALE_DIR=\"$(localedir)\"
272 if !ENABLE_FAST_MALLOC
278 global_cppflags += -DXP_UNIX
282 global_cppflags += -DNDEBUG
284 webcoregtk_cppflags += \
285 -DG_DISABLE_DEPRECATED \
286 -DGDK_PIXBUF_DISABLE_DEPRECATED \
287 -DGDK_DISABLE_DEPRECATED \
288 -DGTK_DISABLE_DEPRECATED \
289 -DPANGO_DISABLE_DEPRECATED
291 # Might be useful in the future
292 # -DGDK_MULTIHEAD_SAFE \
293 # -DGTK_MULTIHEAD_SAFE
297 global_cppflags += -DENABLE_DATABASE=0
300 if !ENABLE_ICONDATABASE
301 global_cppflags += -DENABLE_ICONDATABASE=0
306 -DGCC_GENERATE_TEST_COVERAGE_FILES \
307 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
311 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
315 WebKit/gtk/webkit/webkit.h \
316 WebKit/gtk/webkit/webkitdefines.h \
317 WebKit/gtk/webkit/webkitdownload.h \
318 WebKit/gtk/webkit/webkiterror.h \
319 WebKit/gtk/webkit/webkitnetworkrequest.h \
320 WebKit/gtk/webkit/webkitsoupauthdialog.h \
321 WebKit/gtk/webkit/webkitversion.h \
322 WebKit/gtk/webkit/webkitwebbackforwardlist.h \
323 WebKit/gtk/webkit/webkitwebframe.h \
324 WebKit/gtk/webkit/webkitwebhistoryitem.h \
325 WebKit/gtk/webkit/webkitwebinspector.h \
326 WebKit/gtk/webkit/webkitwebnavigationaction.h \
327 WebKit/gtk/webkit/webkitwebpolicydecision.h \
328 WebKit/gtk/webkit/webkitwebsettings.h \
329 WebKit/gtk/webkit/webkitwebwindowfeatures.h \
330 WebKit/gtk/webkit/webkitwebview.h
332 webkitgtk_built_sources += \
333 DerivedSources/webkitenumtypes.cpp \
334 DerivedSources/webkitmarshal.cpp \
335 DerivedSources/webkitmarshal.h \
336 WebKit/gtk/webkit/webkitenumtypes.h
338 webkitgtk_sources += \
339 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
340 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
341 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
342 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
343 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
344 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
345 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
346 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
347 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
348 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
349 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
350 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
351 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
352 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
353 WebKit/gtk/webkit/webkitdownload.cpp \
354 WebKit/gtk/webkit/webkiterror.cpp \
355 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
356 WebKit/gtk/webkit/webkitprivate.cpp \
357 WebKit/gtk/webkit/webkitprivate.h \
358 WebKit/gtk/webkit/webkitsoupauthdialog.c \
359 WebKit/gtk/webkit/webkitversion.cpp \
360 WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
361 WebKit/gtk/webkit/webkitwebframe.cpp \
362 WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
363 WebKit/gtk/webkit/webkitwebinspector.cpp \
364 WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
365 WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
366 WebKit/gtk/webkit/webkitwebsettings.cpp \
367 WebKit/gtk/webkit/webkitwebview.cpp \
368 WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
370 webkitgtk_cppflags += \
372 -I$(srcdir)/WebKit/gtk \
373 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
374 -I$(srcdir)/WebKit/gtk/webkit \
375 -I$(top_builddir)/WebKit/gtk/webkit
377 webkitgtk_cleanfiles += \
378 $(top_builddir)/Programs/GtkLauncher \
379 $(top_builddir)/WebKit/gtk/webkit-1.0.pc \
380 $(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h
382 pkgconfigdir = $(libdir)/pkgconfig
383 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
386 stamp-webkitmarshal.cpp \
387 stamp-webkitmarshal.h \
388 stamp-webkitenumtypes.cpp \
389 stamp-webkitenumtypes.h
391 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
392 WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
394 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
397 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
400 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
401 echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
402 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
403 echo timestamp > $(@F)
405 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
406 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
407 echo timestamp > $(@F)
409 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
411 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
414 --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
415 --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
416 --fhead "#include <glib-object.h>\n\n" \
417 --fhead "#include <webkit/webkitdefines.h>\n\n" \
418 --fhead "G_BEGIN_DECLS\n\n" \
419 --ftail "G_END_DECLS\n\n" \
421 --fprod "#include <@filename@>\n\n" \
422 --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
423 --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
424 $(webkitgtk_h_api) | \
425 sed 's,WebKit/gtk/,,' | \
426 sed 's,web_kit,webkit,' | \
427 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
429 && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
431 && echo timestamp > $(@F)
433 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
436 --fhead "#include <config.h>\n" \
437 --fhead "#include <glib-object.h>\n" \
438 --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
439 --fhead "extern \"C\" {\n\n" \
440 --fprod "\n/* enumerations from \"@filename@\" */" \
441 --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
442 --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
443 --vtail " { 0, NULL, NULL }\n};\n\n" \
444 --vtail "GType @enum_name@_get_type(void)\n{\n" \
445 --vtail " static GType type = 0;\n\n" \
446 --vtail " if (!type)\n" \
447 --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
448 --vtail " return type;\n}\n\n" \
450 $(webkitgtk_h_api) | \
451 sed 's,web_kit,webkit,' \
456 # Files that will be distributed
459 $(javascriptcore_dist) \
461 $(srcdir)/autotools/symbols.filter \
462 $(srcdir)/WebKit/gtk/ChangeLog \
463 $(srcdir)/WebKit/gtk/NEWS \
464 $(srcdir)/WebKit/gtk/webkitmarshal.list \
465 $(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
466 $(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
467 $(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
468 $(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
469 $(srcdir)/WebKit/gtk/docs/version.xml.in \
470 $(srcdir)/WebKit/gtk/po/* \
471 $(srcdir)/WebKit/gtk/resources/*
473 # extra resource files
474 resourcesdir = ${datadir}/webkit-1.0/resources
475 dist_resources_DATA = \
476 $(shell ls $(srcdir)/WebKit/gtk/resources/*.html)
480 # Files that will be cleaned
481 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES) doltcompile doltlibtool WebKit/gtk/docs/version.xml WebKit/gtk/docs/GNUmakefile
482 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES) doltcompile doltlibtool WebKit/gtk/docs/version.xml WebKit/gtk/docs/GNUmakefile
483 CLEANFILES := $(stamp_files) $(BUILT_SOURCES) WebKit/gtk/docs/GNUmakefile
485 # Include module makefiles
486 include JavaScriptCore/GNUmakefile.am
487 include WebCore/GNUmakefile.am
488 include WebKitTools/GNUmakefile.am
489 include WebKit/gtk/po/GNUmakefile.am
492 noinst_PROGRAMS += $(TEST_PROGS)
494 webkit_tests_cflags = \
495 -fno-strict-aliasing \
497 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
498 -I$(srcdir)/WebKit/gtk \
499 -I$(top_builddir)/WebKit/gtk \
505 webkit_tests_ldadd = \
511 TEST_PROGS += Programs/unittests/testwebframe \
512 Programs/unittests/testwebbackforwardlist \
513 Programs/unittests/testwebhistoryitem \
514 Programs/unittests/testdownload
516 # Add additional tests here
517 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
518 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
519 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
521 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
522 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
523 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
525 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
526 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
527 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
529 Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
530 Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
531 Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
533 # Autogenerated sources
535 $(javascriptcore_built_sources) \
536 $(javascriptcore_built_nosources) \
537 $(webcore_built_sources) \
538 $(webcore_built_nosources) \
539 $(webkitgtk_built_sources) \
540 $(webkitgtk_built_nosources)
542 # Project-wide clean rules
544 $(webkitgtk_cleanfiles)
546 MAINTAINERCLEANFILES += \
547 $(srcdir)/aconfig.h.in \
548 $(srcdir)/autotools/config.* \
549 $(srcdir)/autotools/compile \
550 $(srcdir)/autotools/depcomp \
551 $(srcdir)/autotools/install-sh \
552 $(srcdir)/autotools/missing \
553 $(srcdir)/configure \
554 $(srcdir)/GNUmakefile.in \
557 $(top_builddir)/config.*
559 # Older automake versions (1.7) place Plo files in a different place so we need
560 # to create the output directory manually.
562 $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
564 # remove built sources and program directories
566 -rm -rf $(GENPROGRAMS)
568 maintainer-clean-local: distclean-local
571 -rm -rf $(GENSOURCES) $(GENPROGRAMS)
573 install-data-local: po-install-data-local
575 installdirs-data-local: po-installdirs-data-local
577 uninstall-local: po-uninstall-local