blob: 97b99cb4906f6b09dc8cf0e62c148d90f8f8b5e5 [file] [log] [blame]
alp@webkit.orgf93619a2007-12-30 03:33:44 +00001# 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
alp@webkit.orgf93619a2007-12-30 03:33:44 +00008# _built_sources = files that will be autogenerated by the build system and
9# will be part of the _SOURCES primary
10# _built_nosources = files that are autogenerated but are not part of the
11# _SOURCES primary
12# _cleanfiles = files that will be removed by the clean target
13#
14# Sources, headers, flags, etc... should be added to the respective variables
15# with the above suffix, e.g, webcore-specific sources should go to
alp@webkit.orgf1dbca62008-06-02 16:36:32 +000016# webcore_sources, gtk port API and WebCoreSupport parts to webkitgtk_sources,
17# etc... The only exceptions are the global variables. See Global Variables
18# below.
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +000019
20# Global Variables Reference
21# global_cppflags = CPPFLAGS that apply to all C/C++ files that are built for any project.
22# global_cflags = CFLAGS that apply to all C files that are built for any project.
23# global_cxxflags = CXXFLAGS that apply to all C++ files that are bult for any project.
alp@webkit.org278f1252007-12-27 06:05:21 +000024
25srcdir = @srcdir@
26VPATH = @srcdir@
27
eric@webkit.orgb6dcd3f2009-11-10 01:12:00 +000028DISTCHECK_CONFIGURE_FLAGS = \
29 --enable-introspection \
alex@webkit.orge3137282011-10-26 17:45:31 +000030 --enable-gtk-doc \
31 --enable-webkit2
eric@webkit.orgb6dcd3f2009-11-10 01:12:00 +000032
alp@webkit.org278f1252007-12-27 06:05:21 +000033# Directory for autogenerated sources
34GENSOURCES := $(top_builddir)/DerivedSources
mrobinson@webkit.orge53c0fb2010-07-02 16:53:06 +000035GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
36GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
37GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +000038GENSOURCES_WEBKIT2 := $(top_builddir)/DerivedSources/WebKit2
alp@webkit.orgc04fee22008-04-19 05:16:00 +000039GENPROGRAMS := $(top_builddir)/Programs
loislo@chromium.orga47f6722010-08-18 14:36:58 +000040GENSOURCES_INSPECTOR := $(GENPROGRAMS)/resources/inspector
abarth@webkit.org8ac7e152011-01-08 09:35:14 +000041WebCore := $(srcdir)/Source/WebCore
abarth@webkit.orga5db5752011-01-17 05:02:09 +000042WebKit := $(srcdir)/Source/WebKit/gtk
abarth@webkit.orgbe159d92011-01-15 20:02:03 +000043WebKit2 := $(srcdir)/Source/WebKit2
carlosgc@webkit.orgeedf25e2011-08-03 07:43:44 +000044pkgconfigdir := $(libdir)/pkgconfig
carlosgc@webkit.org28f29832011-09-27 09:35:55 +000045libwebkitgtkincludedir := $(prefix)/include/webkitgtk-@WEBKITGTK_API_VERSION@
jmalonzo@webkit.orgc9b4de42009-05-18 11:30:53 +000046
alp@webkit.org278f1252007-12-27 06:05:21 +000047# Libraries and support components
alp@webkit.org643f3ef2008-06-15 11:46:18 +000048bin_PROGRAMS :=
alp@webkit.org278f1252007-12-27 06:05:21 +000049noinst_PROGRAMS :=
carlosgc@webkit.org4e17b162011-08-03 12:20:12 +000050libexec_PROGRAMS :=
alp@webkit.org9388fc82008-08-10 18:21:21 +000051noinst_HEADERS :=
kov@webkit.org478f5952010-01-05 19:08:10 +000052noinst_LTLIBRARIES :=
xan@webkit.orgceeb8492010-06-28 13:58:42 +000053lib_LTLIBRARIES :=
alp@webkit.org278f1252007-12-27 06:05:21 +000054IDL_BINDINGS :=
jmalonzo@webkit.org27bbbab2009-03-20 19:45:05 +000055TEST_PROGS :=
kov@webkit.org774c23b2009-04-06 19:39:14 +000056POFILES :=
commit-queue@webkit.orga43130b2012-03-02 23:10:32 +000057PO_LINGUAS :=
58USER_LINGUAS :=
59USE_LINGUAS :=
kov@webkit.org774c23b2009-04-06 19:39:14 +000060MOFILES :=
haraken@chromium.org5f99f4f2011-12-27 22:31:45 +000061dom_binding_idls :=
kov@webkit.orge6dee6c2012-01-06 14:25:39 +000062wtf_sources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000063javascriptcore_h_api :=
64javascriptcore_cppflags:=
carlosgc@webkit.org2a591002011-06-06 07:57:26 +000065javascriptcore_cflags :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000066javascriptcore_sources :=
67javascriptcore_built_sources :=
68javascriptcore_built_nosources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000069webcore_cppflags :=
kov@webkit.orgc34e0ed2012-03-20 03:22:34 +000070webcore_modules_sources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000071webcore_sources :=
72webcore_libadd :=
73webcore_built_sources :=
74webcore_built_nosources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000075webcoregtk_sources :=
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +000076webcoregtk_cppflags :=
mrobinson@webkit.org65b62452010-07-26 21:32:18 +000077webkitgtk_built_h_api :=
78webkitgtk_static_h_api :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000079webkitgtk_h_api :=
80webkitgtk_sources :=
81webkitgtk_cppflags :=
mrobinson@webkit.org65b62452010-07-26 21:32:18 +000082webkitgtk_gdom_built_sources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000083webkitgtk_built_sources :=
84webkitgtk_built_nosources :=
mrobinson@webkit.org20bd7d42012-02-22 18:56:40 +000085webkit2_sources :=
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +000086webkit2_built_sources :=
mrobinson@webkit.org20bd7d42012-02-22 18:56:40 +000087webkit2_plugin_process_sources :=
mrobinson@webkit.org26c1c9a2011-07-15 18:11:24 +000088webkit2_plugin_process_built_sources :=
89webkittestrunner_built_sources :=
mrobinson@webkit.orgae9b2b82011-06-06 20:18:58 +000090libwebcoreinternals_built_sources :=
carlosgc@webkit.orgcccb615e2012-01-02 14:56:35 +000091minibrowser_built_sources :=
alp@webkit.org040ad8b2008-02-04 11:00:43 +000092global_cppflags :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000093global_cflags :=
94global_cxxflags :=
kov@webkit.org60affd12009-11-30 15:13:44 +000095JSCORE_GIRSOURCES :=
kov@webkit.org2a1f73c2009-11-30 19:27:53 +000096WEBKIT_GIRSOURCES :=
mrobinson@webkit.orgf40bc4d2010-08-30 15:16:09 +000097FEATURE_DEFINES :=
kov@webkit.org2a1f73c2009-11-30 19:27:53 +000098typelibsdir :=
99typelibs_DATA :=
kov@webkit.org30bb9182009-10-26 20:16:59 +0000100EXTRA_DIST :=
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000101BUILT_SOURCES :=
102CLEANFILES :=
alex@webkit.orga3615432011-09-26 21:44:11 +0000103DOMAIN :=
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000104DISTCLEANFILES :=
105MAINTAINERCLEANFILES :=
carlosgc@webkit.orgeedf25e2011-08-03 07:43:44 +0000106pkgconfig_DATA :=
alp@webkit.org278f1252007-12-27 06:05:21 +0000107
xan@webkit.orga0e3f5f2011-01-03 18:26:12 +0000108# We do not care at all about this implicit built-in make rules,
109# disable them to save some build time
110%: %.c
111%: %.cpp
112%: %.o
113(%): %
114%.out: %
115%.c: %.w %.ch
116%.tex: %.w %.ch
117%:: %,v
118%:: RCS/%,v
119%:: RCS/%
120%:: s.%
121%:: SCCS/s.%
122
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +0000123global_cppflags += \
alp@webkit.org278f1252007-12-27 06:05:21 +0000124 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
125 -Wformat -Wformat-security -Wno-format-y2k -Wundef \
126 -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
alp@webkit.org491d9092008-11-03 17:27:55 +0000127 -Wno-unused-parameter -Wno-parentheses \
philn@webkit.org0fe84032010-09-27 17:53:51 +0000128 -fno-exceptions -DENABLE_GLIB_SUPPORT=1
129
mrowe@apple.com84cdb082008-02-05 03:25:59 +0000130
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +0000131global_cxxflags += \
alp@webkit.org491d9092008-11-03 17:27:55 +0000132 -fno-rtti
alp@webkit.org278f1252007-12-27 06:05:21 +0000133
alp@webkit.org15ef3c42008-06-03 00:30:19 +0000134# -no-undefined required for building DLLs on Windows
135# It breaks the build on other platforms, so we use it conditionally
136if OS_WIN32
xan@webkit.org0a818012009-05-13 13:49:06 +0000137no_undefined = -no-undefined
commit-queue@webkit.org395e6c62010-09-21 17:44:31 +0000138version_script = -export-symbols-regex "^(webkit_|k?JS).*"
alp@webkit.org15ef3c42008-06-03 00:30:19 +0000139endif
140
jmalonzo@webkit.orga897fea2008-09-24 07:42:51 +0000141if OS_GNU
abarth@webkit.orgc2a176a2011-01-02 02:04:41 +0000142version_script = -Wl,--version-script,$(srcdir)/Source/autotools/symbols.filter
jmalonzo@webkit.orga897fea2008-09-24 07:42:51 +0000143endif
144
alp@webkit.org278f1252007-12-27 06:05:21 +0000145# Extra checks and flags
alp@webkit.org278f1252007-12-27 06:05:21 +0000146global_cppflags += \
alp@webkit.orgf1dbca62008-06-02 16:36:32 +0000147 -DBUILDING_CAIRO__=1 \
alp@webkit.org278f1252007-12-27 06:05:21 +0000148 -DBUILDING_GTK__=1 \
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000149 -DWTF_CHANGES
150
carlosgc@webkit.org2f2682a2012-04-24 16:48:18 +0000151if ENABLE_WEBKIT2
152global_cppflags += \
153 -DBUILDING_WEBKIT2__=1
154endif
155
mrobinson@webkit.orgaaa95e82011-01-10 08:27:55 +0000156# For the Gtk port we want to use XP_UNIX both in X11 and Mac
157if !TARGET_WIN32
158global_cppflags += \
159 -DXP_UNIX
160endif
161
commit-queue@webkit.org581ea132012-04-23 05:30:39 +0000162# Add MOZ_X11 for X11 targets only
163if TARGET_X11
164global_cppflags += \
165 -DMOZ_X11
166endif
167
commit-queue@webkit.org868ef6b2012-02-04 22:24:01 +0000168# Use the wide character version of win32 API by default
169if TARGET_WIN32
170global_cppflags += \
171 -DUNICODE \
172 -D_UNICODE
173endif
174
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000175if USE_ICU_UNICODE
176global_cppflags += \
jmalonzo@webkit.org249f7ce2009-05-18 11:30:41 +0000177 -DWTF_USE_ICU_UNICODE=1
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000178endif
179
180if USE_GLIB_UNICODE
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000181global_cppflags += \
eric@webkit.org35236ae2010-03-04 15:03:16 +0000182 -DWTF_USE_GLIB_UNICODE=1
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000183endif
alp@webkit.org278f1252007-12-27 06:05:21 +0000184
alp@webkit.org27f95c42008-01-12 07:40:52 +0000185if !ENABLE_FAST_MALLOC
186global_cppflags += \
187 -DUSE_SYSTEM_MALLOC
188endif
189
philn@webkit.orgf643ed62010-09-29 06:50:34 +0000190if USE_GSTREAMER
191global_cppflags += \
192 -DWTF_USE_GSTREAMER=1
193endif
194
alex@webkit.org4e2e1882011-11-30 21:22:39 +0000195if USE_ACCELERATED_COMPOSITING
196global_cppflags += \
commit-queue@webkit.orgeb9d99e2012-01-09 15:08:42 +0000197 -DWTF_USE_ACCELERATED_COMPOSITING=1 \
198 -DENABLE_3D_RENDERING=1
alex@webkit.org4e2e1882011-11-30 21:22:39 +0000199endif
200
mrobinson@webkit.org870af862011-12-02 09:16:58 +0000201if USE_TEXTURE_MAPPER_CAIRO
202global_cppflags += \
mrobinson@webkit.org235d7e12012-02-07 04:41:08 +0000203 -DWTF_USE_TEXTURE_MAPPER=1 \
alex@webkit.orga1ef6f42011-12-02 16:16:07 +0000204 -DWTF_USE_TEXTURE_MAPPER_CAIRO=1
mrobinson@webkit.org870af862011-12-02 09:16:58 +0000205endif
206
207if USE_TEXTURE_MAPPER_GL
208global_cppflags += \
mrobinson@webkit.org235d7e12012-02-07 04:41:08 +0000209 -DWTF_USE_TEXTURE_MAPPER=1 \
commit-queue@webkit.org46b2a982011-12-29 01:25:47 +0000210 -DWTF_USE_TEXTURE_MAPPER_GL=1
mrobinson@webkit.org870af862011-12-02 09:16:58 +0000211endif
212
joone.hur@collabora.co.ukb412e932011-12-09 09:40:49 +0000213if USE_CLUTTER
214global_cppflags += \
215 -DWTF_USE_CLUTTER=1
216endif
217
mrobinson@webkit.org4d0a5852012-04-11 21:07:47 +0000218if USE_GLX
219global_cppflags += \
220 -DWTF_USE_GLX=1
221endif
222
223if USE_OPENGL
224global_cppflags += \
225 -DWTF_USE_OPENGL=1
226endif
227
xan@webkit.orgef9fcb92010-08-24 20:26:41 +0000228# ----
229# GTK+ 2.x/3.x support
230# ----
231if GTK_API_VERSION_2
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +0000232global_cppflags += \
xan@webkit.orgef9fcb92010-08-24 20:26:41 +0000233 -DGTK_API_VERSION_2=1
234endif
235
alp@webkit.org278f1252007-12-27 06:05:21 +0000236if !ENABLE_DEBUG
237global_cppflags += -DNDEBUG
alp@webkit.org040ad8b2008-02-04 11:00:43 +0000238else
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +0000239global_cppflags += \
alp@webkit.org11a31a72007-12-27 23:14:27 +0000240 -DGDK_PIXBUF_DISABLE_DEPRECATED \
241 -DGDK_DISABLE_DEPRECATED \
242 -DGTK_DISABLE_DEPRECATED \
xan@webkit.org5336ff82010-06-15 19:49:50 +0000243 -DPANGO_DISABLE_DEPRECATED
zecke@webkit.org48bc6f42008-01-03 02:07:28 +0000244# Might be useful in the future
245# -DGDK_MULTIHEAD_SAFE \
246# -DGTK_MULTIHEAD_SAFE
alp@webkit.org278f1252007-12-27 06:05:21 +0000247endif
248
alp@webkit.org278f1252007-12-27 06:05:21 +0000249if ENABLE_COVERAGE
250global_cppflags += \
251 -DGCC_GENERATE_TEST_COVERAGE_FILES \
252 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
253endif
254
kov@webkit.org30bb9182009-10-26 20:16:59 +0000255EXTRA_DIST += \
abarth@webkit.orgc2a176a2011-01-02 02:04:41 +0000256 $(srcdir)/Source/autotools/symbols.filter \
abarth@webkit.orga5db5752011-01-17 05:02:09 +0000257 $(srcdir)/Source/WebKit/LICENSE
alp@webkit.org278f1252007-12-27 06:05:21 +0000258
alp@webkit.org278f1252007-12-27 06:05:21 +0000259# Include module makefiles
kov@webkit.orge6dee6c2012-01-06 14:25:39 +0000260include Source/WTF/GNUmakefile.am
abarth@webkit.org76da8fc2011-01-02 06:22:31 +0000261include Source/JavaScriptCore/GNUmakefile.am
abarth@webkit.org8ac7e152011-01-08 09:35:14 +0000262include Source/WebCore/GNUmakefile.am
carlosgc@webkit.org4643e482011-05-03 09:53:26 +0000263include Source/WebKit/gtk/GNUmakefile.am
264include Source/WebCore/bindings/gobject/GNUmakefile.am
265include Tools/GNUmakefile.am
266include Source/WebKit/gtk/po/GNUmakefile.am
commit-queue@webkit.org9d027e42011-06-22 13:49:45 +0000267include Tools/DumpRenderTree/gtk/GNUmakefile.ImageDiff.am
268
abarth@webkit.orgbe159d92011-01-15 20:02:03 +0000269include Source/WebKit2/GNUmakefile.am
mrobinson@webkit.orgf9bfed42011-10-12 04:21:06 +0000270include Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
alex@webkit.org9ead80d2011-03-31 12:53:43 +0000271include Tools/MiniBrowser/gtk/GNUmakefile.am
mrobinson@webkit.org094d66e2011-05-31 23:35:34 +0000272include Tools/WebKitTestRunner/GNUmakefile.am
carlosgc@webkit.org2f2682a2012-04-24 16:48:18 +0000273include Source/ThirdParty/gtest/GNUmakefile.am
274include Tools/TestWebKitAPI/GNUmakefile.am
alex@webkit.orgb20f2982011-02-24 17:33:24 +0000275# [GTK] Refactor the translations now that we have webkit2
276# https://bugs.webkit.org/show_bug.cgi?id=55153
alp@webkit.org278f1252007-12-27 06:05:21 +0000277
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000278# Autogenerated sources
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000279BUILT_SOURCES += \
nayankk@motorola.com6c2a2792012-01-31 10:01:23 +0000280 $(javascriptcore_built_sources) \
281 $(javascriptcore_built_nosources) \
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000282 $(webcore_built_sources) \
283 $(webcore_built_nosources) \
284 $(webkitgtk_built_sources) \
mrobinson@webkit.org65b62452010-07-26 21:32:18 +0000285 $(webkitgtk_built_nosources)
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000286
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000287DISTCLEANFILES += \
288 $(CLEANFILES) \
289 $(builddir)/doltcompile \
mrobinson@webkit.orgb6756222010-11-18 06:32:43 +0000290 $(builddir)/doltlibtool
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000291
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000292MAINTAINERCLEANFILES += \
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000293 $(CLEANFILES) \
294 $(builddir)/doltcompile \
295 $(builddir)/doltlibtool \
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000296 $(srcdir)/aconfig.h.in \
abarth@webkit.orgc2a176a2011-01-02 02:04:41 +0000297 $(srcdir)/Source/autotools/config.* \
298 $(srcdir)/Source/autotools/compile \
299 $(srcdir)/Source/autotools/depcomp \
300 $(srcdir)/Source/autotools/install-sh \
301 $(srcdir)/Source/autotools/missing \
jmalonzo@webkit.org15d83302009-03-11 11:57:43 +0000302 $(srcdir)/configure \
303 $(srcdir)/GNUmakefile.in \
304 $(srcdir)/INSTALL \
305 $(srcdir)/README \
306 $(top_builddir)/config.*
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000307
alp@webkit.org76e7f9a2008-10-08 00:42:37 +0000308# Older automake versions (1.7) place Plo files in a different place so we need
309# to create the output directory manually.
christian@webkit.org01259772011-02-24 11:22:00 +0000310all-local: stamp-po
kov@webkit.org774c23b2009-04-06 19:39:14 +0000311 $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
alp@webkit.org76e7f9a2008-10-08 00:42:37 +0000312
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000313# remove built sources and program directories
314clean-local:
jmalonzo@webkit.org15d83302009-03-11 11:57:43 +0000315 -rm -rf $(GENPROGRAMS)
316
xan@webkit.org233d51e2009-03-14 20:22:13 +0000317maintainer-clean-local: distclean-local
xan@webkit.org233d51e2009-03-14 20:22:13 +0000318distclean-local:
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000319 -rm -rf $(GENSOURCES) $(GENPROGRAMS)
mrobinson@webkit.org150f9cf2011-11-25 16:19:44 +0000320
321dist-hook: doc-dist-hook
322doc-dist-hook: docs-build.stamp
323 cp $(WebKit)/NEWS $(distdir)
324 @mkdir -p $(distdir)/Documentation/webkitgtk/html
325 @mkdir -p $(distdir)/Documentation/webkitgtk/tmpl
326 @-cp ./Documentation/webkitgtk/tmpl/*.sgml $(distdir)/Documentation/webkitgtk/tmpl
327 @cp ./Documentation/webkitgtk/html/* $(distdir)/Documentation/webkitgtk/html
328if ENABLE_WEBKIT2
329 @mkdir -p $(distdir)/Documentation/webkit2gtk/html
330 @mkdir -p $(distdir)/Documentation/webkit2gtk/tmpl
331 @-cp ./Documentation/webkit2gtk/tmpl/*.sgml $(distdir)/Documentation/webkit2gtk/tmpl
332 @cp ./Documentation/webkit2gtk/html/* $(distdir)/Documentation/webkit2gtk/html
333endif