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
85 # Convenience libraries
86 noinst_LTLIBRARIES = \
87 libJavaScriptCore.la \
92 javascriptcore_h_api :=
93 javascriptcore_cppflags:=
94 javascriptcore_sources :=
95 javascriptcore_built_sources :=
96 javascriptcore_built_nosources :=
97 javascriptcore_dist :=
99 javascriptcore_cppflags += \
100 -I$(srcdir)/JavaScriptCore \
101 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
102 -I$(srcdir)/JavaScriptCore/wtf \
103 -I$(srcdir)/JavaScriptCore/kjs \
104 -I$(top_builddir)/DerivedSources
106 # The variables above are already included below so no need to touch
107 # these variables unless you really have to
108 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
109 $(javascriptcore_built_nosources)
111 nodist_libJavaScriptCore_la_SOURCES = \
112 $(javascriptcore_built_sources)
114 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
115 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
117 libJavaScriptCore_la_SOURCES = \
118 $(javascriptcore_sources)
120 libJavaScriptCore_la_LIBADD = \
125 libJavaScriptCore_la_CXXFLAGS = \
130 $(GLOBALDEPS_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 = \
163 -fno-strict-aliasing \
167 $(GLOBALDEPS_CFLAGS) \
169 $(WEBKITDEPS_CFLAGS) \
175 $(GSTREAMER_CFLAGS) \
180 libWebCore_la_CFLAGS = \
181 -fno-strict-aliasing \
184 $(GLOBALDEPS_CFLAGS) \
186 $(WEBKITDEPS_CFLAGS) \
192 $(GSTREAMER_CFLAGS) \
197 libWebCore_la_CPPFLAGS = \
199 $(webcore_cppflags) \
200 $(javascriptcore_cppflags) \
201 $(webcoregtk_cppflags) \
204 libWebCore_la_LIBADD = \
205 libJavaScriptCore.la \
224 webkitgtk_cppflags :=
225 webkitgtk_built_sources :=
226 webkitgtk_built_nosources :=
227 webkitgtk_cleanfiles :=
229 nodist_libwebkit_1_0_la_SOURCES = \
230 $(webkitgtk_built_sources)
232 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
233 libwebkit_1_0_la_HEADERS = \
235 WebKit/gtk/webkit/webkitenumtypes.h
237 libwebkit_1_0_la_SOURCES = \
240 libwebkit_1_0_la_CXXFLAGS = \
241 $(libWebCore_la_CXXFLAGS)
243 libwebkit_1_0_la_CFLAGS = \
244 $(libWebCore_la_CFLAGS)
246 libwebkit_1_0_la_CPPFLAGS = \
247 $(libWebCore_la_CPPFLAGS) \
248 $(webkitgtk_cppflags)
250 libwebkit_1_0_la_LDFLAGS = \
251 $(COVERAGE_LDFLAGS) \
252 -version-info @LIBWEBKITGTK_VERSION@ \
253 -Wl,--version-script,$(srcdir)/symbols.filter \
256 libwebkit_1_0_la_LIBADD = \
260 # Extra checks and flags
262 -DBUILDING_CAIRO__=1 \
266 if !ENABLE_FAST_MALLOC
272 global_cppflags += -DXP_UNIX
276 global_cppflags += -DNDEBUG
278 webcoregtk_cppflags += \
279 -DG_DISABLE_DEPRECATED \
280 -DGDK_PIXBUF_DISABLE_DEPRECATED \
281 -DGDK_DISABLE_DEPRECATED \
282 -DGTK_DISABLE_DEPRECATED \
283 -DPANGO_DISABLE_DEPRECATED
285 # Might be useful in the future
286 # -DGDK_MULTIHEAD_SAFE \
287 # -DGTK_MULTIHEAD_SAFE
291 global_cppflags += -DENABLE_DATABASE=0
294 if !ENABLE_ICONDATABASE
295 global_cppflags += -DENABLE_ICONDATABASE=0
300 -DGCC_GENERATE_TEST_COVERAGE_FILES \
301 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
305 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
309 WebKit/gtk/webkit/webkit.h \
310 WebKit/gtk/webkit/webkitdefines.h \
311 WebKit/gtk/webkit/webkitnetworkrequest.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/webkitwebsettings.h \
317 WebKit/gtk/webkit/webkitwebview.h
319 webkitgtk_built_sources += \
320 DerivedSources/webkitenumtypes.cpp \
321 DerivedSources/webkitmarshal.cpp \
322 DerivedSources/webkitmarshal.h \
323 WebKit/gtk/webkit/webkitenumtypes.h
325 webkitgtk_sources += \
326 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
327 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
328 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
329 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
330 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
331 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
332 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
333 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
334 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
335 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
336 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
337 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
338 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
339 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
340 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
341 WebKit/gtk/webkit/webkitprivate.cpp \
342 WebKit/gtk/webkit/webkitprivate.h \
343 WebKit/gtk/webkit/webkitversion.cpp \
344 WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
345 WebKit/gtk/webkit/webkitwebframe.cpp \
346 WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
347 WebKit/gtk/webkit/webkitwebsettings.cpp \
348 WebKit/gtk/webkit/webkitwebview.cpp
350 webkitgtk_cppflags += \
352 -I$(srcdir)/WebKit/gtk \
353 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
354 -I$(srcdir)/WebKit/gtk/webkit \
355 -I$(top_builddir)/WebKit/gtk/webkit
357 webkitgtk_cleanfiles += \
358 $(top_builddir)/Programs/GtkLauncher \
359 $(top_builddir)/WebKit/gtk/webkit-1.0.pc
361 pkgconfigdir = $(libdir)/pkgconfig
362 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
365 stamp-webkitmarshal.cpp \
366 stamp-webkitmarshal.h \
367 stamp-webkitenumtypes.cpp \
368 stamp-webkitenumtypes.h
370 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
371 WEBKIT_MARSHAL_LIST = $(WEBKIT_MARSHAL).list
373 $(WEBKIT_MARSHAL_LIST): $(webkitgtk_sources) GNUmakefile.am
374 ( cd $(top_srcdir) && \
375 sed -n -e 's/.*webkit_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
376 $(webkitgtk_sources) ) \
377 | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
378 if cmp -s $@.tmp $@; then \
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
450 $(javascriptcore_dist) \
454 # Files that will be cleaned
455 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
456 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
457 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
459 # Include module makefiles
460 include JavaScriptCore/GNUmakefile.am
461 include WebCore/GNUmakefile.am
462 include WebKitTools/GNUmakefile.am
464 # Autogenerated sources
466 $(javascriptcore_built_sources) \
467 $(javascriptcore_built_nosources) \
468 $(webcore_built_sources) \
469 $(webcore_built_nosources) \
470 $(webkitgtk_built_sources) \
471 $(webkitgtk_built_nosources)
473 # Project-wide clean rules
475 $(webkitgtk_cleanfiles)
477 MAINTAINERCLEANFILES += \
478 $(srcdir)/aconfig.h.in \
485 # remove built sources and program directories
487 -rm -rf $(GENSOURCES) $(GENPROGRAMS)