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 $(Echo) Constructing LLVMBuild project information.
99 $(Verb) $(LLVMBuildTool) \
100 --native-target "$(TARGET_NATIVE_ARCH)" \
101 --enable-targets "$(TARGETS_TO_BUILD)" \
102 --write-library-table $(LLVMConfigLibraryDependenciesInc) \
103 --write-make-fragment $(LLVMBuildMakeFrag)
105 # For completeness, let Make know how the extra files are generated.
106 $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
108 # Include the generated Makefile fragment.
110 # We currently only include the dependencies for the fragment itself if we are
111 # at the top-level. Otherwise, recursive invocations would ends up doing
112 # substantially more redundant stat'ing.
114 # This means that we won't properly regenerate things for developers used to
115 # building from a subdirectory, but that is always somewhat unreliable.
117 LLVMBUILD_INCLUDE_DEPENDENCIES := 1
119 -include $(LLVMBuildMakeFrag)
121 ################################################################################
122 # PRECONDITIONS: that which must be built/checked first
123 ################################################################################
125 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
126 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
127 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
128 ConfigureScript := $(PROJ_SRC_ROOT)/configure
129 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
130 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
131 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
132 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
133 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
134 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
135 ifneq ($(MakefileCommonIn),)
136 PreConditions += $(MakefileCommon)
139 ifneq ($(MakefileConfigIn),)
140 PreConditions += $(MakefileConfig)
143 preconditions: $(PreConditions)
145 #------------------------------------------------------------------------
146 # Make sure the BUILT_SOURCES are built first
147 #------------------------------------------------------------------------
148 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
151 ifneq ($(strip $(BUILT_SOURCES)),)
152 -$(Verb) $(RM) -f $(BUILT_SOURCES)
155 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
157 $(Verb) if test -x config.status ; then \
158 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
159 $(MKDIR) .spotless.save ; \
160 $(MV) config.status .spotless.save ; \
161 $(MV) mklib .spotless.save ; \
162 $(MV) projects .spotless.save ; \
164 $(MV) .spotless.save/config.status . ; \
165 $(MV) .spotless.save/mklib . ; \
166 $(MV) .spotless.save/projects . ; \
167 $(RM) -rf .spotless.save ; \
168 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
169 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
170 $(ConfigStatusScript) ; \
172 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
176 $(EchoCmd) "spotless target not supported for objdir == srcdir"
179 $(BUILT_SOURCES) : $(ObjMakefiles)
181 #------------------------------------------------------------------------
182 # Make sure we're not using a stale configuration
183 #------------------------------------------------------------------------
185 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
186 $(Verb) cd $(PROJ_OBJ_ROOT) && \
187 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
188 $(ConfigStatusScript)
190 .PRECIOUS: $(ConfigStatusScript)
191 $(ConfigStatusScript): $(ConfigureScript)
192 $(Echo) Reconfiguring with $<
193 $(Verb) cd $(PROJ_OBJ_ROOT) && \
194 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
195 $(ConfigStatusScript)
197 #------------------------------------------------------------------------
198 # Make sure the configuration makefile is up to date
199 #------------------------------------------------------------------------
200 ifneq ($(MakefileConfigIn),)
201 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
202 $(Echo) Regenerating $@
203 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
206 ifneq ($(MakefileCommonIn),)
207 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
208 $(Echo) Regenerating $@
209 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
212 #------------------------------------------------------------------------
213 # If the Makefile in the source tree has been updated, copy it over into the
214 # build tree. But, only do this if the source and object makefiles differ
215 #------------------------------------------------------------------------
217 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
220 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
222 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
223 $(Echo) "Updating Makefile"
224 $(Verb) $(MKDIR) $(@D)
225 $(Verb) $(CP) -f $< $@
227 # Copy the Makefile.* files unless we're in the root directory which avoids
228 # the copying of Makefile.config.in or other things that should be explicitly
230 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
232 *Makefile.rules) ;; \
234 *) $(EchoCmd) "Updating $(@F)" ; \
241 #------------------------------------------------------------------------
242 # Set up the basic dependencies
243 #------------------------------------------------------------------------
244 $(UserTargets):: $(PreConditions)
248 clean-all:: clean-local clean-all-local
249 install:: install-local
250 uninstall:: uninstall-local
251 install-local:: all-local
252 install-bytecode:: install-bytecode-local
254 ###############################################################################
255 # VARIABLES: Set up various variables based on configuration data
256 ###############################################################################
258 # Variable for if this make is for a "cleaning" target
259 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
263 #--------------------------------------------------------------------
264 # Variables derived from configuration we are building
265 #--------------------------------------------------------------------
268 ifeq ($(ENABLE_OPTIMIZED),1)
270 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
271 ifneq ($(HOST_OS),FreeBSD)
272 ifneq ($(HOST_OS),Darwin)
273 OmitFramePointer := -fomit-frame-pointer
277 # Darwin requires -fstrict-aliasing to be explicitly enabled.
278 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
279 # with -fstrict-aliasing and ipa-type-escape radr://6756684
280 #ifeq ($(HOST_OS),Darwin)
281 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
283 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
284 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
285 LD.Flags += $(OPTIMIZE_OPTION)
287 BuildMode := $(BuildMode)+Debug
294 ifdef NO_DEBUG_SYMBOLS
295 BuildMode := Unoptimized
309 ifeq ($(ENABLE_LIBCPP),1)
310 CXX.Flags += -stdlib=libc++
311 LD.Flags += -stdlib=libc++
314 ifeq ($(ENABLE_PROFILING),1)
315 BuildMode := $(BuildMode)+Profile
316 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
317 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
318 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
322 ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
323 CXX.Flags += -fvisibility-inlines-hidden
326 ifdef ENABLE_EXPENSIVE_CHECKS
327 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
328 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
332 # IF REQUIRES_EH=1 is specified then don't disable exceptions
334 CXX.Flags += -fno-exceptions
336 # If the library requires EH, it also requires RTTI.
340 ifdef REQUIRES_FRAME_POINTER
341 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
342 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
343 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
346 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
347 ifneq ($(REQUIRES_RTTI), 1)
348 CXX.Flags += -fno-rtti
351 ifeq ($(ENABLE_COVERAGE),1)
352 BuildMode := $(BuildMode)+Coverage
353 CXX.Flags += -ftest-coverage -fprofile-arcs
354 C.Flags += -ftest-coverage -fprofile-arcs
357 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
358 # then disable assertions by defining the appropriate preprocessor symbols.
359 ifeq ($(DISABLE_ASSERTIONS),1)
360 CPP.Defines += -DNDEBUG
362 BuildMode := $(BuildMode)+Asserts
363 CPP.Defines += -D_DEBUG
366 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
367 # configured), then enable expensive checks by defining the
368 # appropriate preprocessor symbols.
369 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
370 BuildMode := $(BuildMode)+Checks
371 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
374 # LOADABLE_MODULE implies several other things so we force them to be
376 ifdef LOADABLE_MODULE
378 LINK_LIBS_IN_SHARED := 1
386 ifeq ($(ENABLE_PIC),1)
387 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
388 # Nothing. Win32 defaults to PIC and warns when given -fPIC
390 ifeq ($(HOST_OS),Darwin)
391 # Common symbols not allowed in dylib files
392 CXX.Flags += -fno-common
393 C.Flags += -fno-common
395 # Linux and others; pass -fPIC
401 ifeq ($(HOST_OS),Darwin)
402 CXX.Flags += -mdynamic-no-pic
403 C.Flags += -mdynamic-no-pic
407 # Support makefile variable to disable any kind of timestamp/non-deterministic
408 # info from being used in the build.
409 ifeq ($(ENABLE_TIMESTAMPS),1)
410 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
412 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
415 ifeq ($(HOST_OS),MingW)
417 CPP.Defines += -D__NO_CTYPE_INLINE
418 ifeq ($(LLVM_CROSS_COMPILING),1)
419 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
421 LD.Flags += -Wl,--allow-multiple-definition
426 CXX.Flags += -Woverloaded-virtual
427 CPP.BaseFlags += $(CPP.Defines)
430 # Make Floating point IEEE compliant on Alpha.
433 CPP.BaseFlags += -mieee
434 ifeq ($(ENABLE_PIC),0)
436 CPP.BaseFlags += -fPIC
439 LD.Flags += -Wl,--no-relax
442 # GNU ld/PECOFF accepts but ignores them below;
446 # FIXME: autoconf should be aware of them.
447 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
448 HAVE_LINK_VERSION_SCRIPT := 0
450 RDYNAMIC := -Wl,--export-all-symbols
453 #--------------------------------------------------------------------
454 # Directory locations
455 #--------------------------------------------------------------------
457 ifeq ($(LLVM_CROSS_COMPILING),1)
458 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
461 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
462 ObjDir := $(ObjRootDir)
463 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
464 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
465 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
466 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
467 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
468 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
470 #--------------------------------------------------------------------
471 # Locations of shared libraries
472 #--------------------------------------------------------------------
475 SharedLibDir := $(LibDir)
476 LLVMSharedLibDir := $(LLVMLibDir)
478 # Win32.DLL prefers to be located on the "PATH" of binaries.
479 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
480 SharedLibDir := $(ToolDir)
481 LLVMSharedLibDir := $(LLVMToolDir)
483 ifeq ($(HOST_OS),Cygwin)
490 #--------------------------------------------------------------------
491 # LLVM Capable Compiler
492 #--------------------------------------------------------------------
494 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
496 LLVMCXX := $(LLVMGXX)
498 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
499 ifneq ($(CLANGPATH),)
500 LLVMCC := $(CLANGPATH)
501 LLVMCXX := $(CLANGXXPATH)
503 ifeq ($(ENABLE_BUILT_CLANG),1)
504 LLVMCC := $(LLVMToolDir)/clang
505 LLVMCXX := $(LLVMToolDir)/clang++
511 #--------------------------------------------------------------------
512 # Full Paths To Compiled Tools and Utilities
513 #--------------------------------------------------------------------
514 EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
515 ifdef BUILD_DIRS_ONLY
516 EchoCmd := $(EchoCmd) "(build tools)":
521 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
524 ifeq ($(LLVM_CROSS_COMPILING),1)
525 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
527 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
530 ifeq ($(LLVM_CROSS_COMPILING),1)
531 LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config$(BUILD_EXEEXT)
533 LLVM_CONFIG := $(LLVMToolDir)/llvm-config$(EXEEXT)
536 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
539 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
542 LLI := $(LLVMToolDir)/lli$(EXEEXT)
545 LLC := $(LLVMToolDir)/llc$(EXEEXT)
548 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
551 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
554 #--------------------------------------------------------------------
555 # Adjust to user's request
556 #--------------------------------------------------------------------
558 ifeq ($(HOST_OS),Darwin)
559 DARWIN_VERSION := `sw_vers -productVersion`
560 # Strip a number like 10.4.7 to 10.4
561 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
562 # Get "4" out of 10.4 for later pieces in the makefile.
563 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
565 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
566 SharedLinkOptions := -dynamiclib
568 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
571 SharedLinkOptions=-shared
574 ifeq ($(TARGET_OS),Darwin)
576 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
581 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
582 ifneq ($(HOST_OS),Darwin)
583 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
595 # Adjust settings for verbose mode
598 AR.Flags += >/dev/null 2>/dev/null
599 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
601 ConfigureScriptFLAGS :=
604 # By default, strip symbol information from executable
606 Strip := $(PLATFORMSTRIPOPTS)
607 StripWarnMsg := "(without symbols)"
608 Install.StripFlag += -s
611 ifdef TOOL_NO_EXPORTS
614 DynamicFlag := $(RDYNAMIC)
617 # Adjust linker flags for building an executable
618 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
619 ifneq ($(HOST_OS), Darwin)
621 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
623 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
625 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
629 ifneq ($(DARWIN_MAJVERS),4)
630 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
636 #----------------------------------------------------------
637 # Options To Invoke Tools
638 #----------------------------------------------------------
640 ifdef EXTRA_LD_OPTIONS
641 LD.Flags += $(EXTRA_LD_OPTIONS)
645 CompileCommonOpts += -pedantic -Wno-long-long
647 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
649 # Enable cast-qual for C++; the workaround is to use const_cast.
650 CXX.Flags += -Wcast-qual
652 ifeq ($(HOST_OS),HP-UX)
653 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
656 # If we are building a universal binary on Mac OS/X, pass extra options. This
657 # is useful to people that want to link the LLVM libraries into their universal
660 # The following can be optionally specified:
661 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
662 # For Mac OS/X 10.4 Intel machines, the traditional one is:
663 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
664 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
665 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
668 ifndef UNIVERSAL_ARCH
669 UNIVERSAL_ARCH := i386 ppc
671 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
672 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
673 ifdef UNIVERSAL_SDK_PATH
674 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
677 # Building universal cannot compute dependencies automatically.
678 DISABLE_AUTO_DEPENDENCIES=1
680 ifeq ($(TARGET_OS),Darwin)
681 ifeq ($(ARCH),x86_64)
682 TargetCommonOpts = -m64
685 TargetCommonOpts = -m32
691 ifeq ($(HOST_OS),SunOS)
692 CPP.BaseFlags += -include llvm/Support/Solaris.h
695 ifeq ($(HOST_OS),AuroraUX)
696 CPP.BaseFlags += -include llvm/Support/Solaris.h
697 endif # !HOST_OS - AuroraUX.
699 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
700 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
701 # All -I flags should go here, so that they don't confuse llvm-config.
702 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
703 $(patsubst %,-I%/include,\
704 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
705 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
708 ifeq ($(INCLUDE_BUILD_DIR),1)
709 CPP.Flags += -I$(ObjDir)
712 # SHOW_DIAGNOSTICS support.
713 ifeq ($(SHOW_DIAGNOSTICS),1)
714 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
715 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
720 Compile.C = $(Compile.Wrapper) \
721 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
722 $(TargetCommonOpts) $(CompileCommonOpts) -c
723 Compile.CXX = $(Compile.Wrapper) \
724 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
725 $(TargetCommonOpts) $(CompileCommonOpts) -c
726 Preprocess.CXX= $(Compile.Wrapper) \
727 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
728 $(CompileCommonOpts) $(CXX.Flags) -E
729 Link = $(Compile.Wrapper) \
730 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
731 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
733 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
734 $(TargetCommonOpts) $(CompileCommonOpts)
735 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
736 $(TargetCommonOpts) $(CompileCommonOpts) -E
738 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
739 $(TargetCommonOpts) $(CompileCommonOpts)
741 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
742 ScriptInstall = $(INSTALL) -m 0755
743 DataInstall = $(INSTALL) -m 0644
745 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
746 # paths. In this case, the SYSPATH function (defined in
747 # Makefile.config) transforms Unix paths into Windows paths.
748 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
749 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
750 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
751 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
752 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
754 Archive = $(AR) $(AR.Flags)
755 LArchive = $(LLVMToolDir)/llvm-ar rcsf
764 #----------------------------------------------------------
765 # Get the list of source files and compute object file
767 #----------------------------------------------------------
770 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
771 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
773 Sources := $(SOURCES)
777 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
780 BaseNameSources := $(sort $(basename $(Sources)))
782 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
783 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
785 #----------------------------------------------------------
786 # For Mingw MSYS bash and Python/w32:
788 # $(ECHOPATH) prints DOSish pathstring.
789 # ex) $(ECHOPATH) /include/sys/types.h
790 # --> C:/mingw/include/sys/types.h
791 # built-in "echo" does not transform path to DOSish path.
793 # FIXME: It would not be needed when MSYS's python
795 #----------------------------------------------------------
797 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
798 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
800 ECHOPATH := $(Verb)$(ECHO)
803 ###############################################################################
804 # DIRECTORIES: Handle recursive descent of directory structure
805 ###############################################################################
807 #---------------------------------------------------------
808 # Provide rules to make install dirs. This must be early
809 # in the file so they get built before dependencies
810 #---------------------------------------------------------
812 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
815 # To create other directories, as needed, and timestamp their creation
817 $(Verb) $(MKDIR) $* > /dev/null
818 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
820 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
821 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
823 #---------------------------------------------------------
824 # Handle the DIRS options for sequential construction
825 #---------------------------------------------------------
831 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
832 $(RecursiveTargets)::
833 $(Verb) for dir in $(DIRS); do \
834 if ([ ! -f $$dir/Makefile ] || \
835 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
837 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
839 ($(MAKE) -C $$dir $@ ) || exit 1; \
842 $(RecursiveTargets)::
843 $(Verb) for dir in $(DIRS); do \
844 ($(MAKE) -C $$dir $@ ) || exit 1; \
850 #---------------------------------------------------------
851 # Handle the EXPERIMENTAL_DIRS options ensuring success
852 # after each directory is built.
853 #---------------------------------------------------------
854 ifdef EXPERIMENTAL_DIRS
855 $(RecursiveTargets)::
856 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
857 if ([ ! -f $$dir/Makefile ] || \
858 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
860 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
862 ($(MAKE) -C $$dir $@ ) || exit 0; \
866 #-----------------------------------------------------------
867 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
868 #-----------------------------------------------------------
869 ifdef OPTIONAL_PARALLEL_DIRS
870 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
873 #-----------------------------------------------------------
874 # Handle the PARALLEL_DIRS options for parallel construction
875 #-----------------------------------------------------------
878 SubDirs += $(PARALLEL_DIRS)
880 # Unfortunately, this list must be maintained if new recursive targets are added
881 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
882 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
883 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
884 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
885 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
886 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
887 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
889 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
893 SD=$(PROJ_SRC_DIR)/$(@D); \
895 if [ ! -f $$SD/Makefile ]; then \
897 DD=$(notdir $(@D)); \
899 if ([ ! -f $$DD/Makefile ] || \
900 command test $$DD/Makefile -ot \
901 $$SD/Makefile ); then \
903 $(CP) $$SD/Makefile $$DD/Makefile; \
905 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
908 #---------------------------------------------------------
909 # Handle the OPTIONAL_DIRS options for directores that may
911 #---------------------------------------------------------
914 SubDirs += $(OPTIONAL_DIRS)
916 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
917 $(RecursiveTargets)::
918 $(Verb) for dir in $(OPTIONAL_DIRS); do \
919 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
920 if ([ ! -f $$dir/Makefile ] || \
921 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
923 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
925 ($(MAKE) -C$$dir $@ ) || exit 1; \
929 $(RecursiveTargets)::
930 $(Verb) for dir in $(OPTIONAL_DIRS); do \
931 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
932 ($(MAKE) -C$$dir $@ ) || exit 1; \
938 #---------------------------------------------------------
939 # Handle the CONFIG_FILES options
940 #---------------------------------------------------------
945 $(Echo) Install circumvented with NO_INSTALL
947 $(Echo) UnInstall circumvented with NO_INSTALL
949 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
950 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
951 $(Verb)for file in $(CONFIG_FILES); do \
952 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
953 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
954 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
955 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
957 $(ECHO) Error: cannot find config file $${file}. ; \
962 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
963 $(Verb)for file in $(CONFIG_FILES); do \
964 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
970 ###############################################################################
971 # Set up variables for building libraries
972 ###############################################################################
974 #---------------------------------------------------------
975 # Define various command line options pertaining to the
976 # libraries needed when linking. There are "Proj" libs
977 # (defined by the user's project) and "LLVM" libs (defined
978 # by the LLVM project).
979 #---------------------------------------------------------
982 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
983 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
984 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
985 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
989 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
990 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
991 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
992 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
995 # Loadable module for Win32 requires all symbols resolved for linking.
996 # Then all symbols in LLVM.dll will be available.
997 ifeq ($(ENABLE_SHARED),1)
998 ifdef LOADABLE_MODULE
999 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
1000 LINK_COMPONENTS += all
1005 ifndef IS_CLEANING_TARGET
1006 ifdef LINK_COMPONENTS
1008 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1009 # clean in tools, then do a make in tools (instead of at the top level).
1011 @echo "*** llvm-config doesn't exist - rebuilding it."
1012 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1014 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1016 ifeq ($(ENABLE_SHARED), 1)
1017 # We can take the "auto-import" feature to get rid of using dllimport.
1018 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1019 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1022 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1023 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1026 ifndef NO_LLVM_CONFIG
1027 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1028 ifeq ($(LLVMConfigLibs),Error)
1029 $(error llvm-config --libs failed)
1031 LLVMLibsOptions += $(LLVMConfigLibs)
1032 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1033 ifeq ($(LLVMConfigLibfiles),Error)
1034 $(error llvm-config --libfiles failed)
1036 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1043 # Set up the library exports file.
1044 ifdef EXPORTED_SYMBOL_FILE
1046 # First, set up the native export file, which may differ from the source
1049 ifeq ($(HOST_OS),Darwin)
1050 # Darwin convention prefixes symbols with underscores.
1051 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1052 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1053 $(Verb) sed -e 's/^/_/' < $< > $@
1055 -$(Verb) $(RM) -f $(NativeExportsFile)
1057 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1058 # Gold and BFD ld require a version script rather than a plain list.
1059 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1060 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1061 $(Verb) echo "{" > $@
1062 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1063 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1064 ifneq ($(HOST_OS),OpenBSD)
1065 $(Verb) echo " local: *;" >> $@
1067 $(Verb) echo "};" >> $@
1069 -$(Verb) $(RM) -f $(NativeExportsFile)
1071 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1072 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1073 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1074 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1075 $(Echo) Generating $(notdir $@)
1076 $(Verb) $(ECHO) "EXPORTS" > $@
1077 $(Verb) $(CAT) $< >> $@
1079 -$(Verb) $(RM) -f $(NativeExportsFile)
1081 # Default behavior: just use the exports file verbatim.
1082 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1087 # Now add the linker command-line options to use the native export file.
1090 ifeq ($(HOST_OS),Darwin)
1091 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1094 # gold, bfd ld, etc.
1095 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1096 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1100 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1101 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1102 SharedLinkOptions += $(NativeExportsFile)
1107 ###############################################################################
1108 # Library Build Rules: Four ways to build a library
1109 ###############################################################################
1111 #---------------------------------------------------------
1112 # Bytecode Module Targets:
1113 # If the user set MODULE_NAME then they want to build a
1114 # bytecode module from the sources. We compile all the
1115 # sources and link it together into a single bytecode
1117 #---------------------------------------------------------
1120 ifeq ($(strip $(LLVMCC)),)
1121 $(warning Modules require LLVM capable compiler but none is available ****)
1124 Module := $(LibDir)/$(MODULE_NAME).bc
1125 LinkModule := $(LLVMLD) -r
1128 ifdef EXPORTED_SYMBOL_FILE
1129 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1132 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1133 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1134 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1136 all-local:: $(Module)
1139 ifneq ($(strip $(Module)),)
1140 -$(Verb) $(RM) -f $(Module)
1143 ifdef BYTECODE_DESTINATION
1144 ModuleDestDir := $(BYTECODE_DESTINATION)
1146 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1151 $(Echo) Install circumvented with NO_INSTALL
1153 $(Echo) Uninstall circumvented with NO_INSTALL
1155 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1157 install-module:: $(DestModule)
1158 install-local:: $(DestModule)
1160 $(DestModule): $(ModuleDestDir) $(Module)
1161 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1162 $(Verb) $(DataInstall) $(Module) $(DestModule)
1165 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1166 -$(Verb) $(RM) -f $(DestModule)
1172 # if we're building a library ...
1175 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1176 LIBRARYNAME := $(strip $(LIBRARYNAME))
1177 ifdef LOADABLE_MODULE
1178 BaseLibName.A := $(LIBRARYNAME).a
1179 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1181 BaseLibName.A := lib$(LIBRARYNAME).a
1182 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1184 LibName.A := $(LibDir)/$(BaseLibName.A)
1185 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1186 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1187 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1189 #---------------------------------------------------------
1190 # Shared Library Targets:
1191 # If the user asked for a shared library to be built
1192 # with the SHARED_LIBRARY variable, then we provide
1193 # targets for building them.
1194 #---------------------------------------------------------
1195 ifdef SHARED_LIBRARY
1197 all-local:: $(LibName.SO)
1199 ifdef EXPORTED_SYMBOL_FILE
1200 $(LibName.SO): $(NativeExportsFile)
1203 ifdef LINK_LIBS_IN_SHARED
1204 ifdef LOADABLE_MODULE
1205 SharedLibKindMessage := "Loadable Module"
1206 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1208 SharedLibKindMessage := "Shared Library"
1210 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1211 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1213 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1214 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1216 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1217 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1218 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1222 ifneq ($(strip $(LibName.SO)),)
1223 -$(Verb) $(RM) -f $(LibName.SO)
1228 $(Echo) Install circumvented with NO_INSTALL
1230 $(Echo) Uninstall circumvented with NO_INSTALL
1233 # Win32.DLL prefers to be located on the "PATH" of binaries.
1234 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1235 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1237 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1239 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1241 install-local:: $(DestSharedLib)
1243 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1244 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1245 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1248 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1249 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1253 #---------------------------------------------------------
1254 # Bytecode Library Targets:
1255 # If the user asked for a bytecode library to be built
1256 # with the BYTECODE_LIBRARY variable, then we provide
1257 # targets for building them.
1258 #---------------------------------------------------------
1259 ifdef BYTECODE_LIBRARY
1260 ifeq ($(strip $(LLVMCC)),)
1261 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1264 all-local:: $(LibName.BCA)
1266 ifdef EXPORTED_SYMBOL_FILE
1267 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1269 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1270 $(LLVMToolDir)/llvm-ar
1271 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1273 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1275 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1277 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1278 $(LLVMToolDir)/llvm-ar
1279 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1281 $(Verb) $(LArchive) $@ $(ObjectsBC)
1286 ifneq ($(strip $(LibName.BCA)),)
1287 -$(Verb) $(RM) -f $(LibName.BCA)
1290 ifdef BYTECODE_DESTINATION
1291 BytecodeDestDir := $(BYTECODE_DESTINATION)
1293 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1296 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1298 install-bytecode-local:: $(DestBytecodeLib)
1302 $(Echo) Install circumvented with NO_INSTALL
1304 $(Echo) Uninstall circumvented with NO_INSTALL
1306 install-local:: $(DestBytecodeLib)
1308 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1309 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1310 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1313 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1314 -$(Verb) $(RM) -f $(DestBytecodeLib)
1319 #---------------------------------------------------------
1321 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1322 # building an archive.
1323 #---------------------------------------------------------
1324 ifndef NO_BUILD_ARCHIVE
1325 ifndef BUILD_ARCHIVE
1326 ifndef LOADABLE_MODULE
1332 #---------------------------------------------------------
1333 # Archive Library Targets:
1334 # If the user wanted a regular archive library built,
1335 # then we provide targets for building them.
1336 #---------------------------------------------------------
1339 all-local:: $(LibName.A)
1341 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1342 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1343 -$(Verb) $(RM) -f $@
1344 $(Verb) $(Archive) $@ $(ObjectsO)
1345 $(Verb) $(Ranlib) $@
1348 ifneq ($(strip $(LibName.A)),)
1349 -$(Verb) $(RM) -f $(LibName.A)
1354 $(Echo) Install circumvented with NO_INSTALL
1356 $(Echo) Uninstall circumvented with NO_INSTALL
1358 ifdef NO_INSTALL_ARCHIVES
1360 $(Echo) Install circumvented with NO_INSTALL
1362 $(Echo) Uninstall circumvented with NO_INSTALL
1364 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1366 install-local:: $(DestArchiveLib)
1368 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1369 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1370 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1371 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1374 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1375 -$(Verb) $(RM) -f $(DestArchiveLib)
1383 ###############################################################################
1384 # Tool Build Rules: Build executable tool based on TOOLNAME option
1385 ###############################################################################
1389 #---------------------------------------------------------
1390 # Set up variables for building a tool.
1391 #---------------------------------------------------------
1392 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1394 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1396 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1399 # TOOLALIAS is a name to symlink (or copy) the tool to.
1402 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1404 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1408 #---------------------------------------------------------
1410 #---------------------------------------------------------
1412 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1413 # not exporting all of the weak symbols from the binary. This reduces dyld
1414 # startup time by 4x on darwin in some cases.
1415 ifdef TOOL_NO_EXPORTS
1416 ifeq ($(HOST_OS),Darwin)
1418 # Tiger tools don't support this.
1419 ifneq ($(DARWIN_MAJVERS),4)
1420 LD.Flags += -Wl,-exported_symbol,_main
1424 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1425 ifneq ($(ARCH), Mips)
1426 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1431 #---------------------------------------------------------
1432 # Tool Order File Support
1433 #---------------------------------------------------------
1435 ifeq ($(HOST_OS),Darwin)
1436 ifdef TOOL_ORDER_FILE
1438 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1443 #---------------------------------------------------------
1444 # Tool Version Info Support
1445 #---------------------------------------------------------
1447 ifeq ($(HOST_OS),Darwin)
1448 ifdef TOOL_INFO_PLIST
1450 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1452 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1454 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1455 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1456 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1457 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1458 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1459 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1465 #---------------------------------------------------------
1466 # Provide targets for building the tools
1467 #---------------------------------------------------------
1468 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1471 ifneq ($(strip $(ToolBuildPath)),)
1472 -$(Verb) $(RM) -f $(ToolBuildPath)
1474 ifneq ($(strip $(ToolAliasBuildPath)),)
1475 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1479 $(ToolBuildPath): $(ExmplDir)/.dir
1481 $(ToolBuildPath): $(ToolDir)/.dir
1484 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1485 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1486 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1487 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1488 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1491 ifneq ($(strip $(ToolAliasBuildPath)),)
1492 $(ToolAliasBuildPath): $(ToolBuildPath)
1493 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1494 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1495 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1496 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1502 $(Echo) Install circumvented with NO_INSTALL
1504 $(Echo) Uninstall circumvented with NO_INSTALL
1508 ToolBinDir = $(DESTDIR)$(PROJ_internal_prefix)/bin
1510 ToolBinDir = $(DESTDIR)$(PROJ_bindir)
1512 DestTool = $(ToolBinDir)/$(TOOLEXENAME)
1514 install-local:: $(DestTool)
1516 $(DestTool): $(ToolBuildPath)
1517 $(Echo) Installing $(BuildMode) $(DestTool)
1518 $(Verb) $(MKDIR) $(ToolBinDir)
1519 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1522 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1523 -$(Verb) $(RM) -f $(DestTool)
1525 # TOOLALIAS install.
1527 DestToolAlias = $(ToolBinDir)/$(TOOLALIAS)$(EXEEXT)
1529 install-local:: $(DestToolAlias)
1531 $(DestToolAlias): $(DestTool)
1532 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1533 $(Verb) $(RM) -f $(DestToolAlias)
1534 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1537 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1538 -$(Verb) $(RM) -f $(DestToolAlias)
1544 ###############################################################################
1545 # Object Build Rules: Build object files based on sources
1546 ###############################################################################
1548 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1549 ifeq ($(HOST_OS),HP-UX)
1550 DISABLE_AUTO_DEPENDENCIES=1
1553 # Provide rule sets for when dependency generation is enabled
1554 ifndef DISABLE_AUTO_DEPENDENCIES
1556 #---------------------------------------------------------
1557 # Create .o files in the ObjDir directory from the .cpp and .c files...
1558 #---------------------------------------------------------
1560 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1561 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1563 # If the build succeeded, move the dependency file over, otherwise
1565 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1566 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1568 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1569 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1570 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1573 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1574 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1575 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1578 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1579 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1580 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1583 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1584 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1585 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1588 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1589 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1590 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1593 #---------------------------------------------------------
1594 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1595 #---------------------------------------------------------
1597 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1598 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1600 # If the build succeeded, move the dependency file over, otherwise
1602 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1603 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1605 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1606 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1607 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1608 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1609 $(BC_DEPEND_MOVEFILE)
1611 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1612 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1613 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1614 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1615 $(BC_DEPEND_MOVEFILE)
1617 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1618 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1619 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1620 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1621 $(BC_DEPEND_MOVEFILE)
1623 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1624 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1625 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1626 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1627 $(BC_DEPEND_MOVEFILE)
1629 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1630 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1631 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1632 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1633 $(BC_DEPEND_MOVEFILE)
1635 # Provide alternate rule sets if dependencies are disabled
1638 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1639 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1640 $(Compile.CXX) $< -o $@
1642 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1643 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1644 $(Compile.CXX) $< -o $@
1646 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1647 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1648 $(Compile.CXX) $< -o $@
1650 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1651 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1652 $(Compile.C) $< -o $@
1654 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1655 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1656 $(Compile.C) $< -o $@
1658 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1659 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1660 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1662 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1663 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1664 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1666 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1667 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1668 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1670 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1671 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1672 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1674 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1675 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1676 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1681 ## Rules for building preprocessed (.i/.ii) outputs.
1682 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1683 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1684 $(Verb) $(Preprocess.CXX) $< -o $@
1686 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1687 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1688 $(Verb) $(Preprocess.CXX) $< -o $@
1690 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1691 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1692 $(Verb) $(Preprocess.CXX) $< -o $@
1694 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1695 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1696 $(Verb) $(Preprocess.C) $< -o $@
1698 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1699 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1700 $(Verb) $(Preprocess.C) $< -o $@
1703 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1704 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1705 $(Compile.CXX) $< -o $@ -S
1707 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1708 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1709 $(Compile.CXX) $< -o $@ -S
1711 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1712 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1713 $(Compile.CXX) $< -o $@ -S
1715 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1716 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1717 $(Compile.C) $< -o $@ -S
1719 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1720 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1721 $(Compile.C) $< -o $@ -S
1724 # make the C and C++ compilers strip debug info out of bytecode libraries.
1726 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1727 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1728 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1730 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1731 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1732 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1736 #---------------------------------------------------------
1737 # Provide rule to build .bc files from .ll sources,
1738 # regardless of dependencies
1739 #---------------------------------------------------------
1740 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1741 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1742 $(Verb) $(LLVMAS) $< -f -o $@
1744 ###############################################################################
1745 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1746 ###############################################################################
1749 TABLEGEN_INC_FILES_COMMON = 1
1752 ifdef TABLEGEN_INC_FILES_COMMON
1754 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1755 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1756 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1758 # INCFiles rule: All of the tblgen generated files are emitted to
1759 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1760 # us to only "touch" the real file if the contents of it change. IOW, if
1761 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1762 # dependencies of the .inc files are, unless the contents of the .inc file
1764 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1765 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1767 endif # TABLEGEN_INC_FILES_COMMON
1771 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1772 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1773 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1774 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1775 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1776 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1777 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1779 # All .inc.tmp files depend on the .td files.
1780 $(INCTMPFiles) : $(TDFiles)
1782 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1783 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1784 $(Echo) "Building $(<F) register info implementation with tblgen"
1785 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1787 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1788 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1789 $(Echo) "Building $(<F) instruction information with tblgen"
1790 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1792 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1793 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1794 $(Echo) "Building $(<F) assembly writer with tblgen"
1795 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1797 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1798 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1799 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1800 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1802 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1803 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1804 $(Echo) "Building $(<F) assembly matcher with tblgen"
1805 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1807 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1808 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1809 $(Echo) "Building $(<F) MC code emitter with tblgen"
1810 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1812 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1813 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1814 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1815 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1817 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1818 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1819 $(Echo) "Building $(<F) code emitter with tblgen"
1820 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1822 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1823 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1824 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1825 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1827 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1828 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1829 $(Echo) "Building $(<F) disassembly tables with tblgen"
1830 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1832 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1833 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1834 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1835 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1837 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1838 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1839 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1840 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1842 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1843 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1844 $(Echo) "Building $(<F) subtarget information with tblgen"
1845 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1847 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1848 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1849 $(Echo) "Building $(<F) calling convention information with tblgen"
1850 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1852 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1853 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1854 $(Echo) "Building $(<F) intrinsics information with tblgen"
1855 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1857 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1858 $(Echo) "Building $(<F) decoder tables with tblgen"
1859 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1861 $(ObjDir)/%GenDFAPacketizer.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1862 $(Echo) "Building $(<F) DFA packetizer tables with tblgen"
1863 $(Verb) $(LLVMTableGen) -gen-dfa-packetizer -o $(call SYSPATH, $@) $<
1866 -$(Verb) $(RM) -f $(INCFiles)
1870 ###############################################################################
1871 # OTHER RULES: Other rules needed
1872 ###############################################################################
1874 # To create postscript files from dot files...
1875 ifneq ($(DOT),false)
1877 $(DOT) -Tps < $< > $@
1880 $(Echo) "Cannot build $@: The program dot is not installed"
1883 # This rules ensures that header files that are removed still have a rule for
1884 # which they can be "generated." This allows make to ignore them and
1885 # reproduce the dependency lists.
1889 # Define clean-local to clean the current directory. Note that this uses a
1890 # very conservative approach ensuring that empty variables do not cause
1891 # errors or disastrous removal.
1893 ifneq ($(strip $(ObjRootDir)),)
1894 -$(Verb) $(RM) -rf $(ObjRootDir)
1896 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1897 -$(Verb) $(RM) -f *$(SHLIBEXT)
1901 -$(Verb) $(RM) -rf Debug Release Profile
1904 ###############################################################################
1905 # DEPENDENCIES: Include the dependency files if we should
1906 ###############################################################################
1907 ifndef DISABLE_AUTO_DEPENDENCIES
1909 # If its not one of the cleaning targets
1910 ifndef IS_CLEANING_TARGET
1912 # Get the list of dependency files
1913 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1914 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1916 # Include bitcode dependency files if using bitcode libraries
1917 ifdef BYTECODE_LIBRARY
1918 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1921 -include $(DependFiles) ""
1927 ###############################################################################
1928 # CHECK: Running the test suite
1929 ###############################################################################
1932 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1933 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1934 $(EchoCmd) Running test suite ; \
1935 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1936 TESTSUITE=$(TESTSUITE) ; \
1938 $(EchoCmd) No Makefile in test directory ; \
1941 $(EchoCmd) No test directory ; \
1947 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1948 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1949 $(EchoCmd) Running test suite ; \
1950 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1952 $(EchoCmd) No Makefile in test directory ; \
1955 $(EchoCmd) No test directory ; \
1959 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1960 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1961 $(EchoCmd) Running test suite ; \
1962 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1964 $(EchoCmd) No Makefile in test directory ; \
1967 $(EchoCmd) No test directory ; \
1970 ###############################################################################
1971 # UNITTESTS: Running the unittests test suite
1972 ###############################################################################
1975 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1976 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1977 $(EchoCmd) Running unittests test suite ; \
1978 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1980 $(EchoCmd) No Makefile in unittests directory ; \
1983 $(EchoCmd) No unittests directory ; \
1986 ###############################################################################
1987 # DISTRIBUTION: Handle construction of a distribution tarball
1988 ###############################################################################
1990 #------------------------------------------------------------------------
1991 # Define distribution related variables
1992 #------------------------------------------------------------------------
1993 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1994 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1995 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1996 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1997 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1998 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1999 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
2000 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
2001 Makefile.config.in configure autoconf
2002 DistOther := $(notdir $(wildcard \
2003 $(PROJ_SRC_DIR)/*.h \
2004 $(PROJ_SRC_DIR)/*.td \
2005 $(PROJ_SRC_DIR)/*.def \
2006 $(PROJ_SRC_DIR)/*.ll \
2007 $(PROJ_SRC_DIR)/*.in))
2008 DistSubDirs := $(SubDirs)
2009 DistSources = $(Sources) $(EXTRA_DIST)
2010 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2012 #------------------------------------------------------------------------
2013 # We MUST build distribution with OBJ_DIR != SRC_DIR
2014 #------------------------------------------------------------------------
2015 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2016 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2017 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2021 #------------------------------------------------------------------------
2022 # Prevent attempt to run dist targets from anywhere but the top level
2023 #------------------------------------------------------------------------
2025 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2026 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2029 #------------------------------------------------------------------------
2030 # Provide the top level targets
2031 #------------------------------------------------------------------------
2033 dist-gzip:: $(DistTarGZip)
2035 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2036 $(Echo) Packing gzipped distribution tar file.
2037 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2038 $(GZIP) -c > "$(DistTarGZip)"
2040 dist-bzip2:: $(DistTarBZ2)
2042 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2043 $(Echo) Packing bzipped distribution tar file.
2044 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2045 $(BZIP2) -c >$(DistTarBZ2)
2047 dist-zip:: $(DistZip)
2049 $(DistZip) : $(TopDistDir)/.makedistdir
2050 $(Echo) Packing zipped distribution file.
2051 $(Verb) rm -f $(DistZip)
2052 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2054 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2055 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2057 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2059 dist-check:: $(DistTarGZip)
2060 $(Echo) Checking distribution tar file.
2061 $(Verb) if test -d $(DistCheckDir) ; then \
2062 $(RM) -rf $(DistCheckDir) ; \
2064 $(Verb) $(MKDIR) $(DistCheckDir)
2065 $(Verb) cd $(DistCheckDir) && \
2066 $(MKDIR) $(DistCheckDir)/build && \
2067 $(MKDIR) $(DistCheckDir)/install && \
2068 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2070 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2071 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2074 $(MAKE) unittests && \
2075 $(MAKE) install && \
2076 $(MAKE) uninstall && \
2077 $(MAKE) dist-clean && \
2078 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2081 $(Echo) Cleaning distribution files
2082 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2087 #------------------------------------------------------------------------
2088 # Provide the recursive distdir target for building the distribution directory
2089 #------------------------------------------------------------------------
2090 distdir: $(DistDir)/.makedistdir
2091 $(DistDir)/.makedistdir: $(DistSources)
2092 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2093 if test -d "$(DistDir)" ; then \
2094 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2097 $(EchoCmd) Removing old $(DistDir) ; \
2098 $(RM) -rf $(DistDir); \
2099 $(EchoCmd) Making 'all' to verify build ; \
2100 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2102 $(Echo) Building Distribution Directory $(DistDir)
2103 $(Verb) $(MKDIR) $(DistDir)
2104 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2105 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2106 for file in $(DistFiles) ; do \
2108 $(PROJ_SRC_DIR)/*) \
2109 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2111 $(PROJ_SRC_ROOT)/*) \
2112 file=`echo "$$file" | \
2113 sed "s#^$$srcrootstrip/##"` \
2116 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2117 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2118 from_dir="$(PROJ_SRC_DIR)" ; \
2119 elif test -f "$$file" || test -d "$$file" ; then \
2122 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2123 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2124 to_dir="$(DistDir)/$$dir"; \
2125 $(MKDIR) "$$to_dir" ; \
2127 to_dir="$(DistDir)"; \
2129 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2130 if test -n "$$mid_dir" ; then \
2131 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2133 if test -d "$$from_dir/$$file"; then \
2134 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2135 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2136 cd $(PROJ_SRC_DIR) ; \
2137 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2138 ( cd $$to_dir ; $(TAR) xf - ) ; \
2139 cd $(PROJ_OBJ_DIR) ; \
2142 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2143 ( cd $$to_dir ; $(TAR) xf - ) ; \
2144 cd $(PROJ_OBJ_DIR) ; \
2146 elif test -f "$$from_dir/$$file" ; then \
2147 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2148 elif test -L "$$from_dir/$$file" ; then \
2149 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2150 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2151 $(EchoCmd) "===== WARNING: Distribution Source " \
2152 "$$from_dir/$$file Not Found!" ; \
2153 elif test "$(Verb)" != '@' ; then \
2154 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2157 $(Verb) for subdir in $(DistSubDirs) ; do \
2158 if test "$$subdir" \!= "." ; then \
2159 new_distdir="$(DistDir)/$$subdir" ; \
2160 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2161 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2162 DistDir="$$new_distdir" distdir ) || exit 1; \
2165 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2166 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2167 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2168 -name .svn \) -print` ;\
2169 $(MAKE) dist-hook ; \
2170 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2171 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2172 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2173 -o ! -type d ! -perm -444 -exec \
2174 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2175 || chmod -R a+r $(DistDir) ; \
2178 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2184 ###############################################################################
2185 # TOP LEVEL - targets only to apply at the top level directory
2186 ###############################################################################
2190 #------------------------------------------------------------------------
2191 # Install support for the project's include files:
2192 #------------------------------------------------------------------------
2195 $(Echo) Install circumvented with NO_INSTALL
2197 $(Echo) Uninstall circumvented with NO_INSTALL
2200 $(Echo) Installing include files
2201 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2202 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2203 cd $(PROJ_SRC_ROOT)/include && \
2204 for hdr in `find . -type f \
2205 '(' -name LICENSE.TXT \
2210 ')' -print | grep -v CVS | \
2211 grep -v .svn` ; do \
2212 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2213 if test \! -d "$$instdir" ; then \
2214 $(EchoCmd) Making install directory $$instdir ; \
2215 $(MKDIR) $$instdir ;\
2217 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2220 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2221 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2222 cd $(PROJ_OBJ_ROOT)/include && \
2223 for hdr in `find . -type f \
2224 '(' -name LICENSE.TXT \
2229 ')' -print | grep -v CVS | \
2230 grep -v .svn` ; do \
2231 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2232 if test \! -d "$$instdir" ; then \
2233 $(EchoCmd) Making install directory $$instdir ; \
2234 $(MKDIR) $$instdir ;\
2236 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2242 $(Echo) Uninstalling include files
2243 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2244 cd $(PROJ_SRC_ROOT)/include && \
2245 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2246 '!' '(' -name '*~' -o -name '.#*' \
2247 -o -name '*.in' ')' -print ')' | \
2248 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2249 cd $(PROJ_SRC_ROOT)/include && \
2250 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2251 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2257 @echo searching for overlength lines in files: $(Sources)
2260 egrep -n '.{81}' $(Sources) /dev/null
2263 @echo searching for tabs in files: $(Sources)
2266 egrep -n ' ' $(Sources) /dev/null
2269 @ls -l $(LibDir) | awk '\
2270 BEGIN { sum = 0; } \
2272 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2273 @ls -l $(ToolDir) | awk '\
2274 BEGIN { sum = 0; } \
2276 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2277 #------------------------------------------------------------------------
2278 # Print out the directories used for building
2279 #------------------------------------------------------------------------
2281 $(Echo) "BuildMode : " '$(BuildMode)'
2282 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2283 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2284 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2285 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2286 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2287 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2288 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2289 $(Echo) "PROJ_internal_prefix : " '$(PROJ_internal_prefix)'
2290 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2291 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2292 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2293 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2294 $(Echo) "UserTargets : " '$(UserTargets)'
2295 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2296 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2297 $(Echo) "ObjDir : " '$(ObjDir)'
2298 $(Echo) "LibDir : " '$(LibDir)'
2299 $(Echo) "ToolDir : " '$(ToolDir)'
2300 $(Echo) "ExmplDir : " '$(ExmplDir)'
2301 $(Echo) "Sources : " '$(Sources)'
2302 $(Echo) "TDFiles : " '$(TDFiles)'
2303 $(Echo) "INCFiles : " '$(INCFiles)'
2304 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2305 $(Echo) "PreConditions: " '$(PreConditions)'
2306 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2307 $(Echo) "Compile.C : " '$(Compile.C)'
2308 $(Echo) "Archive : " '$(Archive)'
2309 $(Echo) "YaccFiles : " '$(YaccFiles)'
2310 $(Echo) "LexFiles : " '$(LexFiles)'
2311 $(Echo) "Module : " '$(Module)'
2312 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2313 $(Echo) "SubDirs : " '$(SubDirs)'
2314 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2315 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2320 # General debugging rule, use 'make dbg-print-XXX' to print the
2321 # definition, value and origin of XXX.
2323 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))