2008-07-25 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / GNUmakefile.am
bloba6ae299039b5be0368e1d8a449ae7262194f8355
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
12 #                     _SOURCES primary
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
19 # below.
21 # Global Variables
23 # global_cppflags   = CPPFLAGS that apply to JSC, WebCore, and to any
24 #                     specific port
25 # global_cflags     = CFLAGS that apply to JSC, WebCore, and to
26 #                     any specific port
27 # global_cxxflags   = CXXFLAGS that apply to JSC, WebCore, and to any
28 #                     specific port
30 srcdir = @srcdir@
31 VPATH = @srcdir@
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
41 bin_PROGRAMS :=
43 noinst_PROGRAMS :=
45 lib_LIBRARIES :=
47 IDL_BINDINGS :=
49 # Files that will be distributed
50 EXTRA_DIST :=
52 # Global flags to CPP
53 global_cppflags :=
55 global_cppflags += \
56         -DWTF_USE_ICU_UNICODE=1
58 # Default compiler flags
59 global_cflags := \
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
65 global_cxxflags := \
66         $(SYMBOL_VISIBILITY_INLINES)
68 if !ENABLE_DEBUG
69 global_cflags += \
70         -fno-exceptions \
71         $(SYMBOL_VISIBILITY)
73 global_cxxflags += \
74         -fno-rtti
75 endif
77 # -no-undefined required for building DLLs on Windows
78 # It breaks the build on other platforms, so we use it conditionally
79 if OS_WIN32
80 no_undefined = -no-undefined
81 endif
83 # Shared libraries
84 lib_LTLIBRARIES = \
85         libwebkit-1.0.la
87 # Convenience libraries
88 noinst_LTLIBRARIES = \
89         libJavaScriptCore.la \
90         libWebCore.la
93 # JavaScriptCore
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 = \
122         $(UNICODE_LIBS) \
123         $(GLOBALDEPS_LIBS) \
124         -lpthread
126 libJavaScriptCore_la_CXXFLAGS = \
127         -fstrict-aliasing \
128         -O3 \
129         $(global_cxxflags) \
130         $(global_cflags) \
131         $(GLOBALDEPS_CFLAGS) \
132         $(UNICODE_CFLAGS)
134 libJavaScriptCore_la_CFLAGS = \
135         -fstrict-aliasing \
136         -O3 \
137         $(global_cflags) \
138         $(GLOBALDEPS_CFLAGS) \
139         $(UNICODE_CFLAGS)
141 libJavaScriptCore_la_CPPFLAGS = \
142         $(global_cppflags) \
143         $(javascriptcore_cppflags)
146 # WebCore
147 webcore_cppflags :=
148 webcore_sources :=
149 webcore_headers :=
150 webcore_libadd :=
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 = \
161         $(webcore_headers) \
162         $(webcore_sources) \
163         $(webcoregtk_headers) \
164         $(webcoregtk_sources)
166 libWebCore_la_CXXFLAGS = \
167         -fno-strict-aliasing \
168         -O2 \
169         $(global_cxxflags) \
170         $(global_cflags) \
171         $(GLOBALDEPS_CFLAGS) \
172         $(UNICODE_CFLAGS) \
173         $(WEBKITDEPS_CFLAGS) \
174         $(LIBCURL_CFLAGS) \
175         $(LIBSOUP_CFLAGS) \
176         $(FREETYPE_CFLAGS) \
177         $(SQLITE3_CFLAGS) \
178         $(GSTREAMER_CFLAGS) \
179         $(LIBXSLT_CFLAGS) \
180         $(COVERAGE_CFLAGS) \
181         $(HILDON_CFLAGS)
183 libWebCore_la_CFLAGS = \
184         -fno-strict-aliasing \
185         -O2 \
186         $(global_cflags) \
187         $(GLOBALDEPS_CFLAGS) \
188         $(UNICODE_CFLAGS) \
189         $(WEBKITDEPS_CFLAGS) \
190         $(LIBCURL_CFLAGS) \
191         $(LIBSOUP_CFLAGS) \
192         $(FREETYPE_CFLAGS) \
193         $(SQLITE3_CFLAGS) \
194         $(GSTREAMER_CFLAGS) \
195         $(LIBXSLT_CFLAGS) \
196         $(COVERAGE_CFLAGS) \
197         $(HILDON_CFLAGS)
199 libWebCore_la_CPPFLAGS = \
200         $(global_cppflags) \
201         $(webcore_cppflags) \
202         $(javascriptcore_cppflags) \
203         $(webcoregtk_cppflags) \
204         $(HILDON_CPPFLAGS)
206 libWebCore_la_LIBADD = \
207         libJavaScriptCore.la \
208         $(webcore_libadd) \
209         $(GLOBALDEPS_LIBS) \
210         $(WEBKITDEPS_LIBS) \
211         $(LIBCURL_LIBS) \
212         $(LIBSOUP_LIBS) \
213         $(FREETYPE_LIBS) \
214         $(UNICODE_LIBS) \
215         $(SQLITE3_LIBS) \
216         $(GSTREAMER_LIBS) \
217         $(LIBXSLT_LIBS) \
218         $(HILDON_LIBS) \
219         -lpthread \
220         -ljpeg
222 # WebKit
223 webkitgtk_h_api :=
224 webkitgtk_headers :=
225 webkitgtk_sources :=
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 = \
236         $(webkitgtk_h_api) \
237         WebKit/gtk/webkit/webkitenumtypes.h
239 libwebkit_1_0_la_SOURCES = \
240         $(webkitgtk_headers) \
241         $(webkitgtk_sources)
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@ \
256         $(no_undefined)
258 libwebkit_1_0_la_LIBADD = \
259         libWebCore.la
262 # Extra checks and flags
263 global_cppflags += \
264         -DBUILDING_CAIRO__=1 \
265         -DBUILDING_GTK__=1 \
266         -DWTF_CHANGES
268 if !ENABLE_FAST_MALLOC
269 global_cppflags += \
270         -DUSE_SYSTEM_MALLOC
271 endif
273 if TARGET_X11
274 global_cppflags += -DXP_UNIX
275 webcore_libadd += -lXt
276 endif
278 if !ENABLE_DEBUG
279 global_cppflags += -DNDEBUG
280 else
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
291 endif
293 if !ENABLE_DATABASE
294 global_cppflags += -DENABLE_DATABASE=0
295 endif
297 if !ENABLE_ICONDATABASE
298 global_cppflags += -DENABLE_ICONDATABASE=0
299 endif
301 if ENABLE_COVERAGE
302 global_cppflags += \
303         -DGCC_GENERATE_TEST_COVERAGE_FILES \
304         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
305 endif
307 if ENABLE_VIDEO
308 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
309 endif
311 webkitgtk_h_api += \
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 += \
356         -DBUILDING_WEBKIT \
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
369 stamp_files := \
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
379         @true
381 DerivedSources/webkit-marshal.h: stamp-webkit-marshal.h
382         @true
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
394         @true
395 stamp-webkitenumtypes.h: $(webkitgtk_h_api) Makefile
396         (cd $(srcdir) \
397         && glib-mkenums \
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" \
404                         --ftail "#endif\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,' \
412                 ) > xgen-gth \
413         && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
414         && rm -f xgen-gth \
415         && echo timestamp > $(@F)
417 DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) Makefile
418         (cd $(srcdir) \
419         && glib-mkenums \
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" \
433                         --ftail "}\n" \
434                 $(webkitgtk_h_api) | \
435                 sed 's,web_kit,webkit,' \
436                 ) > xgen-gtc \
437         && cp xgen-gtc $@ \
438         && rm -f xgen-gtc
440 # END WEBKIT GTK+
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
453 BUILT_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
462 CLEANFILES += \
463         $(webkitgtk_cleanfiles)
465 MAINTAINERCLEANFILES += \
466         $(srcdir)/aconfig.h.in \
467         configure \
468         config.* \
469         GNUmakefile.in \
470         INSTALL \
471         README
473 # remove built sources and program directories
474 clean-local:
475         -rm -rf $(GENSOURCES) $(GENPROGRAMS)