d3d74e0a57ce5c96646fb168812ffca1bdfd1b79
[framework/web/webkit-efl.git] / GNUmakefile.am
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 # _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
16 # 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.
19
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.
24
25 srcdir = @srcdir@
26 VPATH = @srcdir@
27
28 DISTCHECK_CONFIGURE_FLAGS = \
29         --enable-introspection  \
30         --enable-gtk-doc \
31         --enable-webkit2
32
33 # Directory for autogenerated sources
34 GENSOURCES := $(top_builddir)/DerivedSources
35 GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
36 GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
37 GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
38 GENSOURCES_WEBKIT2 := $(top_builddir)/DerivedSources/WebKit2
39 GENPROGRAMS := $(top_builddir)/Programs
40 GENSOURCES_INSPECTOR := $(GENPROGRAMS)/resources/inspector
41 WebCore := $(srcdir)/Source/WebCore
42 WebKit := $(srcdir)/Source/WebKit/gtk
43 WebKit2 := $(srcdir)/Source/WebKit2
44 pkgconfigdir := $(libdir)/pkgconfig
45 libwebkitgtkincludedir := $(prefix)/include/webkitgtk-@WEBKITGTK_API_VERSION@
46
47 # Libraries and support components
48 bin_PROGRAMS :=
49 noinst_PROGRAMS :=
50 libexec_PROGRAMS :=
51 noinst_HEADERS :=
52 noinst_LTLIBRARIES :=
53 lib_LTLIBRARIES :=
54 IDL_BINDINGS :=
55 TEST_PROGS :=
56 POFILES :=
57 MOFILES :=
58 javascriptcore_h_api :=
59 javascriptcore_cppflags:=
60 javascriptcore_cflags :=
61 javascriptcore_sources :=
62 javascriptcore_built_sources :=
63 javascriptcore_built_nosources :=
64 webcore_cppflags :=
65 webcore_sources :=
66 webcore_libadd :=
67 webcore_built_sources :=
68 webcore_built_nosources :=
69 webcoregtk_sources :=
70 webcoregtk_cppflags :=
71 webkitgtk_built_h_api :=
72 webkitgtk_static_h_api :=
73 webkitgtk_h_api :=
74 webkitgtk_sources :=
75 webkitgtk_cppflags :=
76 webkitgtk_gdom_built_sources :=
77 webkitgtk_built_sources :=
78 webkitgtk_built_nosources :=
79 webkit2_built_sources :=
80 webkit2_plugin_process_built_sources :=
81 webkittestrunner_built_sources :=
82 libwebcoreinternals_built_sources :=
83 global_cppflags :=
84 global_cflags :=
85 global_cxxflags :=
86 JSCORE_GIRSOURCES :=
87 WEBKIT_GIRSOURCES :=
88 FEATURE_DEFINES :=
89 typelibsdir :=
90 typelibs_DATA :=
91 EXTRA_DIST :=
92 BUILT_SOURCES :=
93 CLEANFILES :=
94 DOMAIN :=
95 DISTCLEANFILES :=
96 MAINTAINERCLEANFILES :=
97 pkgconfig_DATA :=
98
99 # We do not care at all about this implicit built-in make rules,
100 # disable them to save some build time
101 %: %.c
102 %: %.cpp
103 %: %.o
104 (%): %
105 %.out: %
106 %.c: %.w %.ch
107 %.tex: %.w %.ch
108 %:: %,v
109 %:: RCS/%,v
110 %:: RCS/%
111 %:: s.%
112 %:: SCCS/s.%
113
114 global_cppflags += \
115         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
116         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
117         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
118         -Wno-unused-parameter -Wno-parentheses \
119         -fno-exceptions -DENABLE_GLIB_SUPPORT=1
120
121 global_cxxflags += \
122         -fno-rtti
123
124 # -no-undefined required for building DLLs on Windows
125 # It breaks the build on other platforms, so we use it conditionally
126 if OS_WIN32
127 no_undefined = -no-undefined
128 version_script = -export-symbols-regex "^(webkit_|k?JS).*"
129 endif
130
131 if OS_GNU
132 version_script = -Wl,--version-script,$(srcdir)/Source/autotools/symbols.filter
133 endif
134
135 # Extra checks and flags
136 global_cppflags += \
137         -DBUILDING_CAIRO__=1 \
138         -DBUILDING_GTK__=1 \
139         -DWTF_CHANGES
140
141 # For the Gtk port we want to use XP_UNIX both in X11 and Mac
142 if !TARGET_WIN32
143 global_cppflags += \
144         -DXP_UNIX
145 endif
146
147 if USE_ICU_UNICODE
148 global_cppflags += \
149         -DWTF_USE_ICU_UNICODE=1
150 endif
151
152 if USE_GLIB_UNICODE
153 global_cppflags += \
154         -DWTF_USE_GLIB_UNICODE=1
155 endif
156
157 if !ENABLE_FAST_MALLOC
158 global_cppflags += \
159         -DUSE_SYSTEM_MALLOC
160 endif
161
162 if USE_GSTREAMER
163 global_cppflags += \
164         -DWTF_USE_GSTREAMER=1
165 endif
166
167 # ----
168 # GTK+ 2.x/3.x support
169 # ----
170 if GTK_API_VERSION_2
171 global_cppflags += \
172         -DGTK_API_VERSION_2=1
173 endif
174
175 if !ENABLE_DEBUG
176 global_cppflags += -DNDEBUG
177 else
178 global_cppflags += \
179         -DG_DISABLE_DEPRECATED \
180         -DGDK_PIXBUF_DISABLE_DEPRECATED \
181         -DGDK_DISABLE_DEPRECATED \
182         -DGTK_DISABLE_DEPRECATED \
183         -DPANGO_DISABLE_DEPRECATED
184 # Might be useful in the future
185 #       -DGDK_MULTIHEAD_SAFE \
186 #       -DGTK_MULTIHEAD_SAFE
187 endif
188
189 if ENABLE_COVERAGE
190 global_cppflags += \
191         -DGCC_GENERATE_TEST_COVERAGE_FILES \
192         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
193 endif
194
195 EXTRA_DIST += \
196         $(srcdir)/Source/autotools/symbols.filter \
197         $(srcdir)/Source/WebKit/LICENSE
198
199 # Include module makefiles
200 if USE_JSC
201 include Source/JavaScriptCore/GNUmakefile.am
202 endif
203
204 include Source/WebCore/GNUmakefile.am
205 include Source/WebKit/gtk/GNUmakefile.am
206 include Source/WebCore/bindings/gobject/GNUmakefile.am
207 include Tools/GNUmakefile.am
208 include Source/WebKit/gtk/po/GNUmakefile.am
209 include Tools/DumpRenderTree/gtk/GNUmakefile.ImageDiff.am
210
211 if ENABLE_WEBKIT2
212 include Source/WebKit2/GNUmakefile.am
213 include Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
214 include Tools/MiniBrowser/gtk/GNUmakefile.am
215 include Tools/WebKitTestRunner/GNUmakefile.am
216 # [GTK] Refactor the translations now that we have webkit2
217 # https://bugs.webkit.org/show_bug.cgi?id=55153
218 endif
219
220 # Autogenerated sources
221 BUILT_SOURCES += \
222         $(webcore_built_sources) \
223         $(webcore_built_nosources) \
224         $(webkitgtk_built_sources) \
225         $(webkitgtk_built_nosources)
226
227 if USE_JSC
228 BUILT_SOURCES += \
229         $(javascriptcore_built_sources) \
230         $(javascriptcore_built_nosources)
231 endif
232
233 DISTCLEANFILES += \
234         $(CLEANFILES) \
235         $(builddir)/doltcompile \
236         $(builddir)/doltlibtool
237
238 MAINTAINERCLEANFILES += \
239         $(CLEANFILES) \
240         $(builddir)/doltcompile \
241         $(builddir)/doltlibtool \
242         $(srcdir)/aconfig.h.in \
243         $(srcdir)/Source/autotools/config.* \
244         $(srcdir)/Source/autotools/compile \
245         $(srcdir)/Source/autotools/depcomp \
246         $(srcdir)/Source/autotools/install-sh \
247         $(srcdir)/Source/autotools/missing \
248         $(srcdir)/configure \
249         $(srcdir)/GNUmakefile.in \
250         $(srcdir)/INSTALL \
251         $(srcdir)/README \
252         $(top_builddir)/config.*
253
254 # Older automake versions (1.7) place Plo files in a different place so we need
255 # to create the output directory manually.
256 all-local: stamp-po
257         $(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
258
259 # remove built sources and program directories
260 clean-local:
261         -rm -rf $(GENPROGRAMS)
262
263 maintainer-clean-local: distclean-local
264 distclean-local:
265         -rm -rf $(GENSOURCES) $(GENPROGRAMS)
266
267 dist-hook: doc-dist-hook
268 doc-dist-hook: docs-build.stamp
269         cp $(WebKit)/NEWS $(distdir)
270         @mkdir -p $(distdir)/Documentation/webkitgtk/html
271         @mkdir -p $(distdir)/Documentation/webkitgtk/tmpl
272         @-cp ./Documentation/webkitgtk/tmpl/*.sgml $(distdir)/Documentation/webkitgtk/tmpl
273         @cp ./Documentation/webkitgtk/html/* $(distdir)/Documentation/webkitgtk/html
274 if ENABLE_WEBKIT2
275         @mkdir -p $(distdir)/Documentation/webkit2gtk/html
276         @mkdir -p $(distdir)/Documentation/webkit2gtk/tmpl
277         @-cp ./Documentation/webkit2gtk/tmpl/*.sgml $(distdir)/Documentation/webkit2gtk/tmpl
278         @cp ./Documentation/webkit2gtk/html/* $(distdir)/Documentation/webkit2gtk/html
279 endif