blob: 64f0b21cd98daf83a4766d7328a16d9d83b6c965 [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 \
30 --enable-gtk-doc
31
alp@webkit.org278f1252007-12-27 06:05:21 +000032# Directory for autogenerated sources
33GENSOURCES := $(top_builddir)/DerivedSources
mrobinson@webkit.orge53c0fb2010-07-02 16:53:06 +000034GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
35GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
36GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +000037GENSOURCES_WEBKIT2 := $(top_builddir)/DerivedSources/WebKit2
alp@webkit.orgc04fee22008-04-19 05:16:00 +000038GENPROGRAMS := $(top_builddir)/Programs
loislo@chromium.orga47f6722010-08-18 14:36:58 +000039GENSOURCES_INSPECTOR := $(GENPROGRAMS)/resources/inspector
abarth@webkit.org8ac7e152011-01-08 09:35:14 +000040WebCore := $(srcdir)/Source/WebCore
mrobinson@webkit.orgb6756222010-11-18 06:32:43 +000041WebKit := $(srcdir)/WebKit/gtk
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +000042WebKit2 := $(srcdir)/WebKit2
jmalonzo@webkit.orgc9b4de42009-05-18 11:30:53 +000043
alp@webkit.org278f1252007-12-27 06:05:21 +000044# Libraries and support components
alp@webkit.org643f3ef2008-06-15 11:46:18 +000045bin_PROGRAMS :=
alp@webkit.org278f1252007-12-27 06:05:21 +000046noinst_PROGRAMS :=
alp@webkit.org9388fc82008-08-10 18:21:21 +000047noinst_HEADERS :=
kov@webkit.org478f5952010-01-05 19:08:10 +000048noinst_LTLIBRARIES :=
xan@webkit.orgceeb8492010-06-28 13:58:42 +000049lib_LTLIBRARIES :=
alp@webkit.org278f1252007-12-27 06:05:21 +000050IDL_BINDINGS :=
jmalonzo@webkit.org27bbbab2009-03-20 19:45:05 +000051TEST_PROGS :=
kov@webkit.org774c23b2009-04-06 19:39:14 +000052POFILES :=
kov@webkit.org774c23b2009-04-06 19:39:14 +000053MOFILES :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000054javascriptcore_h_api :=
55javascriptcore_cppflags:=
56javascriptcore_sources :=
57javascriptcore_built_sources :=
58javascriptcore_built_nosources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000059webcore_cppflags :=
60webcore_sources :=
61webcore_libadd :=
62webcore_built_sources :=
63webcore_built_nosources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000064webcoregtk_sources :=
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +000065webcoregtk_cppflags :=
mrobinson@webkit.org65b62452010-07-26 21:32:18 +000066webkitgtk_built_h_api :=
67webkitgtk_static_h_api :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000068webkitgtk_h_api :=
69webkitgtk_sources :=
70webkitgtk_cppflags :=
mrobinson@webkit.org65b62452010-07-26 21:32:18 +000071webkitgtk_gdom_built_sources :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000072webkitgtk_built_sources :=
73webkitgtk_built_nosources :=
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +000074webkit2_built_sources :=
alp@webkit.org040ad8b2008-02-04 11:00:43 +000075global_cppflags :=
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +000076global_cflags :=
77global_cxxflags :=
kov@webkit.org60affd12009-11-30 15:13:44 +000078JSCORE_GIRSOURCES :=
kov@webkit.org2a1f73c2009-11-30 19:27:53 +000079WEBKIT_GIRSOURCES :=
mrobinson@webkit.orgf40bc4d2010-08-30 15:16:09 +000080FEATURE_DEFINES :=
kov@webkit.org2a1f73c2009-11-30 19:27:53 +000081typelibsdir :=
82typelibs_DATA :=
kov@webkit.org30bb9182009-10-26 20:16:59 +000083EXTRA_DIST :=
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +000084BUILT_SOURCES :=
85CLEANFILES :=
86DISTCLEANFILES :=
87MAINTAINERCLEANFILES :=
alp@webkit.org278f1252007-12-27 06:05:21 +000088
xan@webkit.orga0e3f5f2011-01-03 18:26:12 +000089# We do not care at all about this implicit built-in make rules,
90# disable them to save some build time
91%: %.c
92%: %.cpp
93%: %.o
94(%): %
95%.out: %
96%.c: %.w %.ch
97%.tex: %.w %.ch
98%:: %,v
99%:: RCS/%,v
100%:: RCS/%
101%:: s.%
102%:: SCCS/s.%
103
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +0000104global_cppflags += \
alp@webkit.org278f1252007-12-27 06:05:21 +0000105 -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
106 -Wformat -Wformat-security -Wno-format-y2k -Wundef \
107 -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
alp@webkit.org491d9092008-11-03 17:27:55 +0000108 -Wno-unused-parameter -Wno-parentheses \
philn@webkit.org0fe84032010-09-27 17:53:51 +0000109 -fno-exceptions -DENABLE_GLIB_SUPPORT=1
110
mrowe@apple.com84cdb082008-02-05 03:25:59 +0000111
jmalonzo@webkit.orga3327562009-05-18 11:30:06 +0000112global_cxxflags += \
alp@webkit.org491d9092008-11-03 17:27:55 +0000113 -fno-rtti
alp@webkit.org278f1252007-12-27 06:05:21 +0000114
alp@webkit.org15ef3c42008-06-03 00:30:19 +0000115# -no-undefined required for building DLLs on Windows
116# It breaks the build on other platforms, so we use it conditionally
117if OS_WIN32
xan@webkit.org0a818012009-05-13 13:49:06 +0000118no_undefined = -no-undefined
commit-queue@webkit.org395e6c62010-09-21 17:44:31 +0000119version_script = -export-symbols-regex "^(webkit_|k?JS).*"
alp@webkit.org15ef3c42008-06-03 00:30:19 +0000120endif
121
jmalonzo@webkit.orga897fea2008-09-24 07:42:51 +0000122if OS_GNU
abarth@webkit.orgc2a176a2011-01-02 02:04:41 +0000123version_script = -Wl,--version-script,$(srcdir)/Source/autotools/symbols.filter
jmalonzo@webkit.orga897fea2008-09-24 07:42:51 +0000124endif
125
alp@webkit.org36d65492008-01-13 07:33:53 +0000126# Convenience libraries
kov@webkit.org478f5952010-01-05 19:08:10 +0000127noinst_LTLIBRARIES += \
128 libJavaScriptCore.la
alp@webkit.org278f1252007-12-27 06:05:21 +0000129
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000130nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
alp@webkit.org81514942008-04-23 03:14:26 +0000131 $(javascriptcore_built_nosources)
132
133nodist_libJavaScriptCore_la_SOURCES = \
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000134 $(javascriptcore_built_sources)
135
xan@webkit.orgceeb8492010-06-28 13:58:42 +0000136libJavaScriptCore_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/JavaScriptCore
alp@webkit.org36d65492008-01-13 07:33:53 +0000137libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
alp@webkit.org278f1252007-12-27 06:05:21 +0000138
alp@webkit.org36d65492008-01-13 07:33:53 +0000139libJavaScriptCore_la_SOURCES = \
alp@webkit.org278f1252007-12-27 06:05:21 +0000140 $(javascriptcore_sources)
141
xan@webkit.org0a818012009-05-13 13:49:06 +0000142libJavaScriptCore_la_LIBADD = \
143 $(UNICODE_LIBS) \
144 $(GLIB_LIBS) \
145 -lpthread
146
darin@apple.com47e2c232008-02-24 05:42:29 +0000147libJavaScriptCore_la_CXXFLAGS = \
pewtermoose@webkit.org7a953d92008-02-24 07:07:03 +0000148 $(global_cxxflags) \
alp@webkit.org139345a2008-09-20 06:34:35 +0000149 $(libJavaScriptCore_la_CFLAGS)
alp@webkit.org278f1252007-12-27 06:05:21 +0000150
darin@apple.com47e2c232008-02-24 05:42:29 +0000151libJavaScriptCore_la_CFLAGS = \
alp@webkit.org2d181c52008-06-08 16:10:16 +0000152 -fstrict-aliasing \
153 -O3 \
pewtermoose@webkit.org7a953d92008-02-24 07:07:03 +0000154 $(global_cflags) \
jmalonzo@webkit.org06d65c102009-01-31 09:36:45 +0000155 $(GLIB_CFLAGS) \
alp@webkit.org2d181c52008-06-08 16:10:16 +0000156 $(UNICODE_CFLAGS)
alp@webkit.org278f1252007-12-27 06:05:21 +0000157
alp@webkit.orgf49bd1e2008-01-21 23:06:23 +0000158libJavaScriptCore_la_CPPFLAGS = \
159 $(global_cppflags) \
alp@webkit.orgd28cae02008-03-10 00:49:15 +0000160 $(javascriptcore_cppflags)
alp@webkit.org278f1252007-12-27 06:05:21 +0000161
alp@webkit.org278f1252007-12-27 06:05:21 +0000162# Extra checks and flags
alp@webkit.org278f1252007-12-27 06:05:21 +0000163global_cppflags += \
alp@webkit.orgf1dbca62008-06-02 16:36:32 +0000164 -DBUILDING_CAIRO__=1 \
alp@webkit.org278f1252007-12-27 06:05:21 +0000165 -DBUILDING_GTK__=1 \
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000166 -DWTF_CHANGES
167
168if USE_ICU_UNICODE
169global_cppflags += \
jmalonzo@webkit.org249f7ce2009-05-18 11:30:41 +0000170 -DWTF_USE_ICU_UNICODE=1
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000171endif
172
173if USE_GLIB_UNICODE
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000174global_cppflags += \
eric@webkit.org35236ae2010-03-04 15:03:16 +0000175 -DWTF_USE_GLIB_UNICODE=1
kov@webkit.orgeba9e742009-05-22 18:06:51 +0000176endif
alp@webkit.org278f1252007-12-27 06:05:21 +0000177
alp@webkit.org27f95c42008-01-12 07:40:52 +0000178if !ENABLE_FAST_MALLOC
179global_cppflags += \
180 -DUSE_SYSTEM_MALLOC
181endif
182
philn@webkit.orgf643ed62010-09-29 06:50:34 +0000183if USE_GSTREAMER
184global_cppflags += \
185 -DWTF_USE_GSTREAMER=1
186endif
187
xan@webkit.orgef9fcb92010-08-24 20:26:41 +0000188# ----
189# GTK+ 2.x/3.x support
190# ----
191if GTK_API_VERSION_2
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +0000192global_cppflags += \
xan@webkit.orgef9fcb92010-08-24 20:26:41 +0000193 -DGTK_API_VERSION_2=1
194endif
195
alp@webkit.org278f1252007-12-27 06:05:21 +0000196if !ENABLE_DEBUG
197global_cppflags += -DNDEBUG
alp@webkit.org040ad8b2008-02-04 11:00:43 +0000198else
mrobinson@webkit.org27bbef32010-08-26 16:16:10 +0000199global_cppflags += \
alp@webkit.org11a31a72007-12-27 23:14:27 +0000200 -DG_DISABLE_DEPRECATED \
201 -DGDK_PIXBUF_DISABLE_DEPRECATED \
202 -DGDK_DISABLE_DEPRECATED \
203 -DGTK_DISABLE_DEPRECATED \
xan@webkit.org5336ff82010-06-15 19:49:50 +0000204 -DPANGO_DISABLE_DEPRECATED
zecke@webkit.org48bc6f42008-01-03 02:07:28 +0000205# Might be useful in the future
206# -DGDK_MULTIHEAD_SAFE \
207# -DGTK_MULTIHEAD_SAFE
alp@webkit.org278f1252007-12-27 06:05:21 +0000208endif
209
alp@webkit.org278f1252007-12-27 06:05:21 +0000210if ENABLE_COVERAGE
211global_cppflags += \
212 -DGCC_GENERATE_TEST_COVERAGE_FILES \
213 -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
214endif
215
kov@webkit.org30bb9182009-10-26 20:16:59 +0000216EXTRA_DIST += \
abarth@webkit.orgc2a176a2011-01-02 02:04:41 +0000217 $(srcdir)/Source/autotools/symbols.filter \
mrobinson@webkit.orgb6756222010-11-18 06:32:43 +0000218 $(srcdir)/gtk-doc.make \
219 $(srcdir)/WebKit/LICENSE
alp@webkit.org278f1252007-12-27 06:05:21 +0000220
alp@webkit.org278f1252007-12-27 06:05:21 +0000221# Include module makefiles
abarth@webkit.org76da8fc2011-01-02 06:22:31 +0000222include Source/JavaScriptCore/GNUmakefile.am
abarth@webkit.org8ac7e152011-01-08 09:35:14 +0000223include Source/WebCore/GNUmakefile.am
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +0000224if ENABLE_WEBKIT2
225include WebKit2/GNUmakefile.am
226else
mrobinson@webkit.orgb6756222010-11-18 06:32:43 +0000227include WebKit/gtk/GNUmakefile.am
abarth@webkit.org8ac7e152011-01-08 09:35:14 +0000228include Source/WebCore/bindings/gobject/GNUmakefile.am
mitz@apple.com10955a5a2010-12-18 00:02:12 +0000229include Tools/GNUmakefile.am
kov@webkit.org774c23b2009-04-06 19:39:14 +0000230include WebKit/gtk/po/GNUmakefile.am
mrobinson@webkit.org59b9ac12010-12-29 23:46:42 +0000231endif
alp@webkit.org278f1252007-12-27 06:05:21 +0000232
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000233# Autogenerated sources
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000234BUILT_SOURCES += \
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000235 $(javascriptcore_built_sources) \
236 $(javascriptcore_built_nosources) \
237 $(webcore_built_sources) \
238 $(webcore_built_nosources) \
239 $(webkitgtk_built_sources) \
mrobinson@webkit.org65b62452010-07-26 21:32:18 +0000240 $(webkitgtk_built_nosources)
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000241
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000242DISTCLEANFILES += \
243 $(CLEANFILES) \
244 $(builddir)/doltcompile \
mrobinson@webkit.orgb6756222010-11-18 06:32:43 +0000245 $(builddir)/doltlibtool
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000246
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000247MAINTAINERCLEANFILES += \
jmalonzo@webkit.orgeff81ec2009-10-15 23:17:59 +0000248 $(CLEANFILES) \
249 $(builddir)/doltcompile \
250 $(builddir)/doltlibtool \
alp@webkit.orgf93619a2007-12-30 03:33:44 +0000251 $(srcdir)/aconfig.h.in \
abarth@webkit.orgc2a176a2011-01-02 02:04:41 +0000252 $(srcdir)/Source/autotools/config.* \
253 $(srcdir)/Source/autotools/compile \
254 $(srcdir)/Source/autotools/depcomp \
255 $(srcdir)/Source/autotools/install-sh \
256 $(srcdir)/Source/autotools/missing \
jmalonzo@webkit.org15d83302009-03-11 11:57:43 +0000257 $(srcdir)/configure \
258 $(srcdir)/GNUmakefile.in \
259 $(srcdir)/INSTALL \
260 $(srcdir)/README \
261 $(top_builddir)/config.*
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000262
alp@webkit.org76e7f9a2008-10-08 00:42:37 +0000263# Older automake versions (1.7) place Plo files in a different place so we need
264# to create the output directory manually.
mrobinson@webkit.orgb6756222010-11-18 06:32:43 +0000265all-local:
kov@webkit.org774c23b2009-04-06 19:39:14 +0000266 $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
alp@webkit.org76e7f9a2008-10-08 00:42:37 +0000267
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000268# remove built sources and program directories
269clean-local:
jmalonzo@webkit.org15d83302009-03-11 11:57:43 +0000270 -rm -rf $(GENPROGRAMS)
271
xan@webkit.org233d51e2009-03-14 20:22:13 +0000272maintainer-clean-local: distclean-local
xan@webkit.org233d51e2009-03-14 20:22:13 +0000273distclean-local:
alp@webkit.orgc04fee22008-04-19 05:16:00 +0000274 -rm -rf $(GENSOURCES) $(GENPROGRAMS)