2008-04-23 Brady Eidson <beidson@apple.com>
[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         $(SQLITE3_CFLAGS) \
160         $(GSTREAMER_CFLAGS) \
161         $(LIBXSLT_CFLAGS) \
162         $(COVERAGE_CFLAGS) \
163         $(HILDON_CFLAGS)
164
165 libWebCore_la_CFLAGS = \
166         -fno-strict-aliasing \
167         $(global_cflags) \
168         $(GLOBALDEPS_CFLAGS) \
169         $(UNICODE_CFLAGS) \
170         $(WEBKITDEPS_CFLAGS) \
171         $(LIBCURL_CFLAGS) \
172         $(LIBSOUP_CFLAGS) \
173         $(SQLITE3_CFLAGS) \
174         $(GSTREAMER_CFLAGS) \
175         $(LIBXSLT_CFLAGS) \
176         $(COVERAGE_CFLAGS) \
177         $(HILDON_CFLAGS)
178
179 libWebCore_la_CPPFLAGS = \
180         $(global_cppflags) \
181         $(webcore_cppflags) \
182         $(javascriptcore_cppflags) \
183         $(webkitgtk_cppflags) \
184         $(HILDON_CPPFLAGS)
185
186 libWebCore_la_LIBADD = \
187         libJavaScriptCore.la \
188         $(webcore_libadd) \
189         $(GLOBALDEPS_LIBS) \
190         $(WEBKITDEPS_LIBS) \
191         $(LIBCURL_LIBS) \
192         $(LIBSOUP_LIBS) \
193         $(UNICODE_LIBS) \
194         $(SQLITE3_LIBS) \
195         $(GSTREAMER_LIBS) \
196         $(LIBXSLT_LIBS) \
197         $(HILDON_LIBS) \
198         -lpthread \
199         -ljpeg
200
201 # WebKit
202 webkitgtk_h_api :=
203 webkitgtk_headers :=
204 webkitgtk_sources :=
205 webkitgtk_cppflags :=
206 webkitgtk_built_sources :=
207 webkitgtk_built_nosources :=
208 webkitgtk_cleanfiles :=
209
210 nodist_libwebkit_1_0_la_SOURCES = \
211         $(webkitgtk_built_sources)
212
213 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
214 libwebkit_1_0_la_HEADERS = $(webkitgtk_h_api)
215
216 libwebkit_1_0_la_SOURCES = \
217         $(webkitgtk_headers) \
218         $(webkitgtk_sources)
219
220 libwebkit_1_0_la_CXXFLAGS = \
221         $(libWebCore_la_CXXFLAGS)
222
223 libwebkit_1_0_la_CFLAGS = \
224         $(libWebCore_la_CFLAGS)
225
226 libwebkit_1_0_la_CPPFLAGS = \
227         $(libWebCore_la_CPPFLAGS)
228
229 libwebkit_1_0_la_LDFLAGS = \
230         $(COVERAGE_LDFLAGS) \
231         -version-info @LIBWEBKITGTK_VERSION@
232
233 libwebkit_1_0_la_LIBADD = \
234         libWebCore.la
235
236 #
237 # Extra checks and flags
238 global_cppflags += \
239         -DBUILDING_GTK__=1 \
240         -DWTF_CHANGES
241
242 if !ENABLE_FAST_MALLOC
243 global_cppflags += \
244         -DUSE_SYSTEM_MALLOC
245 endif
246
247 if TARGET_X11
248 global_cppflags += -DXP_UNIX
249 endif
250
251 if !ENABLE_DEBUG
252 global_cppflags += -DNDEBUG
253 else
254 webkitgtk_cppflags += \
255         -DG_DISABLE_DEPRECATED \
256         -DGDK_PIXBUF_DISABLE_DEPRECATED \
257         -DGDK_DISABLE_DEPRECATED \
258         -DGTK_DISABLE_DEPRECATED \
259         -DPANGO_DISABLE_DEPRECATED
260
261 # Might be useful in the future
262 #       -DGDK_MULTIHEAD_SAFE \
263 #       -DGTK_MULTIHEAD_SAFE
264 endif
265
266 if !ENABLE_DATABASE
267 global_cppflags += -DENABLE_DATABASE=0
268 endif
269
270 if !ENABLE_ICONDATABASE
271 global_cppflags += -DENABLE_ICONDATABASE=0
272 endif
273
274 if ENABLE_COVERAGE
275 global_cppflags += \
276         -DGCC_GENERATE_TEST_COVERAGE_FILES \
277         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
278 endif
279
280 if ENABLE_VIDEO
281 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
282 endif
283
284 webkitgtk_cppflags += \
285 -I$(top_builddir)/WebKit/gtk/webkit \
286 -DBUILDING_CAIRO__=1 \
287 -DBUILD_WEBKIT
288
289 webkitgtk_h_api += \
290         WebKit/gtk/webkit/webkit.h \
291         WebKit/gtk/webkit/webkitdefines.h \
292         WebKit/gtk/webkit/webkitnetworkrequest.h \
293         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
294         WebKit/gtk/webkit/webkitwebframe.h \
295         WebKit/gtk/webkit/webkitwebhistoryitem.h \
296         WebKit/gtk/webkit/webkitwebsettings.h \
297         WebKit/gtk/webkit/webkitwebview.h
298
299 webkitgtk_built_sources += \
300         DerivedSources/webkit-marshal.h \
301         DerivedSources/webkit-marshal.cpp
302
303 webkitgtk_headers += \
304         WebKit/gtk/webkit/webkitprivate.h \
305         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
306         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
307         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
308         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
309         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
310         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
311         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
312
313 webkitgtk_sources += \
314         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
315         WebKit/gtk/webkit/webkitprivate.cpp \
316         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
317         WebKit/gtk/webkit/webkitwebframe.cpp \
318         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
319         WebKit/gtk/webkit/webkitwebsettings.cpp \
320         WebKit/gtk/webkit/webkitwebview.cpp \
321         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
322         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
323         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
324         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
325         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
326         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
327         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
328
329 webkitgtk_cleanfiles += \
330         $(top_builddir)/Programs/GtkLauncher \
331         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
332
333 pkgconfigdir = $(libdir)/pkgconfig
334 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
335
336 WEBKIT_MARSHAL = $(GENSOURCES)/webkit-marshal
337 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
338
339 stamp_files := \
340         stamp-webkit-marshal.cpp \
341         stamp-webkit-marshal.h
342
343 DerivedSources/webkit-marshal.cpp: stamp-webkit-marshal.cpp
344         @true
345
346 DerivedSources/webkit-marshal.h: stamp-webkit-marshal.h
347         @true
348
349 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
350         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
351         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
352         echo timestamp > $(@F)
353
354 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
355         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
356         echo timestamp > $(@F)
357
358 # END WEBKIT GTK+
359
360 # Files that will be cleaned
361 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
362 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
363 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
364
365 # Include module makefiles
366 include JavaScriptCore/GNUmakefile.am
367 include WebCore/GNUmakefile.am
368 include WebKitTools/GNUmakefile.am
369
370 # Autogenerated sources
371 BUILT_SOURCES = \
372         $(javascriptcore_built_sources) \
373         $(javascriptcore_built_nosources) \
374         $(webcore_built_sources) \
375         $(webcore_built_nosources) \
376         $(webkitgtk_built_sources) \
377         $(webkitgtk_built_nosources)
378
379 # Project-wide clean rules
380 CLEANFILES += \
381         $(webkitgtk_cleanfiles)
382
383 MAINTAINERCLEANFILES += \
384         $(srcdir)/aconfig.h.in \
385         configure \
386         config.* \
387         GNUmakefile.in \
388         INSTALL \
389         README
390
391 # remove built sources and program directories
392 clean-local:
393         -rm -rf $(GENSOURCES) $(GENPROGRAMS)