1#===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===#
2#
3#                     The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
7#
8#===------------------------------------------------------------------------===#
9#
10# This file is included by Makefile.common.  It defines paths and other
11# values specific to a particular installation of LLVM.
12#
13#===------------------------------------------------------------------------===#
14
15# Define LLVM specific info and directories based on the autoconf variables
16LLVMPackageName   := @PACKAGE_TARNAME@
17LLVMVersion       := @PACKAGE_VERSION@
18LLVM_VERSION_MAJOR := @LLVM_VERSION_MAJOR@
19LLVM_VERSION_MINOR := @LLVM_VERSION_MINOR@
20LLVM_VERSION_PATCH := @LLVM_VERSION_PATCH@
21LLVM_VERSION_SUFFIX := @LLVM_VERSION_SUFFIX@
22LLVM_CONFIGTIME   := @LLVM_CONFIGTIME@
23
24###########################################################################
25# Directory Configuration
26#	This section of the Makefile determines what is where.  To be
27#	specific, there are several locations that need to be defined:
28#
29#	o LLVM_SRC_ROOT  : The root directory of the LLVM source code.
30#	o LLVM_OBJ_ROOT  : The root directory containing the built LLVM code.
31#
32#	o PROJ_SRC_DIR  : The directory containing the code to build.
33#	o PROJ_SRC_ROOT : The root directory of the code to build.
34#
35#	o PROJ_OBJ_DIR  : The directory in which compiled code will be placed.
36#	o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
37#
38###########################################################################
39
40PWD := @BINPWD@
41# Set the project name to LLVM if its not defined
42ifndef PROJECT_NAME
43PROJECT_NAME := $(LLVMPackageName)
44endif
45
46# The macro below is expanded when 'realpath' is not built-in.
47# Built-in 'realpath' is available on GNU Make 3.81.
48realpath = $(shell cd $(1); $(PWD))
49
50PROJ_OBJ_DIR  := $(call realpath, .)
51PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL))
52
53CLANG_SRC_ROOT  := @CLANG_SRC_ROOT@
54
55ifeq ($(PROJECT_NAME),$(LLVMPackageName))
56LLVM_SRC_ROOT   := $(call realpath, @abs_top_srcdir@)
57LLVM_OBJ_ROOT   := $(call realpath, @abs_top_builddir@)
58PROJ_SRC_ROOT   := $(LLVM_SRC_ROOT)
59PROJ_SRC_DIR    := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))
60
61# See: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150323/268067.html
62ifeq ($(LLVM_SRC_ROOT), $(LLVM_OBJ_ROOT))
63  $(error In-source builds are not allowed. Please configure from a separate build directory!)
64endif
65
66ifneq ($(CLANG_SRC_ROOT),)
67  CLANG_SRC_ROOT:= $(call realpath, $(CLANG_SRC_ROOT))
68  PROJ_SRC_DIR  := $(patsubst $(LLVM_SRC_ROOT)/tools/clang%,$(CLANG_SRC_ROOT)%,$(PROJ_SRC_DIR))
69endif
70
71prefix          := @prefix@
72PROJ_prefix     := $(prefix)
73program_prefix  := @program_prefix@
74PROJ_VERSION    := $(LLVMVersion)
75else
76ifndef PROJ_SRC_ROOT
77$(error Projects must define PROJ_SRC_ROOT)
78endif
79ifndef PROJ_OBJ_ROOT
80$(error Projects must define PROJ_OBJ_ROOT)
81endif
82ifndef PROJ_INSTALL_ROOT
83$(error Projects must define PROJ_INSTALL_ROOT)
84endif
85ifndef LLVM_SRC_ROOT
86$(error Projects must define LLVM_SRC_ROOT)
87endif
88ifndef LLVM_OBJ_ROOT
89$(error Projects must define LLVM_OBJ_ROOT)
90endif
91PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
92prefix          := $(PROJ_INSTALL_ROOT)
93PROJ_prefix     := $(prefix)
94ifndef PROJ_VERSION
95PROJ_VERSION := 1.0
96endif
97endif
98
99INTERNAL_PREFIX := @INTERNAL_PREFIX@
100ifneq ($(INTERNAL_PREFIX),)
101PROJ_internal_prefix := $(INTERNAL_PREFIX)
102else
103PROJ_internal_prefix := $(prefix)
104endif
105
106PROJ_bindir     := $(PROJ_prefix)/bin
107PROJ_libdir     := $(PROJ_prefix)/lib
108PROJ_datadir    := $(PROJ_prefix)/share
109PROJ_docsdir    := $(PROJ_prefix)/docs/llvm
110PROJ_etcdir     := $(PROJ_prefix)/etc/llvm
111PROJ_includedir := $(PROJ_prefix)/include
112PROJ_infodir    := $(PROJ_prefix)/info
113PROJ_mandir     := $(PROJ_prefix)/share/man
114
115# Determine if we're on a unix type operating system
116LLVM_ON_UNIX:=@LLVM_ON_UNIX@
117LLVM_ON_WIN32:=@LLVM_ON_WIN32@
118
119# Host operating system for which LLVM will be run.
120OS=@OS@
121HOST_OS=@HOST_OS@
122# Target operating system for which LLVM will compile for.
123TARGET_OS=@TARGET_OS@
124
125# Host hardware architecture
126HOST_ARCH=@HOST_ARCH@
127# Target hardware architecture
128ARCH=@ARCH@
129TARGET_NATIVE_ARCH := $(ARCH)
130LLVM_NATIVE_ARCH := @LLVM_NATIVE_ARCH@
131
132# Indicates, whether we're cross-compiling LLVM or not
133LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@
134
135# Executable file extension for build platform (mainly for
136# tablegen call if we're cross-compiling).
137BUILD_EXEEXT=@BUILD_EXEEXT@
138
139# Compilers for the build platflorm (mainly for tablegen
140# call if we're cross-compiling).
141BUILD_CC=@BUILD_CC@
142BUILD_CXX=@BUILD_CXX@
143
144# Triple for configuring build tools when cross-compiling
145BUILD_TRIPLE=@build@
146
147# Target triple (cpu-vendor-os) which LLVM is compiled for
148HOST_TRIPLE=@host@
149
150# Target triple (cpu-vendor-os) for which we should generate code
151TARGET_TRIPLE=@target@
152
153# Extra options to compile LLVM with
154EXTRA_OPTIONS=@EXTRA_OPTIONS@
155
156# Extra options to link LLVM with
157EXTRA_LD_OPTIONS=@EXTRA_LD_OPTIONS@
158
159# Endian-ness of the target
160ENDIAN=@ENDIAN@
161
162# Path to the C++ compiler to use.  This is an optional setting, which defaults
163# to whatever your gmake defaults to.
164CXX = @CXX@
165
166# Path to the CC binary, which use used by testcases for native builds.
167CC := @CC@
168
169# C/C++ preprocessor flags.
170CPPFLAGS += @CPPFLAGS@
171
172# C compiler flags.
173CFLAGS += @CFLAGS@
174
175# C++ compiler flags.
176CXXFLAGS += @CXXFLAGS@
177
178# Linker flags.
179LDFLAGS += @LDFLAGS@
180
181# Path to the library archiver program.
182AR_PATH = @AR@
183AR = @AR@
184
185# Path to the nm program
186NM_PATH = @NM@
187
188# The pathnames of the programs we require to build
189CMP        := @CMP@
190CP         := @CP@
191DATE       := @DATE@
192FIND       := @FIND@
193GREP       := @GREP@
194INSTALL    := @INSTALL@
195MKDIR      := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
196MV         := @MV@
197RANLIB     := @RANLIB@
198RM         := @RM@
199SED        := @SED@
200TAR        := @TAR@
201PYTHON     := @PYTHON@
202
203# Paths to miscellaneous programs we hope are present but might not be
204BZIP2      := @BZIP2@
205CAT        := @CAT@
206DOT        := @DOT@
207DOXYGEN    := @DOXYGEN@
208GROFF      := @GROFF@
209GZIPBIN    := @GZIPBIN@
210GO         := @GO@
211OCAMLFIND  := @OCAMLFIND@
212GAS        := @GAS@
213POD2HTML   := @POD2HTML@
214POD2MAN    := @POD2MAN@
215PDFROFF    := @PDFROFF@
216ZIP        := @ZIP@
217
218HAVE_LIBZ  := @HAVE_LIBZ@
219HAVE_DLOPEN := @HAVE_DLOPEN@
220HAVE_PTHREAD := @HAVE_PTHREAD@
221HAVE_TERMINFO := @HAVE_TERMINFO@
222
223HAVE_OCAMLOPT := @HAVE_OCAMLOPT@
224HAVE_OCAML_OUNIT := @HAVE_OCAML_OUNIT@
225
226LIBS       := @LIBS@
227
228# Targets that are possible to build
229ALL_TARGETS := @ALL_TARGETS@
230
231# Targets that we should build
232TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
233
234# Targets supporting JIT
235TARGETS_WITH_JIT := @TARGETS_WITH_JIT@
236
237# Path to directory where object files should be stored during a build.
238# Set OBJ_ROOT to "." if you do not want to use a separate place for
239# object files.
240OBJ_ROOT := .
241
242# What to pass as rpath flag to g++
243RPATH := @RPATH@
244
245# What to pass as -rdynamic flag to g++
246RDYNAMIC := @RDYNAMIC@
247
248# These are options that can either be enabled here, or can be enabled on the
249# make command line (ie, make ENABLE_PROFILING=1):
250
251# When ENABLE_LIBCPP is enabled, LLVM uses libc++ by default to build.
252#ENABLE_LIBCPP = 0
253ENABLE_LIBCPP = @ENABLE_LIBCPP@
254
255# When ENABLE_CXX1Y is enabled, LLVM uses c++1y mode by default to build.
256# Otherwise it uses the baseline c++11.
257ENABLE_CXX1Y = @ENABLE_CXX1Y@
258
259# When ENABLE_SPLIT_DWARF is enabled, LLVM uses -gfission to build in debug mode.
260ENABLE_SPLIT_DWARF = @ENABLE_SPLIT_DWARF@
261
262# When enabled, clang will have plugin support.
263CLANG_PLUGIN_SUPPORT = @CLANG_PLUGIN_SUPPORT@
264
265# When ENABLE_CLANG_ARCMT is enabled, clang will have ARCMigrationTool.
266ENABLE_CLANG_ARCMT = @ENABLE_CLANG_ARCMT@
267
268# When ENABLE_CLANG_STATIC_ANALYZER is enabled, clang will have StaticAnalyzer.
269ENABLE_CLANG_STATIC_ANALYZER = @ENABLE_CLANG_STATIC_ANALYZER@
270
271# When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
272ENABLE_WERROR = @ENABLE_WERROR@
273
274# When ENABLE_TERMINFO is enabled, we use terminfo.
275ENABLE_TERMINFO = @ENABLE_TERMINFO@
276
277# When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
278# into the "Release" directories. Otherwise, LLVM code is not optimized and
279# output is put in the "Debug" directories.
280#ENABLE_OPTIMIZED = 1
281@ENABLE_OPTIMIZED@
282
283# When ENABLE_PROFILING is enabled, profile instrumentation is done
284# and output is put into the "<Flavor>+Profile" directories, where
285# <Flavor> is either Debug or Release depending on how other build
286# flags are set. Otherwise, output is put in the <Flavor>
287# directories.
288#ENABLE_PROFILING = 1
289@ENABLE_PROFILING@
290
291# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
292# exclude assertion checks, otherwise they are included.
293#DISABLE_ASSERTIONS = 1
294@DISABLE_ASSERTIONS@
295
296# When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
297# code will include expensive checks, otherwise they are excluded.
298#ENABLE_EXPENSIVE_CHECKS = 0
299@ENABLE_EXPENSIVE_CHECKS@
300
301# --enable-abi-breaking-checks : decide whether we should compile in asserts and
302# checks that make the build ABI incompatible with an llvm built without these
303# checks enabled.
304ENABLE_ABI_BREAKING_CHECKS = @ENABLE_ABI_BREAKING_CHECKS@
305
306# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
307# symbols.
308#DEBUG_RUNTIME = 1
309@DEBUG_RUNTIME@
310
311# When DEBUG_SYMBOLS is enabled, the compiler libraries will retain debug
312# symbols.
313#DEBUG_SYMBOLS = 1
314@DEBUG_SYMBOLS@
315
316# When KEEP_SYMBOLS is enabled, installed executables will never have their
317# symbols stripped.
318#KEEP_SYMBOLS = 1
319@KEEP_SYMBOLS@
320
321# The compiler flags to use for optimized builds.
322OPTIMIZE_OPTION := @OPTIMIZE_OPTION@
323
324# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
325# information to allow gprof to be used to get execution frequencies.
326#ENABLE_PROFILING = 1
327
328# When ENABLE_DOCS is disabled, docs/ will not be built.
329ENABLE_DOCS = @ENABLE_DOCS@
330
331# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
332ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
333
334# Do we want to enable threads?
335ENABLE_THREADS := @LLVM_ENABLE_THREADS@
336
337# Do we want to enable zlib?
338ENABLE_ZLIB := @LLVM_ENABLE_ZLIB@
339
340# Do we want to build with position independent code?
341ENABLE_PIC := @ENABLE_PIC@
342
343# Do we want to build a shared library and link the tools with it?
344ENABLE_SHARED := @ENABLE_SHARED@
345
346# Do we want to link the stdc++ into a shared library? (Cygming)
347ENABLE_EMBED_STDCXX := @ENABLE_EMBED_STDCXX@
348
349# Use -fvisibility-inlines-hidden?
350ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@
351
352# Do we want to allow timestamping information into builds?
353ENABLE_TIMESTAMPS := @ENABLE_TIMESTAMPS@
354
355# This option tells the Makefiles to produce verbose output.
356# It essentially prints the commands that make is executing
357#VERBOSE = 1
358
359# Enable JIT for this platform
360TARGET_HAS_JIT = @TARGET_HAS_JIT@
361
362# Shared library extension for host platform.
363SHLIBEXT = @SHLIBEXT@
364
365# Executable file extension for host platform.
366EXEEXT = @EXEEXT@
367
368# Things we just assume are "there"
369ECHO := echo
370
371# Get the options for causing archives to link all their content instead of
372# just missing symbols, and the inverse of that. This is used for certain LLVM
373# tools that permit loadable modules. It ensures that the LLVM symbols will be
374# available to those loadable modules.
375LINKALL := @LINKALL@
376NOLINKALL := @NOLINKALL@
377
378# Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending
379# on the check.
380HUGE_VAL_SANITY = @HUGE_VAL_SANITY@
381
382# Bindings that we should build
383BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
384OCAML_LIBDIR      := @OCAML_LIBDIR@
385
386# When compiling under Mingw/Cygwin, executables such as tblgen
387# expect Windows paths, whereas the build system uses Unix paths.
388# The function SYSPATH transforms Unix paths into Windows paths.
389ifneq (,$(findstring -mno-cygwin, $(CXX)))
390  SYSPATH = $(shell echo $(1) | cygpath -m -f -)
391else
392  SYSPATH = $(1)
393endif
394
395# Location of the plugin header file for gold.
396BINUTILS_INCDIR := @BINUTILS_INCDIR@
397
398# Optional flags supported by the compiler
399# -Wmissing-field-initializers
400MISSING_FIELD_INITIALIZERS = @MISSING_FIELD_INITIALIZERS@
401# -Wno-variadic-macros
402NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
403# -Wcovered-switch-default
404COVERED_SWITCH_DEFAULT = @COVERED_SWITCH_DEFAULT@
405# -Wno-uninitialized
406NO_UNINITIALIZED = @NO_UNINITIALIZED@
407# -Wno-maybe-uninitialized
408NO_MAYBE_UNINITIALIZED = @NO_MAYBE_UNINITIALIZED@
409# -Wno-comment
410NO_COMMENT = @NO_COMMENT@
411
412# Was polly found in tools/polly?
413LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
414# Flags supported by the linker.
415# bfd ld / gold --version-script=file
416HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@
417
418# Flags to control using libxml2
419LIBXML2_LIBS := @LIBXML2_LIBS@
420LIBXML2_INC  := @LIBXML2_INC@
421
422# Flags to control building support for Intel JIT Events API
423USE_INTEL_JITEVENTS := @USE_INTEL_JITEVENTS@
424INTEL_JITEVENTS_INCDIR := @INTEL_JITEVENTS_INCDIR@
425INTEL_JITEVENTS_LIBDIR := @INTEL_JITEVENTS_LIBDIR@
426
427# Flags to control building support for OProfile JIT API
428USE_OPROFILE := @USE_OPROFILE@
429
430ifeq ($(USE_INTEL_JITEVENTS), 1)
431  OPTIONAL_COMPONENTS += IntelJITEvents
432endif
433ifeq ($(USE_OPROFILE), 1)
434  OPTIONAL_COMPONENTS += OProfileJIT
435endif
436