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
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 \
65 $(SYMBOL_VISIBILITY_INLINES) \
73 # -no-undefined required for building DLLs on Windows
74 # It breaks the build on other platforms, so we use it conditionally
76 no_undefined = -no-undefined
80 version_script = -Wl,--version-script,$(srcdir)/symbols.filter
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 :=
99 javascriptcore_dist :=
101 javascriptcore_cppflags += \
102 -I$(srcdir)/JavaScriptCore \
103 -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
104 -I$(srcdir)/JavaScriptCore/parser \
105 -I$(srcdir)/JavaScriptCore/wtf \
106 -I$(top_builddir)/DerivedSources
108 # The variables above are already included below so no need to touch
109 # these variables unless you really have to
110 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
111 $(javascriptcore_built_nosources)
113 nodist_libJavaScriptCore_la_SOURCES = \
114 $(javascriptcore_built_sources)
116 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
117 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
119 libJavaScriptCore_la_SOURCES = \
120 $(javascriptcore_sources)
122 libJavaScriptCore_la_LIBADD = \
127 libJavaScriptCore_la_CXXFLAGS = \
129 $(libJavaScriptCore_la_CFLAGS)
131 libJavaScriptCore_la_CFLAGS = \
135 $(GLOBALDEPS_CFLAGS) \
138 libJavaScriptCore_la_CPPFLAGS = \
140 $(javascriptcore_cppflags)
147 webcore_built_sources :=
148 webcore_built_nosources :=
150 webcoregtk_cppflags :=
151 webcoregtk_sources :=
153 nodist_EXTRA_libWebCore_la_SOURCES = \
154 $(webcore_built_nosources)
156 nodist_libWebCore_la_SOURCES = \
157 $(webcore_built_sources)
159 libWebCore_la_SOURCES = \
161 $(webcoregtk_sources)
163 libWebCore_la_CXXFLAGS = \
165 $(libWebCore_la_CFLAGS)
167 libWebCore_la_CFLAGS = \
168 -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 \
218 webkitgtk_cppflags :=
219 webkitgtk_built_sources :=
220 webkitgtk_built_nosources :=
221 webkitgtk_cleanfiles :=
223 nodist_libwebkit_1_0_la_SOURCES = \
224 $(webkitgtk_built_sources)
226 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
227 libwebkit_1_0_la_HEADERS = \
229 WebKit/gtk/webkit/webkitenumtypes.h
231 libwebkit_1_0_la_SOURCES = \
234 libwebkit_1_0_la_CXXFLAGS = \
235 $(libWebCore_la_CXXFLAGS)
237 libwebkit_1_0_la_CFLAGS = \
238 $(libWebCore_la_CFLAGS)
240 libwebkit_1_0_la_CPPFLAGS = \
241 $(libWebCore_la_CPPFLAGS) \
242 $(webkitgtk_cppflags)
244 libwebkit_1_0_la_LDFLAGS = \
245 $(COVERAGE_LDFLAGS) \
246 -version-info @LIBWEBKITGTK_VERSION@ \
250 libwebkit_1_0_la_LIBADD = \
254 # Extra checks and flags
256 -DBUILDING_CAIRO__=1 \
260 if !ENABLE_FAST_MALLOC
266 global_cppflags += -DXP_UNIX
270 global_cppflags += -DNDEBUG
272 webcoregtk_cppflags += \
273 -DG_DISABLE_DEPRECATED \
274 -DGDK_PIXBUF_DISABLE_DEPRECATED \
275 -DGDK_DISABLE_DEPRECATED \
276 -DGTK_DISABLE_DEPRECATED \
277 -DPANGO_DISABLE_DEPRECATED
279 # Might be useful in the future
280 # -DGDK_MULTIHEAD_SAFE \
281 # -DGTK_MULTIHEAD_SAFE
285 global_cppflags += -DENABLE_DATABASE=0
288 if !ENABLE_ICONDATABASE
289 global_cppflags += -DENABLE_ICONDATABASE=0
294 -DGCC_GENERATE_TEST_COVERAGE_FILES \
295 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
299 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
303 WebKit/gtk/webkit/webkit.h \
304 WebKit/gtk/webkit/webkitdefines.h \
305 WebKit/gtk/webkit/webkitnetworkrequest.h \
306 WebKit/gtk/webkit/webkitversion.h \
307 WebKit/gtk/webkit/webkitwebbackforwardlist.h \
308 WebKit/gtk/webkit/webkitwebframe.h \
309 WebKit/gtk/webkit/webkitwebhistoryitem.h \
310 WebKit/gtk/webkit/webkitwebinspector.h \
311 WebKit/gtk/webkit/webkitwebnavigationaction.h \
312 WebKit/gtk/webkit/webkitwebpolicydecision.h \
313 WebKit/gtk/webkit/webkitwebsettings.h \
314 WebKit/gtk/webkit/webkitwebwindowfeatures.h \
315 WebKit/gtk/webkit/webkitwebview.h
317 webkitgtk_built_sources += \
318 DerivedSources/webkitenumtypes.cpp \
319 DerivedSources/webkitmarshal.cpp \
320 DerivedSources/webkitmarshal.h \
321 WebKit/gtk/webkit/webkitenumtypes.h
323 webkitgtk_sources += \
324 WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
325 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
326 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
327 WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
328 WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
329 WebKit/gtk/WebCoreSupport/DragClientGtk.h \
330 WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
331 WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
332 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
333 WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
334 WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
335 WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
336 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
337 WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
338 WebKit/gtk/webkit/webkitnetworkrequest.cpp \
339 WebKit/gtk/webkit/webkitprivate.cpp \
340 WebKit/gtk/webkit/webkitprivate.h \
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/webkitwebinspector.cpp \
346 WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
347 WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
348 WebKit/gtk/webkit/webkitwebsettings.cpp \
349 WebKit/gtk/webkit/webkitwebview.cpp \
350 WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
352 webkitgtk_cppflags += \
354 -I$(srcdir)/WebKit/gtk \
355 -I$(srcdir)/WebKit/gtk/WebCoreSupport \
356 -I$(srcdir)/WebKit/gtk/webkit \
357 -I$(top_builddir)/WebKit/gtk/webkit
359 webkitgtk_cleanfiles += \
360 $(top_builddir)/Programs/GtkLauncher \
361 $(top_builddir)/WebKit/gtk/webkit-1.0.pc \
362 $(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h
364 pkgconfigdir = $(libdir)/pkgconfig
365 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
368 stamp-webkitmarshal.cpp \
369 stamp-webkitmarshal.h \
370 stamp-webkitenumtypes.cpp \
371 stamp-webkitenumtypes.h
373 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
374 WEBKIT_MARSHAL_LIST = $(WEBKIT_MARSHAL).list
376 $(WEBKIT_MARSHAL_LIST): $(webkitgtk_sources) GNUmakefile.am
377 ( cd $(top_srcdir) && \
378 sed -n -e 's/.*webkit_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
379 $(webkitgtk_sources) ) \
380 | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
381 if cmp -s $@.tmp $@; then \
387 $(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
390 $(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
393 stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
394 echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
395 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
396 echo timestamp > $(@F)
398 stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
399 $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
400 echo timestamp > $(@F)
402 WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
404 stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
407 --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
408 --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
409 --fhead "#include <glib-object.h>\n\n" \
410 --fhead "#include <webkit/webkitdefines.h>\n\n" \
411 --fhead "G_BEGIN_DECLS\n\n" \
412 --ftail "G_END_DECLS\n\n" \
414 --fprod "#include <@filename@>\n\n" \
415 --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
416 --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
417 $(webkitgtk_h_api) | \
418 sed 's,WebKit/gtk/,,' | \
419 sed 's,web_kit,webkit,' | \
420 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
422 && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
424 && echo timestamp > $(@F)
426 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
429 --fhead "#include <config.h>\n" \
430 --fhead "#include <glib-object.h>\n" \
431 --fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
432 --fhead "extern \"C\" {\n\n" \
433 --fprod "\n/* enumerations from \"@filename@\" */" \
434 --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
435 --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
436 --vtail " { 0, NULL, NULL }\n};\n\n" \
437 --vtail "GType @enum_name@_get_type(void)\n{\n" \
438 --vtail " static GType type = 0;\n\n" \
439 --vtail " if (!type)\n" \
440 --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
441 --vtail " return type;\n}\n\n" \
443 $(webkitgtk_h_api) | \
444 sed 's,web_kit,webkit,' \
451 # Files that will be distributed
454 $(javascriptcore_dist) \
458 # Files that will be cleaned
459 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
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 += Programs/UnitTests
470 Programs_UnitTests_CPPFLAGS = \
471 -I$(srcdir)/WebKit/gtk \
472 -I$(top_builddir)/WebKit/gtk \
474 $(javascriptcore_cppflags)
476 Programs_UnitTests_SOURCES = \
477 WebKit/gtk/tests/main.c
479 Programs_UnitTests_CFLAGS = \
480 -fno-strict-aliasing \
486 Programs_UnitTests_LDADD = \
490 # Autogenerated sources
492 $(javascriptcore_built_sources) \
493 $(javascriptcore_built_nosources) \
494 $(webcore_built_sources) \
495 $(webcore_built_nosources) \
496 $(webkitgtk_built_sources) \
497 $(webkitgtk_built_nosources)
499 # Project-wide clean rules
501 $(webkitgtk_cleanfiles)
503 MAINTAINERCLEANFILES += \
504 $(srcdir)/aconfig.h.in \
511 # Older automake versions (1.7) place Plo files in a different place so we need
512 # to create the output directory manually.
514 mkdir -p $(top_builddir)/$(DEPDIR)/DerivedSources
516 # remove built sources and program directories
518 -rm -rf $(GENSOURCES) $(GENPROGRAMS)