2007-12-27 Jan Michael Alonzo <jmalonzo@unpluggable.com>
[WebKit-https.git] / GNUmakefile.am
1 AUTOMAKE_OPTIONS = subdir-objects
2
3 srcdir = @srcdir@
4 VPATH = @srcdir@
5
6 # Directory for autogenerated sources
7 GENSOURCES := $(top_builddir)/DerivedSources
8
9 # Script for creating hash tables
10 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/kjs/create_hash_table
11
12 # Libraries and support components
13 noinst_LTLIBRARIES :=
14
15 noinst_HEADERS :=
16
17 noinst_PROGRAMS :=
18
19 lib_LIBRARIES :=
20
21 IDL_BINDINGS :=
22
23 # Files that will be distributed
24 EXTRA_DIST :=
25
26 #
27 # Global flags to CPP
28 global_cppflags := 
29
30 global_cppflags += \
31         -I $(srcdir)/JavaScriptCore \
32         -I $(srcdir)/JavaScriptCore/ForwardingHeaders \
33         -I $(srcdir)/JavaScriptCore/wtf \
34         -I $(srcdir)/JavaScriptCore/kjs \
35         -I $(top_builddir)/DerivedSources
36
37 # Default compiler flags
38 global_cflags := \
39         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
40         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
41         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
42         -Wno-unused-parameter -fno-exceptions -fno-strict-aliasing
43
44 # Libraries
45 lib_LTLIBRARIES = libJavaScriptCore.la libWebKitGtk.la
46
47 # JavaScriptCore
48
49 # Following are the variables we use in JavaScripCore/GNUmakefile.am
50 #
51 # javascriptcore_h_api - api headers to be included in the JSC library
52 # javascriptcore_cppflags - CPP flags for JSC
53 # javascriptcore_sources - source files to be included
54 # javascriptcore_built_sources - autogenerated sources and/or header files that are part of _SOURCES
55 # javascriptcore_built_nosources - same as above but not part of _SOURCES
56 #
57 # If you add or remove sources or header files, make sure you update the
58 # following variables in JavaScriptCore/GNUmakefile.am
59
60 javascriptcore_h_api :=
61 javascriptcore_cppflags:=
62 javascriptcore_sources :=
63 javascriptcore_built_sources := 
64 javascriptcore_built_nosources :=
65
66 # The variables above are already included below so we don't need to touch
67 # these variables too often
68 libJavaScriptCore_ladir = $(prefix)/include/WebKit/JavaScriptCore
69 libJavaScriptCore_la_HEADERS := $(javascriptcore_h_api)
70
71 libJavaScriptCore_la_SOURCES := \
72         $(javascriptcore_built_sources) \
73         $(javascriptcore_sources)
74
75 libJavaScriptCore_la_LDFLAGS := -lpthread
76
77 libJavaScriptCore_la_CXXFLAGS := $(global_cflags)
78
79 libJavaScriptCore_la_CFLAGS := $(global_cflags)
80
81 libJavaScriptCore_la_CPPFLAGS := $(global_cppflags) $(javascriptcore_cppflags)
82
83 # WebKitGtk 
84
85 # The Following variables have the same meaning as JSC, with addition of:
86 #
87 # webcore_sources - These are port-independent sources and header files
88 # webkitgtk_headers - header files that will be included in _SOURCES
89
90 webcore_sources :=
91 webkitgtk_h_api :=
92 webkitgtk_headers :=
93 webkitgtk_sources :=
94 webkitgtk_cppflags :=
95 webkitgtk_built_sources :=
96 webkitgtk_built_nosources :=
97
98 # No need to touch the following variables unless you have to. If you need to change the values
99 # for the following variables, use the "webkitgtk_" variables above
100 libWebKitGtk_ladir := $(prefix)/include/WebKit
101
102 libWebKitGtk_la_HEADERS := $(webkitgtk_h_api)
103
104 libWebKitGtk_la_SOURCES := \
105         $(webcore_sources) \
106         $(webkitgtk_built_sources) \
107         $(webkitgtk_headers) \
108         $(webkitgtk_sources)
109
110 libWebKitGtk_la_CXXFLAGS := \
111         -fno-rtti \
112         $(global_cflags) \
113         $(DEPENDENCIES_CFLAGS) \
114         $(ICU_CFLAGS) \
115         $(SQLITE3_CFLAGS) \
116         $(GSTREAMER_CFLAGS) \
117         $(LIBXSLT_CFLAGS) \
118         $(COVERAGE_CFLAGS)
119
120 libWebKitGtk_la_CFLAGS := \
121         $(global_cflags) \
122         $(DEPENDENCIES_CFLAGS) \
123         $(ICU_CFLAGS) \
124         $(SQLITE3_CFLAGS) \
125         $(GSTREAMER_CFLAGS) \
126         $(LIBXSLT_CFLAGS) \
127         $(COVERAGE_CFLAGS)
128
129 libWebKitGtk_la_CPPFLAGS := \
130         $(global_cppflags) \
131         $(webkitgtk_cppflags)
132
133 libWebKitGtk_la_LIBADD := @LTLIBOBJS@ libJavaScriptCore.la 
134
135 libWebKitGtk_la_LDFLAGS := \
136         $(DEPENDENCIES_LIBS) \
137         $(ICU_LIBS) \
138         $(SQLITE3_LIBS) \
139         $(GSTREAMER_LIBS) \
140         $(LIBXSLT_LIBS) \
141         $(COVERAGE_LDFLAGS)
142
143 libWebKitGtk_la_LDFLAGS += \
144         -lpthread \
145         -ljpeg \
146         -version-info @LIBWEBKITGTK_VERSION@
147
148 # Extra checks and flags
149
150 global_cppflags += \
151         -DBUILDING_GTK__=1 \
152         -DUSE_SYSTEM_MALLOC \
153         -DWTF_CHANGES
154
155 if !ENABLE_DEBUG
156 global_cppflags += -DNDEBUG
157 else 
158 webkitgtk_cppflags += \
159         -DG_DISABLE_DEPRECATED \
160         -DGDK_PIXBUF_DISABLE_DEPRECATED \
161         -DGDK_DISABLE_DEPRECATED \
162         -DGTK_DISABLE_DEPRECATED \
163         -DPANGO_DISABLE_DEPRECATED \
164         -DGDK_MULTIHEAD_SAFE \
165         -DGTK_MULTIHEAD_SAFE
166 endif
167
168 if TARGET_X11
169 global_cppflags += -DXP_UNIX
170 endif
171
172 if OS_LINUX
173 global_cppflags += -DHAVE_STDINT_H
174 endif
175
176 if OS_FREEBSD
177 global_cppflags += -DHAVE_PTHREAD_NP_H
178 endif
179
180 if ENABLE_COVERAGE
181 global_cppflags += \
182         -DGCC_GENERATE_TEST_COVERAGE_FILES \
183         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
184 endif
185
186 if ENABLE_VIDEO
187 libWebKitGtk_la_LDFLAGS += -lgstinterfaces-0.10 -lgstvideo-0.10
188 endif
189
190 # WebKit/GTK+ sources
191
192 webkitgtk_cppflags += \
193 -I $(top_builddir)/WebKit/gtk/WebView \
194 -DBUILDING_CAIRO__=1 \
195 -DBUILD_WEBKIT
196
197 webkitgtk_h_api += \
198         WebKit/gtk/WebView/webkit.h \
199         WebKit/gtk/WebView/webkitdefines.h \
200         WebKit/gtk/WebView/webkitnetworkrequest.h \
201         WebKit/gtk/WebView/webkitwebframe.h \
202         WebKit/gtk/WebView/webkitwebview.h 
203
204 webkitgtk_built_sources += \
205         WebKit/gtk/WebView/webkit-marshal.h \
206         WebKit/gtk/WebView/webkit-marshal.cpp
207
208 webkitgtk_headers += \
209         WebKit/gtk/WebView/webkitprivate.h \
210         WebKit/gtk/WebView/webkitsettings.h \
211         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
212         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
213         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
214         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
215         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
216         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
217         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h 
218
219 webkitgtk_sources += \
220         WebKit/gtk/WebView/webkitnetworkrequest.cpp \
221         WebKit/gtk/WebView/webkitprivate.cpp \
222         WebKit/gtk/WebView/webkitsettings.cpp \
223         WebKit/gtk/WebView/webkitwebframe.cpp \
224         WebKit/gtk/WebView/webkitwebview.cpp \
225         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
226         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
227         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
228         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
229         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
230         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
231         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp 
232
233 pkgconfigdir = $(libdir)/pkgconfig
234 pkgconfig_DATA = WebKit/gtk/WebKitGtk.pc
235
236 WEBKIT_MARSHAL = $(CURDIR)/WebKit/gtk/WebView/webkit-marshal
237 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/WebView/webkit-marshal.list
238
239 stamp_files := \
240         stamp-webkit-marshal.cpp \
241         stamp-webkit-marshal.h
242
243 WebKit/gtk/WebView/webkit-marshal.cpp: stamp-webkit-marshal.cpp
244         @true
245
246 WebKit/gtk/WebView/webkit-marshal.h: stamp-webkit-marshal.h
247         @true
248
249 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
250         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
251         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) \
252         --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
253         echo timestamp > $(@F)
254
255 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
256         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) \
257         --header > $(WEBKIT_MARSHAL).h && \
258         echo timestamp > $(@F)
259
260 # Autogenerated sources
261 BUILT_SOURCES := \
262         $(javascriptcore_built_sources) \
263         $(javascriptcore_built_nosources) \
264         $(webkitgtk_built_sources) \
265         $(webkitgtk_built_nosources)
266
267 # Files that will be cleaned
268 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
269 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
270 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
271
272 # Include module makefiles
273 include JavaScriptCore/GNUmakefile.am
274 include WebCore/GNUmakefile.am
275 include WebKitTools/GNUmakefile.am
276
277 # Project-wide clean rules
278 clean-local:
279         -rm -rf $(GENSOURCES)
280         -rm -f $(top_builddir)/Programs/GtkLauncher $(top_builddir)/Programs/DumpRenderTree
281         -rm -f $(top_builddir)/Programs/testkjs $(top_builddir)/Programs/dftables
282         -rm -f $(top_builddir/WebKit/gtk/WebKitGtk-1.0.pc
283
284 distclean-local:
285         -rm -f $(srcdir)/aconfig.h.in configure config.* GNUmakefile.in \
286                 INSTALL README
287