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