.:
[WebKit-https.git] / GNUmakefile.am
1 # Top-level Makefile rule for automake
2 #
3 # Variable conventions:
4 #
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
14 #
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-specific flags should go to webkitgtk_cppflags,
18 # etc... The only exceptions are the global variables. See Global Variables below.
19 #
20 # Global Variables
21 #
22 # global_cppflags   = CPPFLAGS that apply to JSC, WebCore, and to any
23 #                     specific port
24 # global_cflags     = CFLAGS that apply to JSC, WebCore, and to
25 #                     any specific port
26 # global_cxxflags   = CXXFLAGS that apply to JSC, WebCore, and to any
27 #                     specific port
28
29 srcdir = @srcdir@
30 VPATH = @srcdir@
31
32 # Directory for autogenerated sources
33 GENSOURCES := $(top_builddir)/DerivedSources
34
35 # Script for creating hash tables
36 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/kjs/create_hash_table
37
38 # Libraries and support components
39 noinst_HEADERS :=
40
41 noinst_PROGRAMS :=
42
43 lib_LIBRARIES :=
44
45 IDL_BINDINGS :=
46
47 # Files that will be distributed
48 EXTRA_DIST :=
49
50 #
51 # Global flags to CPP
52 global_cppflags :=
53
54 global_cppflags += \
55         -I$(srcdir)/JavaScriptCore \
56         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
57         -I$(srcdir)/JavaScriptCore/wtf \
58         -I$(srcdir)/JavaScriptCore/kjs \
59         -I$(top_builddir)/DerivedSources
60
61 # Default compiler flags
62 global_cflags := \
63         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
64         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
65         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
66         -Wno-unused-parameter
67
68 global_cxxflags := \
69         $(SYMBOL_VISIBILITY_INLINES)
70
71 if !ENABLE_DEBUG
72 global_cflags += \
73         -fno-exceptions \
74         $(SYMBOL_VISIBILITY)
75
76 global_cxxflags += \
77         -fno-rtti
78 endif
79
80 # Shared libraries
81 lib_LTLIBRARIES = \
82         libWebKitGtk.la
83
84 # Convenience libraries
85 noinst_LTLIBRARIES = \
86         libJavaScriptCore.la
87
88 #
89 # JavaScriptCore
90 javascriptcore_h_api :=
91 javascriptcore_cppflags:=
92 javascriptcore_sources :=
93 javascriptcore_built_sources :=
94 javascriptcore_built_nosources :=
95
96 # The variables above are already included below so no need to touch
97 # these variables unless you really have to
98 libJavaScriptCore_ladir = $(prefix)/include/WebKit/JavaScriptCore
99 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
100
101 libJavaScriptCore_la_SOURCES = \
102         $(javascriptcore_built_sources) \
103         $(javascriptcore_sources)
104
105 libJavaScriptCore_la_LIBADD = 
106         $(ICU_LIBS) \
107         $(GLOBALDEPS_LIBS) \
108         -lpthread
109
110 libJavaScriptCore_la_CXXFLAGS = \
111         $(global_cxxflags) \
112         $(global_cflags) \
113         $(GLOBALDEPS_CFLAGS) \
114         -fstrict-aliasing
115
116 libJavaScriptCore_la_CFLAGS = \
117         $(global_cflags) \
118         $(GLOBALDEPS_CFLAGS) \
119         -fstrict-aliasing
120
121 libJavaScriptCore_la_CPPFLAGS = \
122         $(global_cppflags) \
123         $(javascriptcore_cppflags) \
124         $(ICU_CPPFLAGS)
125
126 #
127 # WebCore
128 webcore_cppflags :=
129 webcore_sources :=
130 webcore_headers :=
131 webcore_built_sources :=
132 webcore_built_nosources :=
133
134 # WebKitGtk
135 webkitgtk_h_api :=
136 webkitgtk_headers :=
137 webkitgtk_sources :=
138 webkitgtk_cppflags :=
139 webkitgtk_libadd :=
140 webkitgtk_built_sources :=
141 webkitgtk_built_nosources :=
142 webkitgtk_cleanfiles :=
143
144 webkitgtk_cppflags += $(HILDON_CPPFLAGS)
145
146 # No need to touch the following variables unless you have to. If you need to change the values
147 # for the following variables, use the "webkitgtk_" variables above
148 libWebKitGtk_ladir := $(prefix)/include/WebKit/webkit
149
150 libWebKitGtk_la_HEADERS = $(webkitgtk_h_api)
151
152 libWebKitGtk_la_SOURCES = \
153         $(webcore_built_sources) \
154         $(webcore_headers) \
155         $(webcore_sources) \
156         $(webkitgtk_built_sources) \
157         $(webkitgtk_headers) \
158         $(webkitgtk_sources)
159
160 libWebKitGtk_la_CXXFLAGS = \
161         -fno-strict-aliasing \
162         $(global_cxxflags) \
163         $(global_cflags) \
164         $(GLOBALDEPS_CFLAGS) \
165         $(WEBKITDEPS_CFLAGS) \
166         $(LIBCURL_CFLAGS) \
167         $(SQLITE3_CFLAGS) \
168         $(GSTREAMER_CFLAGS) \
169         $(LIBXSLT_CFLAGS) \
170         $(COVERAGE_CFLAGS) \
171         $(HILDON_CFLAGS)
172
173 libWebKitGtk_la_CFLAGS = \
174         -fno-strict-aliasing \
175         $(global_cflags) \
176         $(GLOBALDEPS_CFLAGS) \
177         $(WEBKITDEPS_CFLAGS) \
178         $(LIBCURL_CFLAGS) \
179         $(SQLITE3_CFLAGS) \
180         $(GSTREAMER_CFLAGS) \
181         $(LIBXSLT_CFLAGS) \
182         $(COVERAGE_CFLAGS) \
183         $(HILDON_CFLAGS)
184
185 libWebKitGtk_la_CPPFLAGS = \
186         $(global_cppflags) \
187         $(webcore_cppflags) \
188         $(webkitgtk_cppflags) \
189         $(ICU_CPPFLAGS)
190
191 libWebKitGtk_la_LIBADD = libJavaScriptCore.la \
192         $(webkitgtk_libadd) \
193         $(GLOBALDEPS_LIBS) \
194         $(WEBKITDEPS_LIBS) \
195         $(LIBCURL_LIBS) \
196         $(ICU_LIBS) \
197         $(SQLITE3_LIBS) \
198         $(GSTREAMER_LIBS) \
199         $(LIBXSLT_LIBS) \
200         $(HILDON_LIBS) \
201         -lpthread \
202         -ljpeg
203
204 libWebKitGtk_la_LDFLAGS = \
205         $(COVERAGE_LDFLAGS) \
206         -version-info @LIBWEBKITGTK_VERSION@
207
208 #
209 # Extra checks and flags
210 global_cppflags += \
211         -DBUILDING_GTK__=1 \
212         -DWTF_CHANGES
213
214 if !ENABLE_FAST_MALLOC
215 global_cppflags += \
216         -DUSE_SYSTEM_MALLOC
217 endif
218
219 if TARGET_X11
220 global_cppflags += -DXP_UNIX
221 endif
222
223 if !ENABLE_DEBUG
224 global_cppflags += -DNDEBUG
225 else
226 webkitgtk_cppflags += \
227         -DG_DISABLE_DEPRECATED \
228         -DGDK_PIXBUF_DISABLE_DEPRECATED \
229         -DGDK_DISABLE_DEPRECATED \
230         -DGTK_DISABLE_DEPRECATED \
231         -DPANGO_DISABLE_DEPRECATED
232
233 # Might be useful in the future
234 #       -DGDK_MULTIHEAD_SAFE \
235 #       -DGTK_MULTIHEAD_SAFE
236 endif
237
238 if !ENABLE_DATABASE
239 global_cppflags += -DENABLE_DATABASE=0
240 endif
241
242 if !ENABLE_ICONDATABASE
243 global_cppflags += -DENABLE_ICONDATABASE=0
244 endif
245
246 if ENABLE_COVERAGE
247 global_cppflags += \
248         -DGCC_GENERATE_TEST_COVERAGE_FILES \
249         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
250 endif
251
252 if ENABLE_VIDEO
253 webkitgtk_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
254 endif
255
256 #
257 # WEBKIT GTK+
258 webkitgtk_cppflags += \
259 -I$(top_builddir)/WebKit/gtk/webkit \
260 -DBUILDING_CAIRO__=1 \
261 -DBUILD_WEBKIT
262
263 webkitgtk_h_api += \
264         WebKit/gtk/webkit/webkit.h \
265         WebKit/gtk/webkit/webkitdefines.h \
266         WebKit/gtk/webkit/webkitnetworkrequest.h \
267         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
268         WebKit/gtk/webkit/webkitwebframe.h \
269         WebKit/gtk/webkit/webkitwebhistoryitem.h \
270         WebKit/gtk/webkit/webkitwebsettings.h \
271         WebKit/gtk/webkit/webkitwebview.h
272
273 webkitgtk_built_sources += \
274         WebKit/gtk/webkit/webkit-marshal.h \
275         WebKit/gtk/webkit/webkit-marshal.cpp
276
277 webkitgtk_headers += \
278         WebKit/gtk/webkit/webkitprivate.h \
279         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
280         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
281         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
282         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
283         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
284         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
285         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
286
287 webkitgtk_sources += \
288         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
289         WebKit/gtk/webkit/webkitprivate.cpp \
290         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
291         WebKit/gtk/webkit/webkitwebframe.cpp \
292         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
293         WebKit/gtk/webkit/webkitwebsettings.cpp \
294         WebKit/gtk/webkit/webkitwebview.cpp \
295         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
296         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
297         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
298         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
299         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
300         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
301         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
302
303 webkitgtk_cleanfiles += \
304         $(top_builddir)/Programs/GtkLauncher \
305         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
306
307 pkgconfigdir = $(libdir)/pkgconfig
308 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
309
310 WEBKIT_MARSHAL = $(CURDIR)/WebKit/gtk/webkit/webkit-marshal
311 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
312
313 stamp_files := \
314         stamp-webkit-marshal.cpp \
315         stamp-webkit-marshal.h
316
317 WebKit/gtk/webkit/webkit-marshal.cpp: stamp-webkit-marshal.cpp
318         @true
319
320 WebKit/gtk/webkit/webkit-marshal.h: stamp-webkit-marshal.h
321         @true
322
323 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
324         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
325         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
326         echo timestamp > $(@F)
327
328 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
329         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
330         echo timestamp > $(@F)
331
332 # END WEBKIT GTK+
333
334 # Files that will be cleaned
335 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
336 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
337 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
338
339 # Include module makefiles
340 include JavaScriptCore/GNUmakefile.am
341 include WebCore/GNUmakefile.am
342 include WebKitTools/GNUmakefile.am
343
344
345 # Autogenerated sources
346 BUILT_SOURCES = \
347         $(javascriptcore_built_sources) \
348         $(javascriptcore_built_nosources) \
349         $(webcore_built_sources) \
350         $(webcore_built_nosources) \
351         $(webkitgtk_built_sources) \
352         $(webkitgtk_built_nosources)
353
354 # Project-wide clean rules
355 CLEANFILES += \
356         $(webkitgtk_cleanfiles) \
357         $(top_builddir)/Programs/DumpRenderTree \
358         $(top_builddir)/Programs/testkjs \
359         $(GENSOURCES)
360
361 MAINTAINERCLEANFILES += \
362         $(srcdir)/aconfig.h.in \
363         configure \
364         config.* \
365         GNUmakefile.in \
366         INSTALL \
367         README