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/kjs/create_hash_table
39 # Libraries and support components
54 -DWTF_USE_ICU_UNICODE=1
56 # Default compiler flags
58 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
59 -Wformat -Wformat-security -Wno-format-y2k -Wundef \
60 -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
61 -Wno-unused-parameter -Wno-parentheses
64 $(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)/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/wtf \
107 -I$(srcdir)/JavaScriptCore/kjs \
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 = \
137 $(GLOBALDEPS_CFLAGS) \
140 libJavaScriptCore_la_CPPFLAGS = \
142 $(javascriptcore_cppflags)
149 webcore_built_sources :=
150 webcore_built_nosources :=
152 webcoregtk_cppflags :=
153 webcoregtk_sources :=
155 nodist_libWebCore_la_SOURCES = \
156 $(webcore_built_sources)
158 libWebCore_la_SOURCES = \
160 $(webcoregtk_sources)
162 libWebCore_la_CXXFLAGS = \
164 $(libWebCore_la_CFLAGS)
166 libWebCore_la_CFLAGS = \
167 -fno-strict-aliasing \
170 $(GLOBALDEPS_CFLAGS) \
181 $(GSTREAMER_CFLAGS) \
186 libWebCore_la_CPPFLAGS = \
188 $(webcore_cppflags) \
189 $(javascriptcore_cppflags) \
190 $(webcoregtk_cppflags) \
193 libWebCore_la_LIBADD = \
194 libJavaScriptCore.la \
216 webkitgtk_cppflags :=
217 webkitgtk_built_sources :=
218 webkitgtk_built_nosources :=
219 webkitgtk_cleanfiles :=
221 nodist_libwebkit_1_0_la_SOURCES = \
222 $(webkitgtk_built_sources)
224 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
225 libwebkit_1_0_la_HEADERS = \
227 WebKit/gtk/webkit/webkitenumtypes.h
229 libwebkit_1_0_la_SOURCES = \
232 libwebkit_1_0_la_CXXFLAGS = \
233 $(libWebCore_la_CXXFLAGS)
235 libwebkit_1_0_la_CFLAGS = \
236 $(libWebCore_la_CFLAGS)
238 libwebkit_1_0_la_CPPFLAGS = \
239 $(libWebCore_la_CPPFLAGS) \
240 $(webkitgtk_cppflags)
242 libwebkit_1_0_la_LDFLAGS = \
243 $(COVERAGE_LDFLAGS) \
244 -version-info @LIBWEBKITGTK_VERSION@ \
248 libwebkit_1_0_la_LIBADD = \
252 # Extra checks and flags
254 -DBUILDING_CAIRO__=1 \
258 if !ENABLE_FAST_MALLOC
264 global_cppflags += -DXP_UNIX
268 global_cppflags += -DNDEBUG
270 webcoregtk_cppflags += \
271 -DG_DISABLE_DEPRECATED \
272 -DGDK_PIXBUF_DISABLE_DEPRECATED \
273 -DGDK_DISABLE_DEPRECATED \
274 -DGTK_DISABLE_DEPRECATED \
275 -DPANGO_DISABLE_DEPRECATED
277 # Might be useful in the future
278 # -DGDK_MULTIHEAD_SAFE \
279 # -DGTK_MULTIHEAD_SAFE
283 global_cppflags += -DENABLE_DATABASE=0
286 if !ENABLE_ICONDATABASE
287 global_cppflags += -DENABLE_ICONDATABASE=0
292 -DGCC_GENERATE_TEST_COVERAGE_FILES \
293 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
297 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
301 WebKit/gtk/webkit/webkit.h \
302 WebKit/gtk/webkit/webkitdefines.h \
303 WebKit/gtk/webkit/webkitnetworkrequest.h \
304 WebKit/gtk/webkit/webkitversion.h \
305 WebKit/gtk/webkit/webkitwebbackforwardlist.h \
306 WebKit/gtk/webkit/webkitwebframe.h \
307 WebKit/gtk/webkit/webkitwebhistoryitem.h \
308 WebKit/gtk/webkit/webkitwebsettings.h \
309 WebKit/gtk/webkit/webkitwebview.h
311 webkitgtk_built_sources += \
312 DerivedSources/webkitenumtypes.cpp \
313 DerivedSources/webkitmarshal.cpp \
314 DerivedSources/webkitmarshal.h \
315 WebKit/gtk/webkit/webkitenumtypes.h
317 webkitgtk_sources += \
318 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
319 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
320 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
321 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
322 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
323 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
324 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
325 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
326 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
327 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
328 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
329 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
330 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
331 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
332 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
333 WebKit/gtk/webkit/webkitprivate.cpp \
334 WebKit/gtk/webkit/webkitprivate.h \
335 WebKit/gtk/webkit/webkitversion.cpp \
336 WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
337 WebKit/gtk/webkit/webkitwebframe.cpp \
338 WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
339 WebKit/gtk/webkit/webkitwebsettings.cpp \
340 WebKit/gtk/webkit/webkitwebview.cpp
342 webkitgtk_cppflags += \
344 -I$(srcdir)/WebKit/gtk \
345 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
346 -I$(srcdir)/WebKit/gtk/webkit \
347 -I$(top_builddir)/WebKit/gtk/webkit
349 webkitgtk_cleanfiles += \
350 $(top_builddir)/Programs/GtkLauncher \
351 $(top_builddir)/WebKit/gtk/webkit-1.0.pc
353 pkgconfigdir = $(libdir)/pkgconfig
354 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
357 stamp-webkitmarshal.cpp \
358 stamp-webkitmarshal.h \
359 stamp-webkitenumtypes.cpp \
360 stamp-webkitenumtypes.h
362 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
363 WEBKIT_MARSHAL_LIST = $(WEBKIT_MARSHAL).list
365 $(WEBKIT_MARSHAL_LIST): $(webkitgtk_sources) GNUmakefile.am
366 ( cd $(top_srcdir) && \
367 sed -n -e 's/.*webkit_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
368 $(webkitgtk_sources) ) \
369 | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
370 if cmp -s $@.tmp $@; then \
376 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
379 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
382 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
383 echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
384 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
385 echo timestamp > $(@F)
387 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
388 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
389 echo timestamp > $(@F)
391 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
393 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
396 --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
397 --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
398 --fhead "#include <glib-object.h>\n\n" \
399 --fhead "#include <webkit/webkitdefines.h>\n\n" \
400 --fhead "G_BEGIN_DECLS\n\n" \
401 --ftail "G_END_DECLS\n\n" \
403 --fprod "#include <@filename@>\n\n" \
404 --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
405 --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
406 $(webkitgtk_h_api) | \
407 sed 's,WebKit/gtk/,,' | \
408 sed 's,web_kit,webkit,' | \
409 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
411 && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
413 && echo timestamp > $(@F)
415 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
418 --fhead "#include <config.h>\n" \
419 --fhead "#include <glib-object.h>\n" \
420 --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
421 --fhead "extern \"C\" {\n\n" \
422 --fprod "\n/* enumerations from \"@filename@\" */" \
423 --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
424 --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
425 --vtail " { 0, NULL, NULL }\n};\n\n" \
426 --vtail "GType @enum_name@_get_type(void)\n{\n" \
427 --vtail " static GType type = 0;\n\n" \
428 --vtail " if (!type)\n" \
429 --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
430 --vtail " return type;\n}\n\n" \
432 $(webkitgtk_h_api) | \
433 sed 's,web_kit,webkit,' \
440 # Files that will be distributed
442 $(javascriptcore_dist) \
446 # Files that will be cleaned
447 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
448 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
449 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
451 # Include module makefiles
452 include JavaScriptCore/GNUmakefile.am
453 include WebCore/GNUmakefile.am
454 include WebKitTools/GNUmakefile.am
456 # Autogenerated sources
458 $(javascriptcore_built_sources) \
459 $(javascriptcore_built_nosources) \
460 $(webcore_built_sources) \
461 $(webcore_built_nosources) \
462 $(webkitgtk_built_sources) \
463 $(webkitgtk_built_nosources)
465 # Project-wide clean rules
467 $(webkitgtk_cleanfiles)
469 MAINTAINERCLEANFILES += \
470 $(srcdir)/aconfig.h.in \
477 # remove built sources and program directories
479 -rm -rf $(GENSOURCES) $(GENPROGRAMS)