1 #===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 # This file is included by all of the LLVM makefiles. For details on how to use
11 # it properly, please see the document MakefileGuide.html in the docs directory.
13 #===-----------------------------------------------------------------------====#
15 ################################################################################
16 # TARGETS: Define standard targets that can be invoked
17 ################################################################################
19 #--------------------------------------------------------------------
20 # Define the various target sets
21 #--------------------------------------------------------------------
22 RecursiveTargets := all clean clean-all install uninstall install-bytecode \
24 LocalTargets := all-local clean-local clean-all-local check-local \
25 install-local printvars uninstall-local \
26 install-bytecode-local
27 TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
29 UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
30 InternalTargets := preconditions distdir dist-hook
32 ################################################################################
33 # INITIALIZATION: Basic things the makefile needs
34 ################################################################################
36 #--------------------------------------------------------------------
37 # Set the VPATH so that we can find source files.
38 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Reset the list of suffixes we know how to build.
43 #--------------------------------------------------------------------
45 .SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm
46 .SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
48 #--------------------------------------------------------------------
49 # Mark all of these targets as phony to avoid implicit rule search
50 #--------------------------------------------------------------------
51 .PHONY: $(UserTargets) $(InternalTargets)
53 #--------------------------------------------------------------------
54 # Make sure all the user-target rules are double colon rules and
55 # they are defined first.
56 #--------------------------------------------------------------------
60 #------------------------------------------------------------------------
61 # LLVMBuild Integration
62 #------------------------------------------------------------------------
64 # We use llvm-build to generate all the data required by the Makefile based
65 # build system in one swoop:
67 # - We generate a file (a Makefile fragment) in the object root which contains
68 # all the definitions that are required by Makefiles across the entire
71 # - We generate the library table used by llvm-config.
73 # - We generate the dependencies for the Makefile fragment, so that we will
74 # automatically reconfigure outselves.
76 # The path to the llvm-build tool itself.
77 LLVMBuildTool := $(PROJ_SRC_ROOT)/utils/llvm-build/llvm-build
79 # The files we are going to generate using llvm-build.
80 LLVMBuildMakeFrag := $(PROJ_OBJ_ROOT)/Makefile.llvmbuild
81 LLVMConfigLibraryDependenciesInc := \
82 $(PROJ_OBJ_ROOT)/tools/llvm-config/LibraryDependencies.inc
84 # This is for temporary backwards compatibility.
85 ifndef TARGET_NATIVE_ARCH
86 TARGET_NATIVE_ARCH := $(ARCH)
89 # The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
92 # Note that this target gets its real dependencies generated for us by
95 # We include a dependency on this Makefile to ensure that changes to the
96 # generation command get picked up.
97 $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules \
98 $(PROJ_OBJ_ROOT)/Makefile.config
99 $(Echo) Constructing LLVMBuild project information.
100 $(Verb) $(LLVMBuildTool) \
101 --native-target "$(TARGET_NATIVE_ARCH)" \
102 --enable-targets "$(TARGETS_TO_BUILD)" \
103 --write-library-table $(LLVMConfigLibraryDependenciesInc) \
104 --write-make-fragment $(LLVMBuildMakeFrag)
106 # For completeness, let Make know how the extra files are generated.
107 $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
109 # Include the generated Makefile fragment.
111 # We currently only include the dependencies for the fragment itself if we are
112 # at the top-level. Otherwise, recursive invocations would ends up doing
113 # substantially more redundant stat'ing.
115 # This means that we won't properly regenerate things for developers used to
116 # building from a subdirectory, but that is always somewhat unreliable.
118 LLVMBUILD_INCLUDE_DEPENDENCIES := 1
120 -include $(LLVMBuildMakeFrag)
122 ################################################################################
123 # PRECONDITIONS: that which must be built/checked first
124 ################################################################################
126 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
127 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
128 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
129 ConfigureScript := $(PROJ_SRC_ROOT)/configure
130 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
131 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
132 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
133 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
134 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
135 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
136 ifneq ($(MakefileCommonIn),)
137 PreConditions += $(MakefileCommon)
140 ifneq ($(MakefileConfigIn),)
141 PreConditions += $(MakefileConfig)
144 preconditions: $(PreConditions)
146 #------------------------------------------------------------------------
147 # Make sure the BUILT_SOURCES are built first
148 #------------------------------------------------------------------------
149 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
152 ifneq ($(strip $(BUILT_SOURCES)),)
153 -$(Verb) $(RM) -f $(BUILT_SOURCES)
156 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
158 $(Verb) if test -x config.status ; then \
159 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
160 $(MKDIR) .spotless.save ; \
161 $(MV) config.status .spotless.save ; \
162 $(MV) mklib .spotless.save ; \
163 $(MV) projects .spotless.save ; \
165 $(MV) .spotless.save/config.status . ; \
166 $(MV) .spotless.save/mklib . ; \
167 $(MV) .spotless.save/projects . ; \
168 $(RM) -rf .spotless.save ; \
169 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
170 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
171 $(ConfigStatusScript) ; \
173 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
177 $(EchoCmd) "spotless target not supported for objdir == srcdir"
180 $(BUILT_SOURCES) : $(ObjMakefiles)
182 #------------------------------------------------------------------------
183 # Make sure we're not using a stale configuration
184 #------------------------------------------------------------------------
186 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
187 $(Verb) cd $(PROJ_OBJ_ROOT) && \
188 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
189 $(ConfigStatusScript)
191 .PRECIOUS: $(ConfigStatusScript)
192 $(ConfigStatusScript): $(ConfigureScript)
193 $(Echo) Reconfiguring with $<
194 $(Verb) cd $(PROJ_OBJ_ROOT) && \
195 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
196 $(ConfigStatusScript)
198 #------------------------------------------------------------------------
199 # Make sure the configuration makefile is up to date
200 #------------------------------------------------------------------------
201 ifneq ($(MakefileConfigIn),)
202 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
203 $(Echo) Regenerating $@
204 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
207 ifneq ($(MakefileCommonIn),)
208 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
209 $(Echo) Regenerating $@
210 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
213 #------------------------------------------------------------------------
214 # If the Makefile in the source tree has been updated, copy it over into the
215 # build tree. But, only do this if the source and object makefiles differ
216 #------------------------------------------------------------------------
218 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
221 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
223 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
224 $(Echo) "Updating Makefile"
225 $(Verb) $(MKDIR) $(@D)
226 $(Verb) $(CP) -f $< $@
228 # Copy the Makefile.* files unless we're in the root directory which avoids
229 # the copying of Makefile.config.in or other things that should be explicitly
231 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
233 *Makefile.rules) ;; \
235 *) $(EchoCmd) "Updating $(@F)" ; \
242 #------------------------------------------------------------------------
243 # Set up the basic dependencies
244 #------------------------------------------------------------------------
245 $(UserTargets):: $(PreConditions)
249 clean-all:: clean-local clean-all-local
250 install:: install-local
251 uninstall:: uninstall-local
252 install-local:: all-local
253 install-bytecode:: install-bytecode-local
255 ###############################################################################
256 # VARIABLES: Set up various variables based on configuration data
257 ###############################################################################
259 # Variable for if this make is for a "cleaning" target
260 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
264 #--------------------------------------------------------------------
265 # Variables derived from configuration we are building
266 #--------------------------------------------------------------------
269 ifeq ($(ENABLE_OPTIMIZED),1)
271 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
272 ifneq ($(HOST_OS),FreeBSD)
273 ifneq ($(HOST_OS),Darwin)
274 OmitFramePointer := -fomit-frame-pointer
278 # Darwin requires -fstrict-aliasing to be explicitly enabled.
279 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
280 # with -fstrict-aliasing and ipa-type-escape radr://6756684
281 #ifeq ($(HOST_OS),Darwin)
282 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
284 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
285 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
286 LD.Flags += $(OPTIMIZE_OPTION)
288 BuildMode := $(BuildMode)+Debug
295 ifdef NO_DEBUG_SYMBOLS
296 BuildMode := Unoptimized
310 ifeq ($(ENABLE_LIBCPP),1)
311 CXX.Flags += -stdlib=libc++
312 LD.Flags += -stdlib=libc++
315 ifeq ($(ENABLE_PROFILING),1)
316 BuildMode := $(BuildMode)+Profile
317 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
318 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
319 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
323 ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
324 CXX.Flags += -fvisibility-inlines-hidden
327 ifdef ENABLE_EXPENSIVE_CHECKS
328 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
329 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
333 # IF REQUIRES_EH=1 is specified then don't disable exceptions
335 CXX.Flags += -fno-exceptions
337 # If the library requires EH, it also requires RTTI.
341 ifdef REQUIRES_FRAME_POINTER
342 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
343 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
344 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
347 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
348 ifneq ($(REQUIRES_RTTI), 1)
349 CXX.Flags += -fno-rtti
352 ifeq ($(ENABLE_COVERAGE),1)
353 BuildMode := $(BuildMode)+Coverage
354 CXX.Flags += -ftest-coverage -fprofile-arcs
355 C.Flags += -ftest-coverage -fprofile-arcs
358 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
359 # then disable assertions by defining the appropriate preprocessor symbols.
360 ifeq ($(DISABLE_ASSERTIONS),1)
361 CPP.Defines += -DNDEBUG
363 BuildMode := $(BuildMode)+Asserts
364 CPP.Defines += -D_DEBUG
367 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
368 # configured), then enable expensive checks by defining the
369 # appropriate preprocessor symbols.
370 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
371 BuildMode := $(BuildMode)+Checks
372 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
375 # LOADABLE_MODULE implies several other things so we force them to be
377 ifdef LOADABLE_MODULE
379 LINK_LIBS_IN_SHARED := 1
387 ifeq ($(ENABLE_PIC),1)
388 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
389 # Nothing. Win32 defaults to PIC and warns when given -fPIC
391 ifeq ($(HOST_OS),Darwin)
392 # Common symbols not allowed in dylib files
393 CXX.Flags += -fno-common
394 C.Flags += -fno-common
396 # Linux and others; pass -fPIC
402 ifeq ($(HOST_OS),Darwin)
403 CXX.Flags += -mdynamic-no-pic
404 C.Flags += -mdynamic-no-pic
408 # Support makefile variable to disable any kind of timestamp/non-deterministic
409 # info from being used in the build.
410 ifeq ($(ENABLE_TIMESTAMPS),1)
411 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
413 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
416 ifeq ($(HOST_OS),MingW)
418 CPP.Defines += -D__NO_CTYPE_INLINE
419 ifeq ($(LLVM_CROSS_COMPILING),1)
420 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
422 LD.Flags += -Wl,--allow-multiple-definition
427 CXX.Flags += -Woverloaded-virtual
428 CPP.BaseFlags += $(CPP.Defines)
431 # Make Floating point IEEE compliant on Alpha.
434 CPP.BaseFlags += -mieee
435 ifeq ($(ENABLE_PIC),0)
437 CPP.BaseFlags += -fPIC
440 LD.Flags += -Wl,--no-relax
443 # GNU ld/PECOFF accepts but ignores them below;
447 # FIXME: autoconf should be aware of them.
448 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
449 HAVE_LINK_VERSION_SCRIPT := 0
451 RDYNAMIC := -Wl,--export-all-symbols
454 #--------------------------------------------------------------------
455 # Directory locations
456 #--------------------------------------------------------------------
458 ifeq ($(LLVM_CROSS_COMPILING),1)
459 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
462 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
463 ObjDir := $(ObjRootDir)
464 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
465 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
466 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
467 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
468 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
469 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
471 #--------------------------------------------------------------------
472 # Locations of shared libraries
473 #--------------------------------------------------------------------
476 SharedLibDir := $(LibDir)
477 LLVMSharedLibDir := $(LLVMLibDir)
479 # Win32.DLL prefers to be located on the "PATH" of binaries.
480 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
481 SharedLibDir := $(ToolDir)
482 LLVMSharedLibDir := $(LLVMToolDir)
484 ifeq ($(HOST_OS),Cygwin)
491 #--------------------------------------------------------------------
492 # LLVM Capable Compiler
493 #--------------------------------------------------------------------
495 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
497 LLVMCXX := $(LLVMGXX)
499 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
500 ifneq ($(CLANGPATH),)
501 LLVMCC := $(CLANGPATH)
502 LLVMCXX := $(CLANGXXPATH)
504 ifeq ($(ENABLE_BUILT_CLANG),1)
505 LLVMCC := $(LLVMToolDir)/clang
506 LLVMCXX := $(LLVMToolDir)/clang++
512 #--------------------------------------------------------------------
513 # Full Paths To Compiled Tools and Utilities
514 #--------------------------------------------------------------------
515 EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
516 ifdef BUILD_DIRS_ONLY
517 EchoCmd := $(EchoCmd) "(build tools)":
522 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
525 ifeq ($(LLVM_CROSS_COMPILING),1)
526 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
528 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
531 ifeq ($(LLVM_CROSS_COMPILING),1)
532 LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config$(BUILD_EXEEXT)
534 LLVM_CONFIG := $(LLVMToolDir)/llvm-config$(EXEEXT)
537 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
540 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
543 LLI := $(LLVMToolDir)/lli$(EXEEXT)
546 LLC := $(LLVMToolDir)/llc$(EXEEXT)
549 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
552 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
555 #--------------------------------------------------------------------
556 # Adjust to user's request
557 #--------------------------------------------------------------------
559 ifeq ($(HOST_OS),Darwin)
560 DARWIN_VERSION := `sw_vers -productVersion`
561 # Strip a number like 10.4.7 to 10.4
562 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
563 # Get "4" out of 10.4 for later pieces in the makefile.
564 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
566 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
567 SharedLinkOptions := -dynamiclib
569 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
572 SharedLinkOptions=-shared
575 ifeq ($(TARGET_OS),Darwin)
577 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
582 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
583 ifneq ($(HOST_OS),Darwin)
584 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
596 # Adjust settings for verbose mode
599 AR.Flags += >/dev/null 2>/dev/null
600 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
602 ConfigureScriptFLAGS :=
605 # By default, strip symbol information from executable
607 Strip := $(PLATFORMSTRIPOPTS)
608 StripWarnMsg := "(without symbols)"
609 Install.StripFlag += -s
612 ifdef TOOL_NO_EXPORTS
615 DynamicFlag := $(RDYNAMIC)
618 # Adjust linker flags for building an executable
619 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
620 ifneq ($(HOST_OS), Darwin)
622 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
624 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
626 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
630 ifneq ($(DARWIN_MAJVERS),4)
631 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
637 #----------------------------------------------------------
638 # Options To Invoke Tools
639 #----------------------------------------------------------
641 ifdef EXTRA_LD_OPTIONS
642 LD.Flags += $(EXTRA_LD_OPTIONS)
646 CompileCommonOpts += -pedantic -Wno-long-long
648 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
650 # Enable cast-qual for C++; the workaround is to use const_cast.
651 CXX.Flags += -Wcast-qual
653 ifeq ($(HOST_OS),HP-UX)
654 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
657 # If we are building a universal binary on Mac OS/X, pass extra options. This
658 # is useful to people that want to link the LLVM libraries into their universal
661 # The following can be optionally specified:
662 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
663 # For Mac OS/X 10.4 Intel machines, the traditional one is:
664 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
665 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
666 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
669 ifndef UNIVERSAL_ARCH
670 UNIVERSAL_ARCH := i386 ppc
672 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
673 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
674 ifdef UNIVERSAL_SDK_PATH
675 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
678 # Building universal cannot compute dependencies automatically.
679 DISABLE_AUTO_DEPENDENCIES=1
681 ifeq ($(TARGET_OS),Darwin)
682 ifeq ($(ARCH),x86_64)
683 TargetCommonOpts = -m64
686 TargetCommonOpts = -m32
692 ifeq ($(HOST_OS),SunOS)
693 CPP.BaseFlags += -include llvm/Support/Solaris.h
696 ifeq ($(HOST_OS),AuroraUX)
697 CPP.BaseFlags += -include llvm/Support/Solaris.h
698 endif # !HOST_OS - AuroraUX.
700 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
701 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
702 # All -I flags should go here, so that they don't confuse llvm-config.
703 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
704 $(patsubst %,-I%/include,\
705 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
706 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
709 ifeq ($(INCLUDE_BUILD_DIR),1)
710 CPP.Flags += -I$(ObjDir)
713 # SHOW_DIAGNOSTICS support.
714 ifeq ($(SHOW_DIAGNOSTICS),1)
715 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
716 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
721 Compile.C = $(Compile.Wrapper) \
722 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
723 $(TargetCommonOpts) $(CompileCommonOpts) -c
724 Compile.CXX = $(Compile.Wrapper) \
725 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
726 $(TargetCommonOpts) $(CompileCommonOpts) -c
727 Preprocess.CXX= $(Compile.Wrapper) \
728 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
729 $(CompileCommonOpts) $(CXX.Flags) -E
730 Link = $(Compile.Wrapper) \
731 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
732 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
734 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
735 $(TargetCommonOpts) $(CompileCommonOpts)
736 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
737 $(TargetCommonOpts) $(CompileCommonOpts) -E
739 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
740 $(TargetCommonOpts) $(CompileCommonOpts)
742 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
743 ScriptInstall = $(INSTALL) -m 0755
744 DataInstall = $(INSTALL) -m 0644
746 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
747 # paths. In this case, the SYSPATH function (defined in
748 # Makefile.config) transforms Unix paths into Windows paths.
749 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
750 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
751 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
752 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
753 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
755 Archive = $(AR) $(AR.Flags)
756 LArchive = $(LLVMToolDir)/llvm-ar rcsf
765 #----------------------------------------------------------
766 # Get the list of source files and compute object file
768 #----------------------------------------------------------
771 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
772 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
774 Sources := $(SOURCES)
778 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
781 BaseNameSources := $(sort $(basename $(Sources)))
783 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
784 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
786 #----------------------------------------------------------
787 # For Mingw MSYS bash and Python/w32:
789 # $(ECHOPATH) prints DOSish pathstring.
790 # ex) $(ECHOPATH) /include/sys/types.h
791 # --> C:/mingw/include/sys/types.h
792 # built-in "echo" does not transform path to DOSish path.
794 # FIXME: It would not be needed when MSYS's python
796 #----------------------------------------------------------
798 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
799 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
801 ECHOPATH := $(Verb)$(ECHO)
804 ###############################################################################
805 # DIRECTORIES: Handle recursive descent of directory structure
806 ###############################################################################
808 #---------------------------------------------------------
809 # Provide rules to make install dirs. This must be early
810 # in the file so they get built before dependencies
811 #---------------------------------------------------------
813 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
816 # To create other directories, as needed, and timestamp their creation
818 $(Verb) $(MKDIR) $* > /dev/null
819 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
821 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
822 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
824 #---------------------------------------------------------
825 # Handle the DIRS options for sequential construction
826 #---------------------------------------------------------
832 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
833 $(RecursiveTargets)::
834 $(Verb) for dir in $(DIRS); do \
835 if ([ ! -f $$dir/Makefile ] || \
836 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
838 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
840 ($(MAKE) -C $$dir $@ ) || exit 1; \
843 $(RecursiveTargets)::
844 $(Verb) for dir in $(DIRS); do \
845 ($(MAKE) -C $$dir $@ ) || exit 1; \
851 #---------------------------------------------------------
852 # Handle the EXPERIMENTAL_DIRS options ensuring success
853 # after each directory is built.
854 #---------------------------------------------------------
855 ifdef EXPERIMENTAL_DIRS
856 $(RecursiveTargets)::
857 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
858 if ([ ! -f $$dir/Makefile ] || \
859 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
861 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
863 ($(MAKE) -C $$dir $@ ) || exit 0; \
867 #-----------------------------------------------------------
868 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
869 #-----------------------------------------------------------
870 ifdef OPTIONAL_PARALLEL_DIRS
871 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
874 #-----------------------------------------------------------
875 # Handle the PARALLEL_DIRS options for parallel construction
876 #-----------------------------------------------------------
879 SubDirs += $(PARALLEL_DIRS)
881 # Unfortunately, this list must be maintained if new recursive targets are added
882 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
883 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
884 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
885 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
886 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
887 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
888 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
890 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
894 SD=$(PROJ_SRC_DIR)/$(@D); \
896 if [ ! -f $$SD/Makefile ]; then \
898 DD=$(notdir $(@D)); \
900 if ([ ! -f $$DD/Makefile ] || \
901 command test $$DD/Makefile -ot \
902 $$SD/Makefile ); then \
904 $(CP) $$SD/Makefile $$DD/Makefile; \
906 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
909 #---------------------------------------------------------
910 # Handle the OPTIONAL_DIRS options for directores that may
912 #---------------------------------------------------------
915 SubDirs += $(OPTIONAL_DIRS)
917 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
918 $(RecursiveTargets)::
919 $(Verb) for dir in $(OPTIONAL_DIRS); do \
920 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
921 if ([ ! -f $$dir/Makefile ] || \
922 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
924 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
926 ($(MAKE) -C$$dir $@ ) || exit 1; \
930 $(RecursiveTargets)::
931 $(Verb) for dir in $(OPTIONAL_DIRS); do \
932 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
933 ($(MAKE) -C$$dir $@ ) || exit 1; \
939 #---------------------------------------------------------
940 # Handle the CONFIG_FILES options
941 #---------------------------------------------------------
946 $(Echo) Install circumvented with NO_INSTALL
948 $(Echo) UnInstall circumvented with NO_INSTALL
950 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
951 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
952 $(Verb)for file in $(CONFIG_FILES); do \
953 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
954 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
955 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
956 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
958 $(ECHO) Error: cannot find config file $${file}. ; \
963 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
964 $(Verb)for file in $(CONFIG_FILES); do \
965 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
971 ###############################################################################
972 # Set up variables for building libraries
973 ###############################################################################
975 #---------------------------------------------------------
976 # Define various command line options pertaining to the
977 # libraries needed when linking. There are "Proj" libs
978 # (defined by the user's project) and "LLVM" libs (defined
979 # by the LLVM project).
980 #---------------------------------------------------------
983 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
984 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
985 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
986 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
990 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
991 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
992 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
993 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
996 # Loadable module for Win32 requires all symbols resolved for linking.
997 # Then all symbols in LLVM.dll will be available.
998 ifeq ($(ENABLE_SHARED),1)
999 ifdef LOADABLE_MODULE
1000 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
1001 LINK_COMPONENTS += all
1006 ifndef IS_CLEANING_TARGET
1007 ifdef LINK_COMPONENTS
1009 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1010 # clean in tools, then do a make in tools (instead of at the top level).
1012 @echo "*** llvm-config doesn't exist - rebuilding it."
1013 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1015 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1017 ifeq ($(ENABLE_SHARED), 1)
1018 # We can take the "auto-import" feature to get rid of using dllimport.
1019 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1020 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1023 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1024 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1027 ifndef NO_LLVM_CONFIG
1028 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1029 ifeq ($(LLVMConfigLibs),Error)
1030 $(error llvm-config --libs failed)
1032 LLVMLibsOptions += $(LLVMConfigLibs)
1033 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1034 ifeq ($(LLVMConfigLibfiles),Error)
1035 $(error llvm-config --libfiles failed)
1037 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1044 # Set up the library exports file.
1045 ifdef EXPORTED_SYMBOL_FILE
1047 # First, set up the native export file, which may differ from the source
1050 ifeq ($(HOST_OS),Darwin)
1051 # Darwin convention prefixes symbols with underscores.
1052 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1053 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1054 $(Verb) sed -e 's/^/_/' < $< > $@
1056 -$(Verb) $(RM) -f $(NativeExportsFile)
1058 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1059 # Gold and BFD ld require a version script rather than a plain list.
1060 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1061 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1062 $(Verb) echo "{" > $@
1063 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1064 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1065 ifneq ($(HOST_OS),OpenBSD)
1066 $(Verb) echo " local: *;" >> $@
1068 $(Verb) echo "};" >> $@
1070 -$(Verb) $(RM) -f $(NativeExportsFile)
1072 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1073 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1074 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1075 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1076 $(Echo) Generating $(notdir $@)
1077 $(Verb) $(ECHO) "EXPORTS" > $@
1078 $(Verb) $(CAT) $< >> $@
1080 -$(Verb) $(RM) -f $(NativeExportsFile)
1082 # Default behavior: just use the exports file verbatim.
1083 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1088 # Now add the linker command-line options to use the native export file.
1091 ifeq ($(HOST_OS),Darwin)
1092 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1095 # gold, bfd ld, etc.
1096 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1097 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1101 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1102 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1103 SharedLinkOptions += $(NativeExportsFile)
1108 ###############################################################################
1109 # Library Build Rules: Four ways to build a library
1110 ###############################################################################
1112 #---------------------------------------------------------
1113 # Bytecode Module Targets:
1114 # If the user set MODULE_NAME then they want to build a
1115 # bytecode module from the sources. We compile all the
1116 # sources and link it together into a single bytecode
1118 #---------------------------------------------------------
1121 ifeq ($(strip $(LLVMCC)),)
1122 $(warning Modules require LLVM capable compiler but none is available ****)
1125 Module := $(LibDir)/$(MODULE_NAME).bc
1126 LinkModule := $(LLVMLD) -r
1129 ifdef EXPORTED_SYMBOL_FILE
1130 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1133 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1134 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1135 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1137 all-local:: $(Module)
1140 ifneq ($(strip $(Module)),)
1141 -$(Verb) $(RM) -f $(Module)
1144 ifdef BYTECODE_DESTINATION
1145 ModuleDestDir := $(BYTECODE_DESTINATION)
1147 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1152 $(Echo) Install circumvented with NO_INSTALL
1154 $(Echo) Uninstall circumvented with NO_INSTALL
1156 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1158 install-module:: $(DestModule)
1159 install-local:: $(DestModule)
1161 $(DestModule): $(ModuleDestDir) $(Module)
1162 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1163 $(Verb) $(DataInstall) $(Module) $(DestModule)
1166 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1167 -$(Verb) $(RM) -f $(DestModule)
1173 # if we're building a library ...
1176 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1177 LIBRARYNAME := $(strip $(LIBRARYNAME))
1178 ifdef LOADABLE_MODULE
1179 BaseLibName.A := $(LIBRARYNAME).a
1180 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1182 BaseLibName.A := lib$(LIBRARYNAME).a
1183 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1185 LibName.A := $(LibDir)/$(BaseLibName.A)
1186 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1187 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1188 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1190 #---------------------------------------------------------
1191 # Shared Library Targets:
1192 # If the user asked for a shared library to be built
1193 # with the SHARED_LIBRARY variable, then we provide
1194 # targets for building them.
1195 #---------------------------------------------------------
1196 ifdef SHARED_LIBRARY
1198 all-local:: $(LibName.SO)
1200 ifdef EXPORTED_SYMBOL_FILE
1201 $(LibName.SO): $(NativeExportsFile)
1204 ifdef LINK_LIBS_IN_SHARED
1205 ifdef LOADABLE_MODULE
1206 SharedLibKindMessage := "Loadable Module"
1207 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1209 SharedLibKindMessage := "Shared Library"
1211 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1212 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1214 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1215 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1217 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1218 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1219 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1223 ifneq ($(strip $(LibName.SO)),)
1224 -$(Verb) $(RM) -f $(LibName.SO)
1229 $(Echo) Install circumvented with NO_INSTALL
1231 $(Echo) Uninstall circumvented with NO_INSTALL
1234 # Win32.DLL prefers to be located on the "PATH" of binaries.
1235 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1236 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1238 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1240 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1242 install-local:: $(DestSharedLib)
1244 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1245 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1246 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1249 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1250 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1254 #---------------------------------------------------------
1255 # Bytecode Library Targets:
1256 # If the user asked for a bytecode library to be built
1257 # with the BYTECODE_LIBRARY variable, then we provide
1258 # targets for building them.
1259 #---------------------------------------------------------
1260 ifdef BYTECODE_LIBRARY
1261 ifeq ($(strip $(LLVMCC)),)
1262 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1265 all-local:: $(LibName.BCA)
1267 ifdef EXPORTED_SYMBOL_FILE
1268 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1270 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1271 $(LLVMToolDir)/llvm-ar
1272 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1274 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1276 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1278 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1279 $(LLVMToolDir)/llvm-ar
1280 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1282 $(Verb) $(LArchive) $@ $(ObjectsBC)
1287 ifneq ($(strip $(LibName.BCA)),)
1288 -$(Verb) $(RM) -f $(LibName.BCA)
1291 ifdef BYTECODE_DESTINATION
1292 BytecodeDestDir := $(BYTECODE_DESTINATION)
1294 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1297 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1299 install-bytecode-local:: $(DestBytecodeLib)
1303 $(Echo) Install circumvented with NO_INSTALL
1305 $(Echo) Uninstall circumvented with NO_INSTALL
1307 install-local:: $(DestBytecodeLib)
1309 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1310 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1311 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1314 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1315 -$(Verb) $(RM) -f $(DestBytecodeLib)
1320 #---------------------------------------------------------
1322 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1323 # building an archive.
1324 #---------------------------------------------------------
1325 ifndef NO_BUILD_ARCHIVE
1326 ifndef BUILD_ARCHIVE
1327 ifndef LOADABLE_MODULE
1333 #---------------------------------------------------------
1334 # Archive Library Targets:
1335 # If the user wanted a regular archive library built,
1336 # then we provide targets for building them.
1337 #---------------------------------------------------------
1340 all-local:: $(LibName.A)
1342 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1343 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1344 -$(Verb) $(RM) -f $@
1345 $(Verb) $(Archive) $@ $(ObjectsO)
1346 $(Verb) $(Ranlib) $@
1349 ifneq ($(strip $(LibName.A)),)
1350 -$(Verb) $(RM) -f $(LibName.A)
1355 $(Echo) Install circumvented with NO_INSTALL
1357 $(Echo) Uninstall circumvented with NO_INSTALL
1359 ifdef NO_INSTALL_ARCHIVES
1361 $(Echo) Install circumvented with NO_INSTALL
1363 $(Echo) Uninstall circumvented with NO_INSTALL
1365 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1367 install-local:: $(DestArchiveLib)
1369 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1370 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1371 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1372 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1375 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1376 -$(Verb) $(RM) -f $(DestArchiveLib)
1384 ###############################################################################
1385 # Tool Build Rules: Build executable tool based on TOOLNAME option
1386 ###############################################################################
1390 #---------------------------------------------------------
1391 # Set up variables for building a tool.
1392 #---------------------------------------------------------
1393 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1395 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1397 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1400 # TOOLALIAS is a name to symlink (or copy) the tool to.
1403 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1405 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1409 #---------------------------------------------------------
1411 #---------------------------------------------------------
1413 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1414 # not exporting all of the weak symbols from the binary. This reduces dyld
1415 # startup time by 4x on darwin in some cases.
1416 ifdef TOOL_NO_EXPORTS
1417 ifeq ($(HOST_OS),Darwin)
1419 # Tiger tools don't support this.
1420 ifneq ($(DARWIN_MAJVERS),4)
1421 LD.Flags += -Wl,-exported_symbol,_main
1425 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1426 ifneq ($(ARCH), Mips)
1427 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1432 #---------------------------------------------------------
1433 # Tool Order File Support
1434 #---------------------------------------------------------
1436 ifeq ($(HOST_OS),Darwin)
1437 ifdef TOOL_ORDER_FILE
1439 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1444 #---------------------------------------------------------
1445 # Tool Version Info Support
1446 #---------------------------------------------------------
1448 ifeq ($(HOST_OS),Darwin)
1449 ifdef TOOL_INFO_PLIST
1451 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1453 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1455 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1456 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1457 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1458 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1459 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1460 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1466 #---------------------------------------------------------
1467 # Provide targets for building the tools
1468 #---------------------------------------------------------
1469 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1472 ifneq ($(strip $(ToolBuildPath)),)
1473 -$(Verb) $(RM) -f $(ToolBuildPath)
1475 ifneq ($(strip $(ToolAliasBuildPath)),)
1476 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1480 $(ToolBuildPath): $(ExmplDir)/.dir
1482 $(ToolBuildPath): $(ToolDir)/.dir
1485 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1486 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1487 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1488 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1489 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1492 ifneq ($(strip $(ToolAliasBuildPath)),)
1493 $(ToolAliasBuildPath): $(ToolBuildPath)
1494 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1495 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1496 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1497 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1503 $(Echo) Install circumvented with NO_INSTALL
1505 $(Echo) Uninstall circumvented with NO_INSTALL
1509 ToolBinDir = $(DESTDIR)$(PROJ_internal_prefix)/bin
1511 ToolBinDir = $(DESTDIR)$(PROJ_bindir)
1513 DestTool = $(ToolBinDir)/$(TOOLEXENAME)
1515 install-local:: $(DestTool)
1517 $(DestTool): $(ToolBuildPath)
1518 $(Echo) Installing $(BuildMode) $(DestTool)
1519 $(Verb) $(MKDIR) $(ToolBinDir)
1520 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1523 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1524 -$(Verb) $(RM) -f $(DestTool)
1526 # TOOLALIAS install.
1528 DestToolAlias = $(ToolBinDir)/$(TOOLALIAS)$(EXEEXT)
1530 install-local:: $(DestToolAlias)
1532 $(DestToolAlias): $(DestTool)
1533 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1534 $(Verb) $(RM) -f $(DestToolAlias)
1535 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1538 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1539 -$(Verb) $(RM) -f $(DestToolAlias)
1545 ###############################################################################
1546 # Object Build Rules: Build object files based on sources
1547 ###############################################################################
1549 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1550 ifeq ($(HOST_OS),HP-UX)
1551 DISABLE_AUTO_DEPENDENCIES=1
1554 # Provide rule sets for when dependency generation is enabled
1555 ifndef DISABLE_AUTO_DEPENDENCIES
1557 #---------------------------------------------------------
1558 # Create .o files in the ObjDir directory from the .cpp and .c files...
1559 #---------------------------------------------------------
1561 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1562 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1564 # If the build succeeded, move the dependency file over, otherwise
1566 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1567 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1569 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1570 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1571 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1574 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1575 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1576 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1579 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1580 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1581 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1584 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1585 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1586 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1589 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1590 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1591 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1594 #---------------------------------------------------------
1595 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1596 #---------------------------------------------------------
1598 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1599 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1601 # If the build succeeded, move the dependency file over, otherwise
1603 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1604 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1606 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1607 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1608 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1609 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1610 $(BC_DEPEND_MOVEFILE)
1612 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1613 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1614 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1615 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1616 $(BC_DEPEND_MOVEFILE)
1618 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1619 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1620 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1621 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1622 $(BC_DEPEND_MOVEFILE)
1624 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1625 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1626 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1627 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1628 $(BC_DEPEND_MOVEFILE)
1630 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1631 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1632 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1633 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1634 $(BC_DEPEND_MOVEFILE)
1636 # Provide alternate rule sets if dependencies are disabled
1639 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1640 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1641 $(Compile.CXX) $< -o $@
1643 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1644 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1645 $(Compile.CXX) $< -o $@
1647 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1648 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1649 $(Compile.CXX) $< -o $@
1651 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1652 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1653 $(Compile.C) $< -o $@
1655 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1656 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1657 $(Compile.C) $< -o $@
1659 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1660 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1661 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1663 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1664 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1665 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1667 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1668 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1669 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1671 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1672 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1673 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1675 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1676 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1677 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1682 ## Rules for building preprocessed (.i/.ii) outputs.
1683 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1684 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1685 $(Verb) $(Preprocess.CXX) $< -o $@
1687 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1688 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1689 $(Verb) $(Preprocess.CXX) $< -o $@
1691 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1692 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1693 $(Verb) $(Preprocess.CXX) $< -o $@
1695 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1696 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1697 $(Verb) $(Preprocess.C) $< -o $@
1699 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1700 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1701 $(Verb) $(Preprocess.C) $< -o $@
1704 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1705 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1706 $(Compile.CXX) $< -o $@ -S
1708 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1709 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1710 $(Compile.CXX) $< -o $@ -S
1712 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1713 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1714 $(Compile.CXX) $< -o $@ -S
1716 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1717 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1718 $(Compile.C) $< -o $@ -S
1720 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1721 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1722 $(Compile.C) $< -o $@ -S
1725 # make the C and C++ compilers strip debug info out of bytecode libraries.
1727 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1728 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1729 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1731 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1732 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1733 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1737 #---------------------------------------------------------
1738 # Provide rule to build .bc files from .ll sources,
1739 # regardless of dependencies
1740 #---------------------------------------------------------
1741 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1742 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1743 $(Verb) $(LLVMAS) $< -f -o $@
1745 ###############################################################################
1746 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1747 ###############################################################################
1750 TABLEGEN_INC_FILES_COMMON = 1
1753 ifdef TABLEGEN_INC_FILES_COMMON
1755 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1756 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1757 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1759 # INCFiles rule: All of the tblgen generated files are emitted to
1760 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1761 # us to only "touch" the real file if the contents of it change. IOW, if
1762 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1763 # dependencies of the .inc files are, unless the contents of the .inc file
1765 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1766 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1768 endif # TABLEGEN_INC_FILES_COMMON
1772 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1773 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1774 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1775 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1776 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1777 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1778 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1780 # All .inc.tmp files depend on the .td files.
1781 $(INCTMPFiles) : $(TDFiles)
1783 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1784 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1785 $(Echo) "Building $(<F) register info implementation with tblgen"
1786 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1788 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1789 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1790 $(Echo) "Building $(<F) instruction information with tblgen"
1791 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1793 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1794 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1795 $(Echo) "Building $(<F) assembly writer with tblgen"
1796 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1798 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1799 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1800 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1801 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1803 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1804 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1805 $(Echo) "Building $(<F) assembly matcher with tblgen"
1806 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1808 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1809 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1810 $(Echo) "Building $(<F) MC code emitter with tblgen"
1811 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1813 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1814 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1815 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1816 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1818 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1819 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1820 $(Echo) "Building $(<F) code emitter with tblgen"
1821 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1823 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1824 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1825 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1826 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1828 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1829 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1830 $(Echo) "Building $(<F) disassembly tables with tblgen"
1831 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1833 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1834 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1835 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1836 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1838 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1839 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1840 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1841 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1843 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1844 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1845 $(Echo) "Building $(<F) subtarget information with tblgen"
1846 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1848 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1849 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1850 $(Echo) "Building $(<F) calling convention information with tblgen"
1851 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1853 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1854 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1855 $(Echo) "Building $(<F) intrinsics information with tblgen"
1856 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1858 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1859 $(Echo) "Building $(<F) decoder tables with tblgen"
1860 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1862 $(ObjDir)/%GenDFAPacketizer.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1863 $(Echo) "Building $(<F) DFA packetizer tables with tblgen"
1864 $(Verb) $(LLVMTableGen) -gen-dfa-packetizer -o $(call SYSPATH, $@) $<
1867 -$(Verb) $(RM) -f $(INCFiles)
1871 ###############################################################################
1872 # OTHER RULES: Other rules needed
1873 ###############################################################################
1875 # To create postscript files from dot files...
1876 ifneq ($(DOT),false)
1878 $(DOT) -Tps < $< > $@
1881 $(Echo) "Cannot build $@: The program dot is not installed"
1884 # This rules ensures that header files that are removed still have a rule for
1885 # which they can be "generated." This allows make to ignore them and
1886 # reproduce the dependency lists.
1890 # Define clean-local to clean the current directory. Note that this uses a
1891 # very conservative approach ensuring that empty variables do not cause
1892 # errors or disastrous removal.
1894 ifneq ($(strip $(ObjRootDir)),)
1895 -$(Verb) $(RM) -rf $(ObjRootDir)
1897 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1898 -$(Verb) $(RM) -f *$(SHLIBEXT)
1902 -$(Verb) $(RM) -rf Debug Release Profile
1905 ###############################################################################
1906 # DEPENDENCIES: Include the dependency files if we should
1907 ###############################################################################
1908 ifndef DISABLE_AUTO_DEPENDENCIES
1910 # If its not one of the cleaning targets
1911 ifndef IS_CLEANING_TARGET
1913 # Get the list of dependency files
1914 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1915 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1917 # Include bitcode dependency files if using bitcode libraries
1918 ifdef BYTECODE_LIBRARY
1919 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1922 -include $(DependFiles) ""
1928 ###############################################################################
1929 # CHECK: Running the test suite
1930 ###############################################################################
1933 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1934 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1935 $(EchoCmd) Running test suite ; \
1936 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1937 TESTSUITE=$(TESTSUITE) ; \
1939 $(EchoCmd) No Makefile in test directory ; \
1942 $(EchoCmd) No test directory ; \
1948 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1949 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1950 $(EchoCmd) Running test suite ; \
1951 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1953 $(EchoCmd) No Makefile in test directory ; \
1956 $(EchoCmd) No test directory ; \
1960 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1961 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1962 $(EchoCmd) Running test suite ; \
1963 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1965 $(EchoCmd) No Makefile in test directory ; \
1968 $(EchoCmd) No test directory ; \
1971 ###############################################################################
1972 # UNITTESTS: Running the unittests test suite
1973 ###############################################################################
1976 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1977 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1978 $(EchoCmd) Running unittests test suite ; \
1979 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1981 $(EchoCmd) No Makefile in unittests directory ; \
1984 $(EchoCmd) No unittests directory ; \
1987 ###############################################################################
1988 # DISTRIBUTION: Handle construction of a distribution tarball
1989 ###############################################################################
1991 #------------------------------------------------------------------------
1992 # Define distribution related variables
1993 #------------------------------------------------------------------------
1994 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1995 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1996 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1997 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1998 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1999 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
2000 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
2001 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
2002 Makefile.config.in configure autoconf
2003 DistOther := $(notdir $(wildcard \
2004 $(PROJ_SRC_DIR)/*.h \
2005 $(PROJ_SRC_DIR)/*.td \
2006 $(PROJ_SRC_DIR)/*.def \
2007 $(PROJ_SRC_DIR)/*.ll \
2008 $(PROJ_SRC_DIR)/*.in))
2009 DistSubDirs := $(SubDirs)
2010 DistSources = $(Sources) $(EXTRA_DIST)
2011 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2013 #------------------------------------------------------------------------
2014 # We MUST build distribution with OBJ_DIR != SRC_DIR
2015 #------------------------------------------------------------------------
2016 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2017 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2018 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2022 #------------------------------------------------------------------------
2023 # Prevent attempt to run dist targets from anywhere but the top level
2024 #------------------------------------------------------------------------
2026 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2027 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2030 #------------------------------------------------------------------------
2031 # Provide the top level targets
2032 #------------------------------------------------------------------------
2034 dist-gzip:: $(DistTarGZip)
2036 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2037 $(Echo) Packing gzipped distribution tar file.
2038 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2039 $(GZIP) -c > "$(DistTarGZip)"
2041 dist-bzip2:: $(DistTarBZ2)
2043 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2044 $(Echo) Packing bzipped distribution tar file.
2045 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2046 $(BZIP2) -c >$(DistTarBZ2)
2048 dist-zip:: $(DistZip)
2050 $(DistZip) : $(TopDistDir)/.makedistdir
2051 $(Echo) Packing zipped distribution file.
2052 $(Verb) rm -f $(DistZip)
2053 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2055 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2056 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2058 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2060 dist-check:: $(DistTarGZip)
2061 $(Echo) Checking distribution tar file.
2062 $(Verb) if test -d $(DistCheckDir) ; then \
2063 $(RM) -rf $(DistCheckDir) ; \
2065 $(Verb) $(MKDIR) $(DistCheckDir)
2066 $(Verb) cd $(DistCheckDir) && \
2067 $(MKDIR) $(DistCheckDir)/build && \
2068 $(MKDIR) $(DistCheckDir)/install && \
2069 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2071 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2072 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2075 $(MAKE) unittests && \
2076 $(MAKE) install && \
2077 $(MAKE) uninstall && \
2078 $(MAKE) dist-clean && \
2079 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2082 $(Echo) Cleaning distribution files
2083 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2088 #------------------------------------------------------------------------
2089 # Provide the recursive distdir target for building the distribution directory
2090 #------------------------------------------------------------------------
2091 distdir: $(DistDir)/.makedistdir
2092 $(DistDir)/.makedistdir: $(DistSources)
2093 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2094 if test -d "$(DistDir)" ; then \
2095 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2098 $(EchoCmd) Removing old $(DistDir) ; \
2099 $(RM) -rf $(DistDir); \
2100 $(EchoCmd) Making 'all' to verify build ; \
2101 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2103 $(Echo) Building Distribution Directory $(DistDir)
2104 $(Verb) $(MKDIR) $(DistDir)
2105 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2106 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2107 for file in $(DistFiles) ; do \
2109 $(PROJ_SRC_DIR)/*) \
2110 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2112 $(PROJ_SRC_ROOT)/*) \
2113 file=`echo "$$file" | \
2114 sed "s#^$$srcrootstrip/##"` \
2117 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2118 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2119 from_dir="$(PROJ_SRC_DIR)" ; \
2120 elif test -f "$$file" || test -d "$$file" ; then \
2123 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2124 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2125 to_dir="$(DistDir)/$$dir"; \
2126 $(MKDIR) "$$to_dir" ; \
2128 to_dir="$(DistDir)"; \
2130 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2131 if test -n "$$mid_dir" ; then \
2132 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2134 if test -d "$$from_dir/$$file"; then \
2135 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2136 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2137 cd $(PROJ_SRC_DIR) ; \
2138 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2139 ( cd $$to_dir ; $(TAR) xf - ) ; \
2140 cd $(PROJ_OBJ_DIR) ; \
2143 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2144 ( cd $$to_dir ; $(TAR) xf - ) ; \
2145 cd $(PROJ_OBJ_DIR) ; \
2147 elif test -f "$$from_dir/$$file" ; then \
2148 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2149 elif test -L "$$from_dir/$$file" ; then \
2150 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2151 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2152 $(EchoCmd) "===== WARNING: Distribution Source " \
2153 "$$from_dir/$$file Not Found!" ; \
2154 elif test "$(Verb)" != '@' ; then \
2155 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2158 $(Verb) for subdir in $(DistSubDirs) ; do \
2159 if test "$$subdir" \!= "." ; then \
2160 new_distdir="$(DistDir)/$$subdir" ; \
2161 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2162 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2163 DistDir="$$new_distdir" distdir ) || exit 1; \
2166 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2167 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2168 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2169 -name .svn \) -print` ;\
2170 $(MAKE) dist-hook ; \
2171 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2172 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2173 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2174 -o ! -type d ! -perm -444 -exec \
2175 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2176 || chmod -R a+r $(DistDir) ; \
2179 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2185 ###############################################################################
2186 # TOP LEVEL - targets only to apply at the top level directory
2187 ###############################################################################
2191 #------------------------------------------------------------------------
2192 # Install support for the project's include files:
2193 #------------------------------------------------------------------------
2196 $(Echo) Install circumvented with NO_INSTALL
2198 $(Echo) Uninstall circumvented with NO_INSTALL
2201 $(Echo) Installing include files
2202 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2203 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2204 cd $(PROJ_SRC_ROOT)/include && \
2205 for hdr in `find . -type f \
2206 '(' -name LICENSE.TXT \
2211 ')' -print | grep -v CVS | \
2212 grep -v .svn` ; do \
2213 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2214 if test \! -d "$$instdir" ; then \
2215 $(EchoCmd) Making install directory $$instdir ; \
2216 $(MKDIR) $$instdir ;\
2218 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2221 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2222 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2223 cd $(PROJ_OBJ_ROOT)/include && \
2224 for hdr in `find . -type f \
2225 '(' -name LICENSE.TXT \
2230 ')' -print | grep -v CVS | \
2231 grep -v .svn` ; do \
2232 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2233 if test \! -d "$$instdir" ; then \
2234 $(EchoCmd) Making install directory $$instdir ; \
2235 $(MKDIR) $$instdir ;\
2237 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2243 $(Echo) Uninstalling include files
2244 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2245 cd $(PROJ_SRC_ROOT)/include && \
2246 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2247 '!' '(' -name '*~' -o -name '.#*' \
2248 -o -name '*.in' ')' -print ')' | \
2249 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2250 cd $(PROJ_SRC_ROOT)/include && \
2251 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2252 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2258 @echo searching for overlength lines in files: $(Sources)
2261 egrep -n '.{81}' $(Sources) /dev/null
2264 @echo searching for tabs in files: $(Sources)
2267 egrep -n ' ' $(Sources) /dev/null
2270 @ls -l $(LibDir) | awk '\
2271 BEGIN { sum = 0; } \
2273 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2274 @ls -l $(ToolDir) | awk '\
2275 BEGIN { sum = 0; } \
2277 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2278 #------------------------------------------------------------------------
2279 # Print out the directories used for building
2280 #------------------------------------------------------------------------
2282 $(Echo) "BuildMode : " '$(BuildMode)'
2283 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2284 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2285 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2286 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2287 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2288 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2289 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2290 $(Echo) "PROJ_internal_prefix : " '$(PROJ_internal_prefix)'
2291 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2292 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2293 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2294 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2295 $(Echo) "UserTargets : " '$(UserTargets)'
2296 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2297 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2298 $(Echo) "ObjDir : " '$(ObjDir)'
2299 $(Echo) "LibDir : " '$(LibDir)'
2300 $(Echo) "ToolDir : " '$(ToolDir)'
2301 $(Echo) "ExmplDir : " '$(ExmplDir)'
2302 $(Echo) "Sources : " '$(Sources)'
2303 $(Echo) "TDFiles : " '$(TDFiles)'
2304 $(Echo) "INCFiles : " '$(INCFiles)'
2305 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2306 $(Echo) "PreConditions: " '$(PreConditions)'
2307 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2308 $(Echo) "Compile.C : " '$(Compile.C)'
2309 $(Echo) "Archive : " '$(Archive)'
2310 $(Echo) "YaccFiles : " '$(YaccFiles)'
2311 $(Echo) "LexFiles : " '$(LexFiles)'
2312 $(Echo) "Module : " '$(Module)'
2313 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2314 $(Echo) "SubDirs : " '$(SubDirs)'
2315 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2316 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2321 # General debugging rule, use 'make dbg-print-XXX' to print the
2322 # definition, value and origin of XXX.
2324 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))