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 # _headers = header files that will be part of the distribution
9 # _built_sources = files that will be autogenerated by the build system and
10 # will be part of the _SOURCES primary
11 # _built_nosources = files that are autogenerated but are not part of the
13 # _cleanfiles = files that will be removed by the clean target
15 # Sources, headers, flags, etc... should be added to the respective variables
16 # with the above suffix, e.g, webcore-specific sources should go to
17 # webcore_sources, gtk port API and WebCoreSupport parts to webkitgtk_sources,
18 # etc... The only exceptions are the global variables. See Global Variables
23 # global_cppflags = CPPFLAGS that apply to JSC, WebCore, and to any
25 # global_cflags = CFLAGS that apply to JSC, WebCore, and to
27 # global_cxxflags = CXXFLAGS that apply to JSC, WebCore, and to any
33 # Directory for autogenerated sources
34 GENSOURCES := $(top_builddir)/DerivedSources
35 GENPROGRAMS := $(top_builddir)/Programs
37 # Script for creating hash tables
38 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/kjs/create_hash_table
40 # Libraries and support components
49 # Files that will be distributed
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
66 $(SYMBOL_VISIBILITY_INLINES)
77 # -no-undefined required for building DLLs on Windows
78 # It breaks the build on other platforms, so we use it conditionally
80 no_undefined = -no-undefined
87 # Convenience libraries
88 noinst_LTLIBRARIES = \
89 libJavaScriptCore.la \
94 javascriptcore_h_api :=
95 javascriptcore_cppflags:=
96 javascriptcore_sources :=
97 javascriptcore_built_sources :=
98 javascriptcore_built_nosources :=
100 javascriptcore_cppflags += \
101 -I$(srcdir)/JavaScriptCore \
102 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
103 -I$(srcdir)/JavaScriptCore/wtf \
104 -I$(srcdir)/JavaScriptCore/kjs \
105 -I$(top_builddir)/DerivedSources
107 # The variables above are already included below so no need to touch
108 # these variables unless you really have to
109 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
110 $(javascriptcore_built_nosources)
112 nodist_libJavaScriptCore_la_SOURCES = \
113 $(javascriptcore_built_sources)
115 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
116 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
118 libJavaScriptCore_la_SOURCES = \
119 $(javascriptcore_sources)
121 libJavaScriptCore_la_LIBADD = \
126 libJavaScriptCore_la_CXXFLAGS = \
131 $(GLOBALDEPS_CFLAGS) \
134 libJavaScriptCore_la_CFLAGS = \
138 $(GLOBALDEPS_CFLAGS) \
141 libJavaScriptCore_la_CPPFLAGS = \
143 $(javascriptcore_cppflags)
151 webcore_built_sources :=
152 webcore_built_nosources :=
153 webcoregtk_cppflags :=
154 webcoregtk_sources :=
155 webcoregtk_headers :=
157 nodist_libWebCore_la_SOURCES = \
158 $(webcore_built_sources)
160 libWebCore_la_SOURCES = \
163 $(webcoregtk_headers) \
164 $(webcoregtk_sources)
166 libWebCore_la_CXXFLAGS = \
167 -fno-strict-aliasing \
171 $(GLOBALDEPS_CFLAGS) \
173 $(WEBKITDEPS_CFLAGS) \
178 $(GSTREAMER_CFLAGS) \
183 libWebCore_la_CFLAGS = \
184 -fno-strict-aliasing \
187 $(GLOBALDEPS_CFLAGS) \
189 $(WEBKITDEPS_CFLAGS) \
194 $(GSTREAMER_CFLAGS) \
199 libWebCore_la_CPPFLAGS = \
201 $(webcore_cppflags) \
202 $(javascriptcore_cppflags) \
203 $(webcoregtk_cppflags) \
206 libWebCore_la_LIBADD = \
207 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 = \
240 $(webkitgtk_headers) \
243 libwebkit_1_0_la_CXXFLAGS = \
244 $(libWebCore_la_CXXFLAGS)
246 libwebkit_1_0_la_CFLAGS = \
247 $(libWebCore_la_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@ \
258 libwebkit_1_0_la_LIBADD = \
262 # Extra checks and flags
264 -DBUILDING_CAIRO__=1 \
268 if !ENABLE_FAST_MALLOC
274 global_cppflags += -DXP_UNIX
275 webcore_libadd += -lXt
279 global_cppflags += -DNDEBUG
281 webcoregtk_cppflags += \
282 -DG_DISABLE_DEPRECATED \
283 -DGDK_PIXBUF_DISABLE_DEPRECATED \
284 -DGDK_DISABLE_DEPRECATED \
285 -DGTK_DISABLE_DEPRECATED \
286 -DPANGO_DISABLE_DEPRECATED
288 # Might be useful in the future
289 # -DGDK_MULTIHEAD_SAFE \
290 # -DGTK_MULTIHEAD_SAFE
294 global_cppflags += -DENABLE_DATABASE=0
297 if !ENABLE_ICONDATABASE
298 global_cppflags += -DENABLE_ICONDATABASE=0
303 -DGCC_GENERATE_TEST_COVERAGE_FILES \
304 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
308 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
312 WebKit/gtk/webkit/webkit.h \
313 WebKit/gtk/webkit/webkitdefines.h \
314 WebKit/gtk/webkit/webkitnetworkrequest.h \
315 WebKit/gtk/webkit/webkitversion.h \
316 WebKit/gtk/webkit/webkitwebbackforwardlist.h \
317 WebKit/gtk/webkit/webkitwebframe.h \
318 WebKit/gtk/webkit/webkitwebhistoryitem.h \
319 WebKit/gtk/webkit/webkitwebsettings.h \
320 WebKit/gtk/webkit/webkitwebview.h
322 webkitgtk_built_sources += \
323 DerivedSources/webkit-marshal.h \
324 DerivedSources/webkit-marshal.cpp \
325 DerivedSources/webkitenumtypes.cpp \
326 WebKit/gtk/webkit/webkitenumtypes.h
328 webkitgtk_headers += \
329 WebKit/gtk/webkit/webkitprivate.h \
330 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
331 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
332 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
333 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
334 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
335 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
336 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
338 webkitgtk_sources += \
339 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
340 WebKit/gtk/webkit/webkitprivate.cpp \
341 WebKit/gtk/webkit/webkitversion.cpp \
342 WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
343 WebKit/gtk/webkit/webkitwebframe.cpp \
344 WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
345 WebKit/gtk/webkit/webkitwebsettings.cpp \
346 WebKit/gtk/webkit/webkitwebview.cpp \
347 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
348 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
349 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
350 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
351 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
352 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
353 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
355 webkitgtk_cppflags += \
357 -I$(srcdir)/WebKit/gtk \
358 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
359 -I$(srcdir)/WebKit/gtk/webkit \
360 -I$(top_builddir)/WebKit/gtk/webkit
362 webkitgtk_cleanfiles += \
363 $(top_builddir)/Programs/GtkLauncher \
364 $(top_builddir)/WebKit/gtk/webkit-1.0.pc
366 pkgconfigdir = $(libdir)/pkgconfig
367 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
370 stamp-webkit-marshal.cpp \
371 stamp-webkit-marshal.h \
372 stamp-webkitenumtypes.cpp \
373 stamp-webkitenumtypes.h
375 WEBKIT_MARSHAL = $(GENSOURCES)/webkit-marshal
376 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
378 DerivedSources/webkit-marshal.cpp: stamp-webkit-marshal.cpp
381 DerivedSources/webkit-marshal.h: stamp-webkit-marshal.h
384 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
385 echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
386 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
387 echo timestamp > $(@F)
389 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
390 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
391 echo timestamp > $(@F)
393 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
395 stamp-webkitenumtypes.h: $(webkitgtk_h_api) Makefile
398 --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
399 --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
400 --fhead "#include <glib-object.h>\n\n" \
401 --fhead "#include <webkit/webkitdefines.h>\n\n" \
402 --fhead "G_BEGIN_DECLS\n\n" \
403 --ftail "G_END_DECLS\n\n" \
405 --fprod "#include <@filename@>\n\n" \
406 --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
407 --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
408 $(webkitgtk_h_api) | \
409 sed 's,WebKit/gtk/,,' | \
410 sed 's,web_kit,webkit,' | \
411 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
413 && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
415 && echo timestamp > $(@F)
417 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) Makefile
420 --fhead "#include <config.h>\n" \
421 --fhead "#include <glib-object.h>\n" \
422 --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
423 --fhead "extern \"C\" {\n\n" \
424 --fprod "\n/* enumerations from \"@filename@\" */" \
425 --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
426 --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
427 --vtail " { 0, NULL, NULL }\n};\n\n" \
428 --vtail "GType @enum_name@_get_type(void)\n{\n" \
429 --vtail " static GType type = 0;\n\n" \
430 --vtail " if (!type)\n" \
431 --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
432 --vtail " return type;\n}\n\n" \
434 $(webkitgtk_h_api) | \
435 sed 's,web_kit,webkit,' \
442 # Files that will be cleaned
443 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
444 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
445 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
447 # Include module makefiles
448 include JavaScriptCore/GNUmakefile.am
449 include WebCore/GNUmakefile.am
450 include WebKitTools/GNUmakefile.am
452 # Autogenerated sources
454 $(javascriptcore_built_sources) \
455 $(javascriptcore_built_nosources) \
456 $(webcore_built_sources) \
457 $(webcore_built_nosources) \
458 $(webkitgtk_built_sources) \
459 $(webkitgtk_built_nosources)
461 # Project-wide clean rules
463 $(webkitgtk_cleanfiles)
465 MAINTAINERCLEANFILES += \
466 $(srcdir)/aconfig.h.in \
473 # remove built sources and program directories
475 -rm -rf $(GENSOURCES) $(GENPROGRAMS)