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