Please add a version to the Gtk port
[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 API and WebCoreSupport parts to webkitgtk_sources,
18 # etc... The only exceptions are the global variables. See Global Variables
19 # below.
20 #
21 # Global Variables
22 #
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
29
30 srcdir = @srcdir@
31 VPATH = @srcdir@
32
33 # Directory for autogenerated sources
34 GENSOURCES := $(top_builddir)/DerivedSources
35 GENPROGRAMS := $(top_builddir)/Programs
36
37 # Script for creating hash tables
38 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/kjs/create_hash_table
39
40 # Libraries and support components
41 noinst_PROGRAMS :=
42
43 lib_LIBRARIES :=
44
45 IDL_BINDINGS :=
46
47 # Files that will be distributed
48 EXTRA_DIST :=
49
50 # Global flags to CPP
51 global_cppflags :=
52
53 global_cppflags += \
54         -DWTF_USE_ICU_UNICODE=1
55
56 # Default compiler flags
57 global_cflags := \
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
62
63 global_cxxflags := \
64         $(SYMBOL_VISIBILITY_INLINES)
65
66 if !ENABLE_DEBUG
67 global_cflags += \
68         -fno-exceptions \
69         $(SYMBOL_VISIBILITY)
70
71 global_cxxflags += \
72         -fno-rtti
73 endif
74
75 # -no-undefined required for building DLLs on Windows
76 # It breaks the build on other platforms, so we use it conditionally
77 if OS_WIN32
78 no_undefined = -no-undefined
79 endif
80
81 # Shared libraries
82 lib_LTLIBRARIES = \
83         libwebkit-1.0.la
84
85 # Convenience libraries
86 noinst_LTLIBRARIES = \
87         libJavaScriptCore.la \
88         libWebCore.la
89
90 #
91 # JavaScriptCore
92 javascriptcore_h_api :=
93 javascriptcore_cppflags:=
94 javascriptcore_sources :=
95 javascriptcore_built_sources :=
96 javascriptcore_built_nosources :=
97
98 javascriptcore_cppflags += \
99         -I$(srcdir)/JavaScriptCore \
100         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
101         -I$(srcdir)/JavaScriptCore/wtf \
102         -I$(srcdir)/JavaScriptCore/kjs \
103         -I$(top_builddir)/DerivedSources
104
105 # The variables above are already included below so no need to touch
106 # these variables unless you really have to
107 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
108         $(javascriptcore_built_nosources)
109
110 nodist_libJavaScriptCore_la_SOURCES = \
111         $(javascriptcore_built_sources)
112
113 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
114 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
115
116 libJavaScriptCore_la_SOURCES = \
117         $(javascriptcore_sources)
118
119 libJavaScriptCore_la_LIBADD = \
120         $(UNICODE_LIBS) \
121         $(GLOBALDEPS_LIBS) \
122         -lpthread
123
124 libJavaScriptCore_la_CXXFLAGS = \
125         $(global_cxxflags) \
126         $(global_cflags) \
127         $(GLOBALDEPS_CFLAGS) \
128         $(UNICODE_CFLAGS) \
129         -fno-strict-aliasing
130
131 libJavaScriptCore_la_CFLAGS = \
132         $(global_cflags) \
133         $(GLOBALDEPS_CFLAGS) \
134         $(UNICODE_CFLAGS) \
135         -fno-strict-aliasing
136
137 libJavaScriptCore_la_CPPFLAGS = \
138         $(global_cppflags) \
139         $(javascriptcore_cppflags)
140
141 #
142 # WebCore
143 webcore_cppflags :=
144 webcore_sources :=
145 webcore_headers :=
146 webcore_libadd :=
147 webcore_built_sources :=
148 webcore_built_nosources :=
149 webcoregtk_cppflags :=
150 webcoregtk_sources :=
151 webcoregtk_headers :=
152
153 nodist_libWebCore_la_SOURCES = \
154         $(webcore_built_sources)
155
156 libWebCore_la_SOURCES = \
157         $(webcore_headers) \
158         $(webcore_sources) \
159         $(webcoregtk_headers) \
160         $(webcoregtk_sources)
161
162 libWebCore_la_CXXFLAGS = \
163         -fno-strict-aliasing \
164         $(global_cxxflags) \
165         $(global_cflags) \
166         $(GLOBALDEPS_CFLAGS) \
167         $(UNICODE_CFLAGS) \
168         $(WEBKITDEPS_CFLAGS) \
169         $(LIBCURL_CFLAGS) \
170         $(LIBSOUP_CFLAGS) \
171         $(FREETYPE_CFLAGS) \
172         $(SQLITE3_CFLAGS) \
173         $(GSTREAMER_CFLAGS) \
174         $(LIBXSLT_CFLAGS) \
175         $(COVERAGE_CFLAGS) \
176         $(HILDON_CFLAGS)
177
178 libWebCore_la_CFLAGS = \
179         -fno-strict-aliasing \
180         $(global_cflags) \
181         $(GLOBALDEPS_CFLAGS) \
182         $(UNICODE_CFLAGS) \
183         $(WEBKITDEPS_CFLAGS) \
184         $(LIBCURL_CFLAGS) \
185         $(LIBSOUP_CFLAGS) \
186         $(FREETYPE_CFLAGS) \
187         $(SQLITE3_CFLAGS) \
188         $(GSTREAMER_CFLAGS) \
189         $(LIBXSLT_CFLAGS) \
190         $(COVERAGE_CFLAGS) \
191         $(HILDON_CFLAGS)
192
193 libWebCore_la_CPPFLAGS = \
194         $(global_cppflags) \
195         $(webcore_cppflags) \
196         $(javascriptcore_cppflags) \
197         $(webcoregtk_cppflags) \
198         $(HILDON_CPPFLAGS)
199
200 libWebCore_la_LIBADD = \
201         libJavaScriptCore.la \
202         $(webcore_libadd) \
203         $(GLOBALDEPS_LIBS) \
204         $(WEBKITDEPS_LIBS) \
205         $(LIBCURL_LIBS) \
206         $(LIBSOUP_LIBS) \
207         $(FREETYPE_LIBS) \
208         $(UNICODE_LIBS) \
209         $(SQLITE3_LIBS) \
210         $(GSTREAMER_LIBS) \
211         $(LIBXSLT_LIBS) \
212         $(HILDON_LIBS) \
213         -lpthread \
214         -ljpeg
215
216 # WebKit
217 webkitgtk_h_api :=
218 webkitgtk_headers :=
219 webkitgtk_sources :=
220 webkitgtk_cppflags :=
221 webkitgtk_built_sources :=
222 webkitgtk_built_nosources :=
223 webkitgtk_cleanfiles :=
224
225 nodist_libwebkit_1_0_la_SOURCES = \
226         $(webkitgtk_built_sources)
227
228 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
229 libwebkit_1_0_la_HEADERS = $(webkitgtk_h_api)
230
231 libwebkit_1_0_la_SOURCES = \
232         $(webkitgtk_headers) \
233         $(webkitgtk_sources)
234
235 libwebkit_1_0_la_CXXFLAGS = \
236         $(libWebCore_la_CXXFLAGS)
237
238 libwebkit_1_0_la_CFLAGS = \
239         $(libWebCore_la_CFLAGS)
240
241 libwebkit_1_0_la_CPPFLAGS = \
242         $(libWebCore_la_CPPFLAGS)
243
244 libwebkit_1_0_la_LDFLAGS = \
245         $(COVERAGE_LDFLAGS) \
246         -version-info @LIBWEBKITGTK_VERSION@ \
247         $(no_undefined)
248
249 libwebkit_1_0_la_LIBADD = \
250         libWebCore.la
251
252 #
253 # Extra checks and flags
254 global_cppflags += \
255         -DBUILDING_CAIRO__=1 \
256         -DBUILDING_GTK__=1 \
257         -DWTF_CHANGES
258
259 if !ENABLE_FAST_MALLOC
260 global_cppflags += \
261         -DUSE_SYSTEM_MALLOC
262 endif
263
264 if TARGET_X11
265 global_cppflags += -DXP_UNIX
266 webcore_libadd += -lXt
267 endif
268
269 # Used for symbol exports on Windows
270 webcoregtk_cppflags += \
271         -DBUILDING_WEBKIT
272
273 if !ENABLE_DEBUG
274 global_cppflags += -DNDEBUG
275 else
276 webcoregtk_cppflags += \
277         -DG_DISABLE_DEPRECATED \
278         -DGDK_PIXBUF_DISABLE_DEPRECATED \
279         -DGDK_DISABLE_DEPRECATED \
280         -DGTK_DISABLE_DEPRECATED \
281         -DPANGO_DISABLE_DEPRECATED
282
283 # Might be useful in the future
284 #       -DGDK_MULTIHEAD_SAFE \
285 #       -DGTK_MULTIHEAD_SAFE
286 endif
287
288 if !ENABLE_DATABASE
289 global_cppflags += -DENABLE_DATABASE=0
290 endif
291
292 if !ENABLE_ICONDATABASE
293 global_cppflags += -DENABLE_ICONDATABASE=0
294 endif
295
296 if ENABLE_COVERAGE
297 global_cppflags += \
298         -DGCC_GENERATE_TEST_COVERAGE_FILES \
299         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
300 endif
301
302 if ENABLE_VIDEO
303 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
304 endif
305
306 webkitgtk_h_api += \
307         WebKit/gtk/webkit/webkit.h \
308         WebKit/gtk/webkit/webkitdefines.h \
309         WebKit/gtk/webkit/webkitnetworkrequest.h \
310         WebKit/gtk/webkit/webkitversion.h \
311         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
312         WebKit/gtk/webkit/webkitwebframe.h \
313         WebKit/gtk/webkit/webkitwebhistoryitem.h \
314         WebKit/gtk/webkit/webkitwebsettings.h \
315         WebKit/gtk/webkit/webkitwebview.h
316
317 webkitgtk_built_sources += \
318         DerivedSources/webkit-marshal.h \
319         DerivedSources/webkit-marshal.cpp
320
321 webkitgtk_headers += \
322         WebKit/gtk/webkit/webkitprivate.h \
323         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
324         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
325         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
326         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
327         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
328         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
329         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
330
331 webkitgtk_sources += \
332         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
333         WebKit/gtk/webkit/webkitprivate.cpp \
334         WebKit/gtk/webkit/webkitversion.cpp \
335         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
336         WebKit/gtk/webkit/webkitwebframe.cpp \
337         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
338         WebKit/gtk/webkit/webkitwebsettings.cpp \
339         WebKit/gtk/webkit/webkitwebview.cpp \
340         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
341         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
342         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
343         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
344         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
345         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
346         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
347
348 webkitgtk_cleanfiles += \
349         $(top_builddir)/Programs/GtkLauncher \
350         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
351
352 pkgconfigdir = $(libdir)/pkgconfig
353 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
354
355 WEBKIT_MARSHAL = $(GENSOURCES)/webkit-marshal
356 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
357
358 stamp_files := \
359         stamp-webkit-marshal.cpp \
360         stamp-webkit-marshal.h
361
362 DerivedSources/webkit-marshal.cpp: stamp-webkit-marshal.cpp
363         @true
364
365 DerivedSources/webkit-marshal.h: stamp-webkit-marshal.h
366         @true
367
368 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
369         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
370         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
371         echo timestamp > $(@F)
372
373 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
374         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
375         echo timestamp > $(@F)
376
377 # END WEBKIT GTK+
378
379 # Files that will be cleaned
380 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
381 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
382 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
383
384 # Include module makefiles
385 include JavaScriptCore/GNUmakefile.am
386 include WebCore/GNUmakefile.am
387 include WebKitTools/GNUmakefile.am
388
389 # Autogenerated sources
390 BUILT_SOURCES = \
391         $(javascriptcore_built_sources) \
392         $(javascriptcore_built_nosources) \
393         $(webcore_built_sources) \
394         $(webcore_built_nosources) \
395         $(webkitgtk_built_sources) \
396         $(webkitgtk_built_nosources)
397
398 # Project-wide clean rules
399 CLEANFILES += \
400         $(webkitgtk_cleanfiles)
401
402 MAINTAINERCLEANFILES += \
403         $(srcdir)/aconfig.h.in \
404         configure \
405         config.* \
406         GNUmakefile.in \
407         INSTALL \
408         README
409
410 # remove built sources and program directories
411 clean-local:
412         -rm -rf $(GENSOURCES) $(GENPROGRAMS)