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