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
56 -DWTF_USE_ICU_UNICODE=1
58 # Default compiler flags
60 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
61 -Wformat -Wformat-security -Wno-format-y2k -Wundef \
62 -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
63 -Wno-unused-parameter -Wno-parentheses \
67 $(SYMBOL_VISIBILITY_INLINES) \
75 # -no-undefined required for building DLLs on Windows
76 # It breaks the build on other platforms, so we use it conditionally
78 no_undefined = -no-undefined
82 version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
89 # Convenience libraries
90 noinst_LTLIBRARIES = \
91 libJavaScriptCore.la \
96 javascriptcore_h_api :=
97 javascriptcore_cppflags:=
98 javascriptcore_sources :=
99 javascriptcore_built_sources :=
100 javascriptcore_built_nosources :=
101 javascriptcore_dist :=
103 javascriptcore_cppflags += \
104 -I$(srcdir)/JavaScriptCore \
105 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
106 -I$(srcdir)/JavaScriptCore/parser \
107 -I$(srcdir)/JavaScriptCore/wtf \
108 -I$(top_builddir)/DerivedSources
110 # The variables above are already included below so no need to touch
111 # these variables unless you really have to
112 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
113 $(javascriptcore_built_nosources)
115 nodist_libJavaScriptCore_la_SOURCES = \
116 $(javascriptcore_built_sources)
118 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
119 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
121 libJavaScriptCore_la_SOURCES = \
122 $(javascriptcore_sources)
124 libJavaScriptCore_la_LIBADD = \
129 libJavaScriptCore_la_CXXFLAGS = \
131 $(libJavaScriptCore_la_CFLAGS)
133 libJavaScriptCore_la_CFLAGS = \
140 libJavaScriptCore_la_CPPFLAGS = \
142 $(javascriptcore_cppflags)
149 webcore_built_sources :=
150 webcore_built_nosources :=
152 webcoregtk_cppflags :=
153 webcoregtk_sources :=
155 nodist_EXTRA_libWebCore_la_SOURCES = \
156 $(webcore_built_nosources)
158 nodist_libWebCore_la_SOURCES = \
159 $(webcore_built_sources)
161 libWebCore_la_SOURCES = \
163 $(webcoregtk_sources)
165 libWebCore_la_CXXFLAGS = \
167 $(libWebCore_la_CFLAGS)
169 libWebCore_la_CFLAGS = \
170 -fno-strict-aliasing \
182 $(GSTREAMER_CFLAGS) \
188 libWebCore_la_CPPFLAGS = \
190 $(webcore_cppflags) \
191 $(javascriptcore_cppflags) \
192 $(webcoregtk_cppflags) \
195 libWebCore_la_LIBADD = \
196 libJavaScriptCore.la \
220 webkitgtk_cppflags :=
221 webkitgtk_built_sources :=
222 webkitgtk_built_nosources :=
223 webkitgtk_cleanfiles :=
225 nodist_libwebkit_1_0_la_SOURCES = \
226 $(webkitgtk_built_sources)
228 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
229 libwebkit_1_0_la_HEADERS = \
231 WebKit/gtk/webkit/webkitenumtypes.h
233 libwebkit_1_0_la_SOURCES = \
236 libwebkit_1_0_la_CXXFLAGS = \
237 $(libWebCore_la_CXXFLAGS)
239 libwebkit_1_0_la_CFLAGS = \
240 $(libWebCore_la_CFLAGS) \
241 $(GNOMEKEYRING_CFLAGS)
243 libwebkit_1_0_la_CPPFLAGS = \
244 $(libWebCore_la_CPPFLAGS) \
245 $(webkitgtk_cppflags)
247 libwebkit_1_0_la_LDFLAGS = \
248 $(COVERAGE_LDFLAGS) \
249 -version-info @LIBWEBKITGTK_VERSION@ \
253 libwebkit_1_0_la_LIBADD = \
258 # Extra checks and flags
260 -DBUILDING_CAIRO__=1 \
264 if !ENABLE_FAST_MALLOC
270 global_cppflags += -DXP_UNIX
274 global_cppflags += -DNDEBUG
276 webcoregtk_cppflags += \
277 -DG_DISABLE_DEPRECATED \
278 -DGDK_PIXBUF_DISABLE_DEPRECATED \
279 -DGDK_DISABLE_DEPRECATED \
280 -DGTK_DISABLE_DEPRECATED \
281 -DPANGO_DISABLE_DEPRECATED
283 # Might be useful in the future
284 # -DGDK_MULTIHEAD_SAFE \
285 # -DGTK_MULTIHEAD_SAFE
289 global_cppflags += -DENABLE_DATABASE=0
292 if !ENABLE_ICONDATABASE
293 global_cppflags += -DENABLE_ICONDATABASE=0
298 -DGCC_GENERATE_TEST_COVERAGE_FILES \
299 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
303 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
307 WebKit/gtk/webkit/webkit.h \
308 WebKit/gtk/webkit/webkitdefines.h \
309 WebKit/gtk/webkit/webkitdownload.h \
310 WebKit/gtk/webkit/webkitnetworkrequest.h \
311 WebKit/gtk/webkit/webkitsoupauthdialog.h \
312 WebKit/gtk/webkit/webkitversion.h \
313 WebKit/gtk/webkit/webkitwebbackforwardlist.h \
314 WebKit/gtk/webkit/webkitwebframe.h \
315 WebKit/gtk/webkit/webkitwebhistoryitem.h \
316 WebKit/gtk/webkit/webkitwebinspector.h \
317 WebKit/gtk/webkit/webkitwebnavigationaction.h \
318 WebKit/gtk/webkit/webkitwebpolicydecision.h \
319 WebKit/gtk/webkit/webkitwebsettings.h \
320 WebKit/gtk/webkit/webkitwebwindowfeatures.h \
321 WebKit/gtk/webkit/webkitwebview.h
323 webkitgtk_built_sources += \
324 DerivedSources/webkitenumtypes.cpp \
325 DerivedSources/webkitmarshal.cpp \
326 DerivedSources/webkitmarshal.h \
327 WebKit/gtk/webkit/webkitenumtypes.h
329 webkitgtk_sources += \
330 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
331 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
332 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
333 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
334 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
335 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
336 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
337 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
338 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
339 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
340 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
341 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
342 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
343 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
344 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
345 WebKit/gtk/webkit/webkitprivate.cpp \
346 WebKit/gtk/webkit/webkitprivate.h \
347 WebKit/gtk/webkit/webkitsoupauthdialog.c \
348 WebKit/gtk/webkit/webkitversion.cpp \
349 WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
350 WebKit/gtk/webkit/webkitwebframe.cpp \
351 WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
352 WebKit/gtk/webkit/webkitwebinspector.cpp \
353 WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
354 WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
355 WebKit/gtk/webkit/webkitwebsettings.cpp \
356 WebKit/gtk/webkit/webkitdownload.cpp \
357 WebKit/gtk/webkit/webkitwebview.cpp \
358 WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
360 webkitgtk_cppflags += \
362 -I$(srcdir)/WebKit/gtk \
363 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
364 -I$(srcdir)/WebKit/gtk/webkit \
365 -I$(top_builddir)/WebKit/gtk/webkit
367 webkitgtk_cleanfiles += \
368 $(top_builddir)/Programs/GtkLauncher \
369 $(top_builddir)/WebKit/gtk/webkit-1.0.pc \
370 $(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h
372 pkgconfigdir = $(libdir)/pkgconfig
373 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
376 stamp-webkitmarshal.cpp \
377 stamp-webkitmarshal.h \
378 stamp-webkitenumtypes.cpp \
379 stamp-webkitenumtypes.h
381 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
382 WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
384 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
387 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
390 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
391 echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
392 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
393 echo timestamp > $(@F)
395 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
396 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
397 echo timestamp > $(@F)
399 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
401 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
404 --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
405 --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
406 --fhead "#include <glib-object.h>\n\n" \
407 --fhead "#include <webkit/webkitdefines.h>\n\n" \
408 --fhead "G_BEGIN_DECLS\n\n" \
409 --ftail "G_END_DECLS\n\n" \
411 --fprod "#include <@filename@>\n\n" \
412 --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
413 --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
414 $(webkitgtk_h_api) | \
415 sed 's,WebKit/gtk/,,' | \
416 sed 's,web_kit,webkit,' | \
417 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
419 && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
421 && echo timestamp > $(@F)
423 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
426 --fhead "#include <config.h>\n" \
427 --fhead "#include <glib-object.h>\n" \
428 --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
429 --fhead "extern \"C\" {\n\n" \
430 --fprod "\n/* enumerations from \"@filename@\" */" \
431 --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
432 --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
433 --vtail " { 0, NULL, NULL }\n};\n\n" \
434 --vtail "GType @enum_name@_get_type(void)\n{\n" \
435 --vtail " static GType type = 0;\n\n" \
436 --vtail " if (!type)\n" \
437 --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
438 --vtail " return type;\n}\n\n" \
440 $(webkitgtk_h_api) | \
441 sed 's,web_kit,webkit,' \
448 # Files that will be distributed
451 $(javascriptcore_dist) \
453 $(srcdir)/autotools/symbols.filter \
454 $(srcdir)/WebKit/gtk/ChangeLog \
455 $(srcdir)/WebKit/gtk/NEWS \
456 $(srcdir)/WebKit/gtk/webkitmarshal.list
458 # Files that will be cleaned
459 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES) doltcompile doltlibtool
460 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES) doltcompile doltlibtool
461 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
463 # Include module makefiles
464 include JavaScriptCore/GNUmakefile.am
465 include WebCore/GNUmakefile.am
466 include WebKitTools/GNUmakefile.am
469 noinst_PROGRAMS += $(TEST_PROGS)
471 webkit_tests_cflags = \
472 -fno-strict-aliasing \
474 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
475 -I$(srcdir)/WebKit/gtk \
476 -I$(top_builddir)/WebKit/gtk \
482 webkit_tests_ldadd = \
488 TEST_PROGS += Programs/unittests/testwebframe \
489 Programs/unittests/testwebbackforwardlist \
490 Programs/unittests/testwebhistoryitem
492 # Add additional tests here
493 Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
494 Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
495 Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
497 Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
498 Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
499 Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
501 Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
502 Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
503 Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
506 # Autogenerated sources
508 $(javascriptcore_built_sources) \
509 $(javascriptcore_built_nosources) \
510 $(webcore_built_sources) \
511 $(webcore_built_nosources) \
512 $(webkitgtk_built_sources) \
513 $(webkitgtk_built_nosources)
515 # Project-wide clean rules
517 $(webkitgtk_cleanfiles)
519 MAINTAINERCLEANFILES += \
520 $(srcdir)/aconfig.h.in \
521 $(srcdir)/autotools/config.* \
522 $(srcdir)/autotools/compile \
523 $(srcdir)/autotools/depcomp \
524 $(srcdir)/autotools/install-sh \
525 $(srcdir)/autotools/missing \
526 $(srcdir)/configure \
527 $(srcdir)/GNUmakefile.in \
530 $(top_builddir)/config.*
532 # Older automake versions (1.7) place Plo files in a different place so we need
533 # to create the output directory manually.
535 mkdir -p $(top_builddir)/$(DEPDIR)/DerivedSources
537 # remove built sources and program directories
539 -rm -rf $(GENPROGRAMS)
541 maintainer-clean-local: distclean-local
544 -rm -rf $(GENSOURCES) $(GENPROGRAMS)