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