841e8bd6c486ba90e6c295d001517c6a3b054207
[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 endif
158
159 if TARGET_X11
160 global_cppflags += -DXP_UNIX
161 endif
162
163 if OS_LINUX
164 global_cppflags += -DHAVE_STDINT_H
165 endif
166
167 if OS_FREEBSD
168 global_cppflags += -DHAVE_PTHREAD_NP_H
169 endif
170
171 if ENABLE_COVERAGE
172 global_cppflags += \
173         -DGCC_GENERATE_TEST_COVERAGE_FILES \
174         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
175 endif
176
177 if ENABLE_VIDEO
178 libWebKitGtk_la_LDFLAGS += -lgstinterfaces-0.10 -lgstvideo-0.10
179 endif
180
181 # WebKit/GTK+ sources
182
183 webkitgtk_cppflags += \
184 -I $(top_builddir)/WebKit/gtk/WebView \
185 -DBUILDING_CAIRO__=1 \
186 -DBUILD_WEBKIT
187
188 webkitgtk_h_api += \
189         WebKit/gtk/WebView/webkit.h \
190         WebKit/gtk/WebView/webkitdefines.h \
191         WebKit/gtk/WebView/webkitnetworkrequest.h \
192         WebKit/gtk/WebView/webkitwebframe.h \
193         WebKit/gtk/WebView/webkitwebview.h 
194
195 webkitgtk_built_sources += \
196         WebKit/gtk/WebView/webkit-marshal.h \
197         WebKit/gtk/WebView/webkit-marshal.cpp
198
199 webkitgtk_headers += \
200         WebKit/gtk/WebView/webkitprivate.h \
201         WebKit/gtk/WebView/webkitsettings.h \
202         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
203         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
204         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
205         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
206         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
207         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
208         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h 
209
210 webkitgtk_sources += \
211         WebKit/gtk/WebView/webkitnetworkrequest.cpp \
212         WebKit/gtk/WebView/webkitprivate.cpp \
213         WebKit/gtk/WebView/webkitsettings.cpp \
214         WebKit/gtk/WebView/webkitwebframe.cpp \
215         WebKit/gtk/WebView/webkitwebview.cpp \
216         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
217         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
218         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
219         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
220         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
221         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
222         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp 
223
224 pkgconfigdir = $(libdir)/pkgconfig
225 pkgconfig_DATA = WebKit/gtk/WebKitGtk.pc
226
227 WEBKIT_MARSHAL = $(CURDIR)/WebKit/gtk/WebView/webkit-marshal
228 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/WebView/webkit-marshal.list
229
230 stamp_files := \
231         stamp-webkit-marshal.cpp \
232         stamp-webkit-marshal.h
233
234 WebKit/gtk/WebView/webkit-marshal.cpp: stamp-webkit-marshal.cpp
235         @true
236
237 WebKit/gtk/WebView/webkit-marshal.h: stamp-webkit-marshal.h
238         @true
239
240 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
241         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
242         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) \
243         --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
244         echo timestamp > $(@F)
245
246 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
247         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) \
248         --header > $(WEBKIT_MARSHAL).h && \
249         echo timestamp > $(@F)
250
251 # Autogenerated sources
252 BUILT_SOURCES := \
253         $(javascriptcore_built_sources) \
254         $(javascriptcore_built_nosources) \
255         $(webkitgtk_built_sources) \
256         $(webkitgtk_built_nosources)
257
258 # Files that will be cleaned
259 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
260 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
261 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
262
263 # Include module makefiles
264 include JavaScriptCore/GNUmakefile.am
265 include WebCore/GNUmakefile.am
266 include WebKitTools/GNUmakefile.am
267
268 # Project-wide clean rules
269 clean-local:
270         -rm -rf $(GENSOURCES)
271         -rm -f $(top_builddir)/Programs/GtkLauncher $(top_builddir)/Programs/DumpRenderTree
272         -rm -f $(top_builddir)/Programs/testkjs $(top_builddir)/Programs/dftables
273         -rm -f $(top_builddir/WebKit/gtk/WebKitGtk-1.0.pc
274
275 distclean-local:
276         -rm -f $(srcdir)/aconfig.h.in configure config.* GNUmakefile.in \
277                 INSTALL README
278