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