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-2/LibraryDependencies.inc
84 # The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
87 # Note that this target gets its real dependencies generated for us by
90 # We include a dependency on this Makefile to ensure that changes to the
91 # generation command get picked up.
92 $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
93 $(Echo) Constructing LLVMBuild project information.
94 $(Verb) $(LLVMBuildTool) \
95 --write-library-table $(LLVMConfigLibraryDependenciesInc) \
96 --write-make-fragment $(LLVMBuildMakeFrag)
98 # For completeness, let Make know how the extra files are generated.
99 $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
101 # Include the generated Makefile fragment.
103 # We currently only include the dependencies for the fragment itself if we are
104 # at the top-level. Otherwise, recursive invocations would ends up doing
105 # substantially more redundant stat'ing.
107 # This means that we won't properly regenerate things for developers used to
108 # building from a subdirectory, but that is always somewhat unreliable.
110 LLVMBUILD_INCLUDE_DEPENDENCIES := 1
112 -include $(LLVMBuildMakeFrag)
114 ################################################################################
115 # PRECONDITIONS: that which must be built/checked first
116 ################################################################################
118 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
119 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
120 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
121 ConfigureScript := $(PROJ_SRC_ROOT)/configure
122 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
123 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
124 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
125 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
126 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
127 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
128 ifneq ($(MakefileCommonIn),)
129 PreConditions += $(MakefileCommon)
132 ifneq ($(MakefileConfigIn),)
133 PreConditions += $(MakefileConfig)
136 preconditions: $(PreConditions)
138 #------------------------------------------------------------------------
139 # Make sure the BUILT_SOURCES are built first
140 #------------------------------------------------------------------------
141 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
144 ifneq ($(strip $(BUILT_SOURCES)),)
145 -$(Verb) $(RM) -f $(BUILT_SOURCES)
148 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
150 $(Verb) if test -x config.status ; then \
151 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
152 $(MKDIR) .spotless.save ; \
153 $(MV) config.status .spotless.save ; \
154 $(MV) mklib .spotless.save ; \
155 $(MV) projects .spotless.save ; \
157 $(MV) .spotless.save/config.status . ; \
158 $(MV) .spotless.save/mklib . ; \
159 $(MV) .spotless.save/projects . ; \
160 $(RM) -rf .spotless.save ; \
161 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
162 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
163 $(ConfigStatusScript) ; \
165 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
169 $(EchoCmd) "spotless target not supported for objdir == srcdir"
172 $(BUILT_SOURCES) : $(ObjMakefiles)
174 #------------------------------------------------------------------------
175 # Make sure we're not using a stale configuration
176 #------------------------------------------------------------------------
178 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
179 $(Verb) cd $(PROJ_OBJ_ROOT) && \
180 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
181 $(ConfigStatusScript)
183 .PRECIOUS: $(ConfigStatusScript)
184 $(ConfigStatusScript): $(ConfigureScript)
185 $(Echo) Reconfiguring with $<
186 $(Verb) cd $(PROJ_OBJ_ROOT) && \
187 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
188 $(ConfigStatusScript)
190 #------------------------------------------------------------------------
191 # Make sure the configuration makefile is up to date
192 #------------------------------------------------------------------------
193 ifneq ($(MakefileConfigIn),)
194 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
195 $(Echo) Regenerating $@
196 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
199 ifneq ($(MakefileCommonIn),)
200 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
201 $(Echo) Regenerating $@
202 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
205 #------------------------------------------------------------------------
206 # If the Makefile in the source tree has been updated, copy it over into the
207 # build tree. But, only do this if the source and object makefiles differ
208 #------------------------------------------------------------------------
210 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
213 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
215 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
216 $(Echo) "Updating Makefile"
217 $(Verb) $(MKDIR) $(@D)
218 $(Verb) $(CP) -f $< $@
220 # Copy the Makefile.* files unless we're in the root directory which avoids
221 # the copying of Makefile.config.in or other things that should be explicitly
223 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
225 *Makefile.rules) ;; \
227 *) $(EchoCmd) "Updating $(@F)" ; \
234 #------------------------------------------------------------------------
235 # Set up the basic dependencies
236 #------------------------------------------------------------------------
237 $(UserTargets):: $(PreConditions)
241 clean-all:: clean-local clean-all-local
242 install:: install-local
243 uninstall:: uninstall-local
244 install-local:: all-local
245 install-bytecode:: install-bytecode-local
247 ###############################################################################
248 # VARIABLES: Set up various variables based on configuration data
249 ###############################################################################
251 # Variable for if this make is for a "cleaning" target
252 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
256 #--------------------------------------------------------------------
257 # Variables derived from configuration we are building
258 #--------------------------------------------------------------------
261 ifeq ($(ENABLE_OPTIMIZED),1)
263 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
264 ifneq ($(HOST_OS),FreeBSD)
265 ifneq ($(HOST_OS),Darwin)
266 OmitFramePointer := -fomit-frame-pointer
270 # Darwin requires -fstrict-aliasing to be explicitly enabled.
271 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
272 # with -fstrict-aliasing and ipa-type-escape radr://6756684
273 #ifeq ($(HOST_OS),Darwin)
274 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
276 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
277 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
278 LD.Flags += $(OPTIMIZE_OPTION)
280 BuildMode := $(BuildMode)+Debug
287 ifdef NO_DEBUG_SYMBOLS
288 BuildMode := Unoptimized
302 ifeq ($(ENABLE_PROFILING),1)
303 BuildMode := $(BuildMode)+Profile
304 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
305 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
306 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
310 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
311 # CXX.Flags += -fvisibility-inlines-hidden
314 ifdef ENABLE_EXPENSIVE_CHECKS
315 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
316 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
320 # IF REQUIRES_EH=1 is specified then don't disable exceptions
322 CXX.Flags += -fno-exceptions
324 # If the library requires EH, it also requires RTTI.
328 ifdef REQUIRES_FRAME_POINTER
329 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
330 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
331 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
334 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
335 ifneq ($(REQUIRES_RTTI), 1)
336 CXX.Flags += -fno-rtti
339 ifeq ($(ENABLE_COVERAGE),1)
340 BuildMode := $(BuildMode)+Coverage
341 CXX.Flags += -ftest-coverage -fprofile-arcs
342 C.Flags += -ftest-coverage -fprofile-arcs
345 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
346 # then disable assertions by defining the appropriate preprocessor symbols.
347 ifeq ($(DISABLE_ASSERTIONS),1)
348 CPP.Defines += -DNDEBUG
350 BuildMode := $(BuildMode)+Asserts
351 CPP.Defines += -D_DEBUG
354 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
355 # configured), then enable expensive checks by defining the
356 # appropriate preprocessor symbols.
357 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
358 BuildMode := $(BuildMode)+Checks
359 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
362 # LOADABLE_MODULE implies several other things so we force them to be
364 ifdef LOADABLE_MODULE
366 LINK_LIBS_IN_SHARED := 1
374 ifeq ($(ENABLE_PIC),1)
375 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
376 # Nothing. Win32 defaults to PIC and warns when given -fPIC
378 ifeq ($(HOST_OS),Darwin)
379 # Common symbols not allowed in dylib files
380 CXX.Flags += -fno-common
381 C.Flags += -fno-common
383 # Linux and others; pass -fPIC
389 ifeq ($(HOST_OS),Darwin)
390 CXX.Flags += -mdynamic-no-pic
391 C.Flags += -mdynamic-no-pic
395 # Support makefile variable to disable any kind of timestamp/non-deterministic
396 # info from being used in the build.
397 ifeq ($(ENABLE_TIMESTAMPS),1)
398 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
400 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
403 ifeq ($(HOST_OS),MingW)
405 CPP.Defines += -D__NO_CTYPE_INLINE
406 ifeq ($(LLVM_CROSS_COMPILING),1)
407 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
409 LD.Flags += -Wl,--allow-multiple-definition
414 CXX.Flags += -Woverloaded-virtual
415 CPP.BaseFlags += $(CPP.Defines)
418 # Make Floating point IEEE compliant on Alpha.
421 CPP.BaseFlags += -mieee
422 ifeq ($(ENABLE_PIC),0)
424 CPP.BaseFlags += -fPIC
427 LD.Flags += -Wl,--no-relax
430 # GNU ld/PECOFF accepts but ignores them below;
434 # FIXME: autoconf should be aware of them.
435 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
436 HAVE_LINK_VERSION_SCRIPT := 0
438 RDYNAMIC := -Wl,--export-all-symbols
441 #--------------------------------------------------------------------
442 # Directory locations
443 #--------------------------------------------------------------------
445 ifeq ($(LLVM_CROSS_COMPILING),1)
446 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
449 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
450 ObjDir := $(ObjRootDir)
451 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
452 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
453 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
454 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
455 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
456 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
458 #--------------------------------------------------------------------
459 # Locations of shared libraries
460 #--------------------------------------------------------------------
463 SharedLibDir := $(LibDir)
464 LLVMSharedLibDir := $(LLVMLibDir)
466 # Win32.DLL prefers to be located on the "PATH" of binaries.
467 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
468 SharedLibDir := $(ToolDir)
469 LLVMSharedLibDir := $(LLVMToolDir)
471 ifeq ($(HOST_OS),Cygwin)
478 #--------------------------------------------------------------------
479 # LLVM Capable Compiler
480 #--------------------------------------------------------------------
482 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
484 LLVMCXX := $(LLVMGXX)
486 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
487 ifneq ($(CLANGPATH),)
488 LLVMCC := $(CLANGPATH)
489 LLVMCXX := $(CLANGXXPATH)
491 ifeq ($(ENABLE_BUILT_CLANG),1)
492 LLVMCC := $(LLVMToolDir)/clang
493 LLVMCXX := $(LLVMToolDir)/clang++
499 #--------------------------------------------------------------------
500 # Full Paths To Compiled Tools and Utilities
501 #--------------------------------------------------------------------
502 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
505 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
508 ifeq ($(LLVM_CROSS_COMPILING),1)
509 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
511 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
514 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
516 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
519 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
522 LLI := $(LLVMToolDir)/lli$(EXEEXT)
525 LLC := $(LLVMToolDir)/llc$(EXEEXT)
528 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
531 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
534 #--------------------------------------------------------------------
535 # Adjust to user's request
536 #--------------------------------------------------------------------
538 ifeq ($(HOST_OS),Darwin)
539 DARWIN_VERSION := `sw_vers -productVersion`
540 # Strip a number like 10.4.7 to 10.4
541 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
542 # Get "4" out of 10.4 for later pieces in the makefile.
543 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
545 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
546 SharedLinkOptions := -dynamiclib
548 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
551 SharedLinkOptions=-shared
554 ifeq ($(TARGET_OS),Darwin)
556 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
561 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
562 ifneq ($(HOST_OS),Darwin)
563 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
575 # Adjust settings for verbose mode
578 AR.Flags += >/dev/null 2>/dev/null
579 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
581 ConfigureScriptFLAGS :=
584 # By default, strip symbol information from executable
586 Strip := $(PLATFORMSTRIPOPTS)
587 StripWarnMsg := "(without symbols)"
588 Install.StripFlag += -s
591 ifdef TOOL_NO_EXPORTS
594 DynamicFlag := $(RDYNAMIC)
597 # Adjust linker flags for building an executable
598 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
599 ifneq ($(HOST_OS), Darwin)
601 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
603 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
605 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
609 ifneq ($(DARWIN_MAJVERS),4)
610 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
616 #----------------------------------------------------------
617 # Options To Invoke Tools
618 #----------------------------------------------------------
620 ifdef EXTRA_LD_OPTIONS
621 LD.Flags += $(EXTRA_LD_OPTIONS)
625 CompileCommonOpts += -pedantic -Wno-long-long
627 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
629 # Enable cast-qual for C++; the workaround is to use const_cast.
630 CXX.Flags += -Wcast-qual
632 ifeq ($(HOST_OS),HP-UX)
633 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
636 # If we are building a universal binary on Mac OS/X, pass extra options. This
637 # is useful to people that want to link the LLVM libraries into their universal
640 # The following can be optionally specified:
641 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
642 # For Mac OS/X 10.4 Intel machines, the traditional one is:
643 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
644 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
645 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
648 ifndef UNIVERSAL_ARCH
649 UNIVERSAL_ARCH := i386 ppc
651 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
652 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
653 ifdef UNIVERSAL_SDK_PATH
654 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
657 # Building universal cannot compute dependencies automatically.
658 DISABLE_AUTO_DEPENDENCIES=1
660 ifeq ($(TARGET_OS),Darwin)
661 ifeq ($(ARCH),x86_64)
662 TargetCommonOpts = -m64
665 TargetCommonOpts = -m32
671 ifeq ($(HOST_OS),SunOS)
672 CPP.BaseFlags += -include llvm/Support/Solaris.h
675 ifeq ($(HOST_OS),AuroraUX)
676 CPP.BaseFlags += -include llvm/Support/Solaris.h
677 endif # !HOST_OS - AuroraUX.
679 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
680 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
681 # All -I flags should go here, so that they don't confuse llvm-config.
682 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
683 $(patsubst %,-I%/include,\
684 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
685 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
688 ifeq ($(INCLUDE_BUILD_DIR),1)
689 CPP.Flags += -I$(ObjDir)
692 # SHOW_DIAGNOSTICS support.
693 ifeq ($(SHOW_DIAGNOSTICS),1)
694 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
695 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
700 ifeq ($(BUILD_COMPONENT), 1)
701 Compile.C = $(Compile.Wrapper) \
702 $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
703 $(TargetCommonOpts) $(CompileCommonOpts) -c
704 Compile.CXX = $(Compile.Wrapper) \
705 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
707 $(TargetCommonOpts) $(CompileCommonOpts) -c
708 Preprocess.CXX= $(Compile.Wrapper) \
709 $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
710 $(CompileCommonOpts) $(CXX.Flags) -E
711 Link = $(Compile.Wrapper) \
712 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
713 $(LD.Flags) $(LDFLAGS) \
714 $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
716 Compile.C = $(Compile.Wrapper) \
717 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
718 $(TargetCommonOpts) $(CompileCommonOpts) -c
719 Compile.CXX = $(Compile.Wrapper) \
720 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
721 $(TargetCommonOpts) $(CompileCommonOpts) -c
722 Preprocess.CXX= $(Compile.Wrapper) \
723 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
724 $(CompileCommonOpts) $(CXX.Flags) -E
725 Link = $(Compile.Wrapper) \
726 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
727 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
730 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
731 $(TargetCommonOpts) $(CompileCommonOpts)
732 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
733 $(TargetCommonOpts) $(CompileCommonOpts) -E
735 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
736 $(TargetCommonOpts) $(CompileCommonOpts)
738 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
739 ScriptInstall = $(INSTALL) -m 0755
740 DataInstall = $(INSTALL) -m 0644
742 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
743 # paths. In this case, the SYSPATH function (defined in
744 # Makefile.config) transforms Unix paths into Windows paths.
745 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
746 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
747 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
748 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
749 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
751 Archive = $(AR) $(AR.Flags)
752 LArchive = $(LLVMToolDir)/llvm-ar rcsf
761 #----------------------------------------------------------
762 # Get the list of source files and compute object file
764 #----------------------------------------------------------
767 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
768 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
770 Sources := $(SOURCES)
774 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
777 BaseNameSources := $(sort $(basename $(Sources)))
779 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
780 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
782 #----------------------------------------------------------
783 # For Mingw MSYS bash and Python/w32:
785 # $(ECHOPATH) prints DOSish pathstring.
786 # ex) $(ECHOPATH) /include/sys/types.h
787 # --> C:/mingw/include/sys/types.h
788 # built-in "echo" does not transform path to DOSish path.
790 # FIXME: It would not be needed when MSYS's python
792 #----------------------------------------------------------
794 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
795 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
797 ECHOPATH := $(Verb)$(ECHO)
800 ###############################################################################
801 # DIRECTORIES: Handle recursive descent of directory structure
802 ###############################################################################
804 #---------------------------------------------------------
805 # Provide rules to make install dirs. This must be early
806 # in the file so they get built before dependencies
807 #---------------------------------------------------------
809 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
812 # To create other directories, as needed, and timestamp their creation
814 $(Verb) $(MKDIR) $* > /dev/null
815 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
817 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
818 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
820 #---------------------------------------------------------
821 # Handle the DIRS options for sequential construction
822 #---------------------------------------------------------
828 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
829 $(RecursiveTargets)::
830 $(Verb) for dir in $(DIRS); do \
831 if ([ ! -f $$dir/Makefile ] || \
832 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
834 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
836 ($(MAKE) -C $$dir $@ ) || exit 1; \
839 $(RecursiveTargets)::
840 $(Verb) for dir in $(DIRS); do \
841 ($(MAKE) -C $$dir $@ ) || exit 1; \
847 #---------------------------------------------------------
848 # Handle the EXPERIMENTAL_DIRS options ensuring success
849 # after each directory is built.
850 #---------------------------------------------------------
851 ifdef EXPERIMENTAL_DIRS
852 $(RecursiveTargets)::
853 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
854 if ([ ! -f $$dir/Makefile ] || \
855 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
857 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
859 ($(MAKE) -C $$dir $@ ) || exit 0; \
863 #-----------------------------------------------------------
864 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
865 #-----------------------------------------------------------
866 ifdef OPTIONAL_PARALLEL_DIRS
867 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
870 #-----------------------------------------------------------
871 # Handle the PARALLEL_DIRS options for parallel construction
872 #-----------------------------------------------------------
875 SubDirs += $(PARALLEL_DIRS)
877 # Unfortunately, this list must be maintained if new recursive targets are added
878 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
879 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
880 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
881 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
882 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
883 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
884 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
886 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
890 SD=$(PROJ_SRC_DIR)/$(@D); \
892 if [ ! -f $$SD/Makefile ]; then \
894 DD=$(notdir $(@D)); \
896 if ([ ! -f $$DD/Makefile ] || \
897 command test $$DD/Makefile -ot \
898 $$SD/Makefile ); then \
900 $(CP) $$SD/Makefile $$DD/Makefile; \
902 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
905 #---------------------------------------------------------
906 # Handle the OPTIONAL_DIRS options for directores that may
908 #---------------------------------------------------------
911 SubDirs += $(OPTIONAL_DIRS)
913 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
914 $(RecursiveTargets)::
915 $(Verb) for dir in $(OPTIONAL_DIRS); do \
916 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
917 if ([ ! -f $$dir/Makefile ] || \
918 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
920 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
922 ($(MAKE) -C$$dir $@ ) || exit 1; \
926 $(RecursiveTargets)::
927 $(Verb) for dir in $(OPTIONAL_DIRS); do \
928 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
929 ($(MAKE) -C$$dir $@ ) || exit 1; \
935 #---------------------------------------------------------
936 # Handle the CONFIG_FILES options
937 #---------------------------------------------------------
942 $(Echo) Install circumvented with NO_INSTALL
944 $(Echo) UnInstall circumvented with NO_INSTALL
946 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
947 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
948 $(Verb)for file in $(CONFIG_FILES); do \
949 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
950 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
951 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
952 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
954 $(ECHO) Error: cannot find config file $${file}. ; \
959 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
960 $(Verb)for file in $(CONFIG_FILES); do \
961 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
967 ###############################################################################
968 # Set up variables for building libraries
969 ###############################################################################
971 #---------------------------------------------------------
972 # Define various command line options pertaining to the
973 # libraries needed when linking. There are "Proj" libs
974 # (defined by the user's project) and "LLVM" libs (defined
975 # by the LLVM project).
976 #---------------------------------------------------------
979 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
980 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
981 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
982 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
986 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
987 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
988 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
989 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
992 # Loadable module for Win32 requires all symbols resolved for linking.
993 # Then all symbols in LLVM.dll will be available.
994 ifeq ($(ENABLE_SHARED),1)
995 ifdef LOADABLE_MODULE
996 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
997 LINK_COMPONENTS += all
1002 ifndef IS_CLEANING_TARGET
1003 ifdef LINK_COMPONENTS
1005 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1006 # clean in tools, then do a make in tools (instead of at the top level).
1008 @echo "*** llvm-config doesn't exist - rebuilding it."
1009 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1011 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1013 ifeq ($(ENABLE_SHARED), 1)
1014 # We can take the "auto-import" feature to get rid of using dllimport.
1015 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1016 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1019 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1020 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1023 ifndef NO_LLVM_CONFIG
1024 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1025 ifeq ($(LLVMConfigLibs),Error)
1026 $(error llvm-config --libs failed)
1028 LLVMLibsOptions += $(LLVMConfigLibs)
1029 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1030 ifeq ($(LLVMConfigLibfiles),Error)
1031 $(error llvm-config --libfiles failed)
1033 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1040 # Set up the library exports file.
1041 ifdef EXPORTED_SYMBOL_FILE
1043 # First, set up the native export file, which may differ from the source
1046 ifeq ($(HOST_OS),Darwin)
1047 # Darwin convention prefixes symbols with underscores.
1048 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1049 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1050 $(Verb) sed -e 's/^/_/' < $< > $@
1052 -$(Verb) $(RM) -f $(NativeExportsFile)
1054 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1055 # Gold and BFD ld require a version script rather than a plain list.
1056 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1057 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1058 $(Verb) echo "{" > $@
1059 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1060 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1061 ifneq ($(HOST_OS),OpenBSD)
1062 $(Verb) echo " local: *;" >> $@
1064 $(Verb) echo "};" >> $@
1066 -$(Verb) $(RM) -f $(NativeExportsFile)
1068 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1069 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1070 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1071 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1072 $(Echo) Generating $(notdir $@)
1073 $(Verb) $(ECHO) "EXPORTS" > $@
1074 $(Verb) $(CAT) $< >> $@
1076 -$(Verb) $(RM) -f $(NativeExportsFile)
1078 # Default behavior: just use the exports file verbatim.
1079 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1084 # Now add the linker command-line options to use the native export file.
1087 ifeq ($(HOST_OS),Darwin)
1088 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1091 # gold, bfd ld, etc.
1092 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1093 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1097 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1098 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1099 SharedLinkOptions += $(NativeExportsFile)
1104 ###############################################################################
1105 # Library Build Rules: Four ways to build a library
1106 ###############################################################################
1108 #---------------------------------------------------------
1109 # Bytecode Module Targets:
1110 # If the user set MODULE_NAME then they want to build a
1111 # bytecode module from the sources. We compile all the
1112 # sources and link it together into a single bytecode
1114 #---------------------------------------------------------
1117 ifeq ($(strip $(LLVMCC)),)
1118 $(warning Modules require LLVM capable compiler but none is available ****)
1121 Module := $(LibDir)/$(MODULE_NAME).bc
1122 LinkModule := $(LLVMLD) -r
1125 ifdef EXPORTED_SYMBOL_FILE
1126 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1129 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1130 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1131 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1133 all-local:: $(Module)
1136 ifneq ($(strip $(Module)),)
1137 -$(Verb) $(RM) -f $(Module)
1140 ifdef BYTECODE_DESTINATION
1141 ModuleDestDir := $(BYTECODE_DESTINATION)
1143 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1148 $(Echo) Install circumvented with NO_INSTALL
1150 $(Echo) Uninstall circumvented with NO_INSTALL
1152 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1154 install-module:: $(DestModule)
1155 install-local:: $(DestModule)
1157 $(DestModule): $(ModuleDestDir) $(Module)
1158 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1159 $(Verb) $(DataInstall) $(Module) $(DestModule)
1162 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1163 -$(Verb) $(RM) -f $(DestModule)
1169 # if we're building a library ...
1172 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1173 LIBRARYNAME := $(strip $(LIBRARYNAME))
1174 ifdef LOADABLE_MODULE
1175 BaseLibName.A := $(LIBRARYNAME).a
1176 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1178 BaseLibName.A := lib$(LIBRARYNAME).a
1179 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1181 LibName.A := $(LibDir)/$(BaseLibName.A)
1182 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1183 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1184 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1186 #---------------------------------------------------------
1187 # Shared Library Targets:
1188 # If the user asked for a shared library to be built
1189 # with the SHARED_LIBRARY variable, then we provide
1190 # targets for building them.
1191 #---------------------------------------------------------
1192 ifdef SHARED_LIBRARY
1194 all-local:: $(LibName.SO)
1196 ifdef EXPORTED_SYMBOL_FILE
1197 $(LibName.SO): $(NativeExportsFile)
1200 ifdef LINK_LIBS_IN_SHARED
1201 ifdef LOADABLE_MODULE
1202 SharedLibKindMessage := "Loadable Module"
1203 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1205 SharedLibKindMessage := "Shared Library"
1207 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1208 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1210 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1211 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1213 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1214 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1215 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1219 ifneq ($(strip $(LibName.SO)),)
1220 -$(Verb) $(RM) -f $(LibName.SO)
1225 $(Echo) Install circumvented with NO_INSTALL
1227 $(Echo) Uninstall circumvented with NO_INSTALL
1230 # Win32.DLL prefers to be located on the "PATH" of binaries.
1231 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1232 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1234 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1236 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1238 install-local:: $(DestSharedLib)
1240 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1241 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1242 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1245 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1246 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1250 #---------------------------------------------------------
1251 # Bytecode Library Targets:
1252 # If the user asked for a bytecode library to be built
1253 # with the BYTECODE_LIBRARY variable, then we provide
1254 # targets for building them.
1255 #---------------------------------------------------------
1256 ifdef BYTECODE_LIBRARY
1257 ifeq ($(strip $(LLVMCC)),)
1258 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1261 all-local:: $(LibName.BCA)
1263 ifdef EXPORTED_SYMBOL_FILE
1264 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1266 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1267 $(LLVMToolDir)/llvm-ar
1268 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1270 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1272 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1274 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1275 $(LLVMToolDir)/llvm-ar
1276 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1278 $(Verb) $(LArchive) $@ $(ObjectsBC)
1283 ifneq ($(strip $(LibName.BCA)),)
1284 -$(Verb) $(RM) -f $(LibName.BCA)
1287 ifdef BYTECODE_DESTINATION
1288 BytecodeDestDir := $(BYTECODE_DESTINATION)
1290 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1293 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1295 install-bytecode-local:: $(DestBytecodeLib)
1299 $(Echo) Install circumvented with NO_INSTALL
1301 $(Echo) Uninstall circumvented with NO_INSTALL
1303 install-local:: $(DestBytecodeLib)
1305 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1306 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1307 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1310 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1311 -$(Verb) $(RM) -f $(DestBytecodeLib)
1316 #---------------------------------------------------------
1318 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1319 # building an archive.
1320 #---------------------------------------------------------
1321 ifndef NO_BUILD_ARCHIVE
1322 ifndef BUILD_ARCHIVE
1323 ifndef LOADABLE_MODULE
1329 #---------------------------------------------------------
1330 # Archive Library Targets:
1331 # If the user wanted a regular archive library built,
1332 # then we provide targets for building them.
1333 #---------------------------------------------------------
1336 all-local:: $(LibName.A)
1338 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1339 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1340 -$(Verb) $(RM) -f $@
1341 $(Verb) $(Archive) $@ $(ObjectsO)
1342 $(Verb) $(Ranlib) $@
1345 ifneq ($(strip $(LibName.A)),)
1346 -$(Verb) $(RM) -f $(LibName.A)
1351 $(Echo) Install circumvented with NO_INSTALL
1353 $(Echo) Uninstall circumvented with NO_INSTALL
1355 ifdef NO_INSTALL_ARCHIVES
1357 $(Echo) Install circumvented with NO_INSTALL
1359 $(Echo) Uninstall circumvented with NO_INSTALL
1361 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1363 install-local:: $(DestArchiveLib)
1365 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1366 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1367 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1368 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1371 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1372 -$(Verb) $(RM) -f $(DestArchiveLib)
1380 ###############################################################################
1381 # Tool Build Rules: Build executable tool based on TOOLNAME option
1382 ###############################################################################
1386 #---------------------------------------------------------
1387 # Set up variables for building a tool.
1388 #---------------------------------------------------------
1389 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1391 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1393 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1396 # TOOLALIAS is a name to symlink (or copy) the tool to.
1399 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1401 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1405 #---------------------------------------------------------
1407 #---------------------------------------------------------
1409 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1410 # not exporting all of the weak symbols from the binary. This reduces dyld
1411 # startup time by 4x on darwin in some cases.
1412 ifdef TOOL_NO_EXPORTS
1413 ifeq ($(HOST_OS),Darwin)
1415 # Tiger tools don't support this.
1416 ifneq ($(DARWIN_MAJVERS),4)
1417 LD.Flags += -Wl,-exported_symbol,_main
1421 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1422 ifneq ($(ARCH), Mips)
1423 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1428 #---------------------------------------------------------
1429 # Tool Order File Support
1430 #---------------------------------------------------------
1432 ifeq ($(HOST_OS),Darwin)
1433 ifdef TOOL_ORDER_FILE
1435 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1440 #---------------------------------------------------------
1441 # Tool Version Info Support
1442 #---------------------------------------------------------
1444 ifeq ($(HOST_OS),Darwin)
1445 ifdef TOOL_INFO_PLIST
1447 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1449 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1451 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1452 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1453 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1454 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1455 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1456 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1462 #---------------------------------------------------------
1463 # Provide targets for building the tools
1464 #---------------------------------------------------------
1465 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1468 ifneq ($(strip $(ToolBuildPath)),)
1469 -$(Verb) $(RM) -f $(ToolBuildPath)
1471 ifneq ($(strip $(ToolAliasBuildPath)),)
1472 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1476 $(ToolBuildPath): $(ExmplDir)/.dir
1478 $(ToolBuildPath): $(ToolDir)/.dir
1481 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1482 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1483 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1484 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1485 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1488 ifneq ($(strip $(ToolAliasBuildPath)),)
1489 $(ToolAliasBuildPath): $(ToolBuildPath)
1490 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1491 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1492 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1493 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1499 $(Echo) Install circumvented with NO_INSTALL
1501 $(Echo) Uninstall circumvented with NO_INSTALL
1503 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1505 install-local:: $(DestTool)
1507 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1508 $(Echo) Installing $(BuildMode) $(DestTool)
1509 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1512 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1513 -$(Verb) $(RM) -f $(DestTool)
1515 # TOOLALIAS install.
1517 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1519 install-local:: $(DestToolAlias)
1521 $(DestToolAlias): $(DestTool)
1522 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1523 $(Verb) $(RM) -f $(DestToolAlias)
1524 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1527 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1528 -$(Verb) $(RM) -f $(DestToolAlias)
1534 ###############################################################################
1535 # Object Build Rules: Build object files based on sources
1536 ###############################################################################
1538 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1539 ifeq ($(HOST_OS),HP-UX)
1540 DISABLE_AUTO_DEPENDENCIES=1
1543 # Provide rule sets for when dependency generation is enabled
1544 ifndef DISABLE_AUTO_DEPENDENCIES
1546 #---------------------------------------------------------
1547 # Create .o files in the ObjDir directory from the .cpp and .c files...
1548 #---------------------------------------------------------
1550 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1551 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1553 # If the build succeeded, move the dependency file over, otherwise
1555 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1556 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1558 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1559 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1560 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1563 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1564 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1565 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1568 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1569 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1570 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1573 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1574 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1575 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1578 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1579 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1580 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1583 #---------------------------------------------------------
1584 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1585 #---------------------------------------------------------
1587 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1588 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1590 # If the build succeeded, move the dependency file over, otherwise
1592 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1593 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1595 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1596 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1597 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1598 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1599 $(BC_DEPEND_MOVEFILE)
1601 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1602 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1603 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1604 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1605 $(BC_DEPEND_MOVEFILE)
1607 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1608 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1609 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1610 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1611 $(BC_DEPEND_MOVEFILE)
1613 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1614 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1615 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1616 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1617 $(BC_DEPEND_MOVEFILE)
1619 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1620 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1621 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1622 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1623 $(BC_DEPEND_MOVEFILE)
1625 # Provide alternate rule sets if dependencies are disabled
1628 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1629 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1630 $(Compile.CXX) $< -o $@
1632 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1633 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1634 $(Compile.CXX) $< -o $@
1636 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1637 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1638 $(Compile.CXX) $< -o $@
1640 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1641 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1642 $(Compile.C) $< -o $@
1644 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1645 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1646 $(Compile.C) $< -o $@
1648 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1649 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1650 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1652 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1653 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1654 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1656 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1657 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1658 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1660 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1661 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1662 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1664 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1665 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1666 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1671 ## Rules for building preprocessed (.i/.ii) outputs.
1672 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1673 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1674 $(Verb) $(Preprocess.CXX) $< -o $@
1676 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1677 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1678 $(Verb) $(Preprocess.CXX) $< -o $@
1680 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1681 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1682 $(Verb) $(Preprocess.CXX) $< -o $@
1684 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1685 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1686 $(Verb) $(Preprocess.C) $< -o $@
1688 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1689 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1690 $(Verb) $(Preprocess.C) $< -o $@
1693 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1694 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1695 $(Compile.CXX) $< -o $@ -S
1697 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1698 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1699 $(Compile.CXX) $< -o $@ -S
1701 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1702 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1703 $(Compile.CXX) $< -o $@ -S
1705 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1706 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1707 $(Compile.C) $< -o $@ -S
1709 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1710 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1711 $(Compile.C) $< -o $@ -S
1714 # make the C and C++ compilers strip debug info out of bytecode libraries.
1716 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1717 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1718 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1720 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1721 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1722 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1726 #---------------------------------------------------------
1727 # Provide rule to build .bc files from .ll sources,
1728 # regardless of dependencies
1729 #---------------------------------------------------------
1730 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1731 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1732 $(Verb) $(LLVMAS) $< -f -o $@
1734 ###############################################################################
1735 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1736 ###############################################################################
1739 TABLEGEN_INC_FILES_COMMON = 1
1742 ifdef TABLEGEN_INC_FILES_COMMON
1744 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1745 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1746 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1748 # INCFiles rule: All of the tblgen generated files are emitted to
1749 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1750 # us to only "touch" the real file if the contents of it change. IOW, if
1751 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1752 # dependencies of the .inc files are, unless the contents of the .inc file
1754 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1755 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1757 endif # TABLEGEN_INC_FILES_COMMON
1761 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1762 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1763 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1764 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1765 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1766 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1767 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1769 # All .inc.tmp files depend on the .td files.
1770 $(INCTMPFiles) : $(TDFiles)
1772 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1773 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1774 $(Echo) "Building $(<F) register info implementation with tblgen"
1775 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1777 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1778 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1779 $(Echo) "Building $(<F) instruction information with tblgen"
1780 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1782 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1783 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1784 $(Echo) "Building $(<F) assembly writer with tblgen"
1785 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1787 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1788 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1789 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1790 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1792 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1793 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1794 $(Echo) "Building $(<F) assembly matcher with tblgen"
1795 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1797 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1798 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1799 $(Echo) "Building $(<F) MC code emitter with tblgen"
1800 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1802 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1803 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1804 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1805 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1807 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1808 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1809 $(Echo) "Building $(<F) code emitter with tblgen"
1810 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1812 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1813 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1814 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1815 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1817 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1818 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1819 $(Echo) "Building $(<F) disassembly tables with tblgen"
1820 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1822 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1823 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1824 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1825 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1827 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1828 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1829 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1830 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1832 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1833 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1834 $(Echo) "Building $(<F) subtarget information with tblgen"
1835 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1837 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1838 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1839 $(Echo) "Building $(<F) calling convention information with tblgen"
1840 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1842 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1843 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1844 $(Echo) "Building $(<F) intrinsics information with tblgen"
1845 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1847 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1848 $(Echo) "Building $(<F) decoder tables with tblgen"
1849 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1853 -$(Verb) $(RM) -f $(INCFiles)
1857 ###############################################################################
1858 # OTHER RULES: Other rules needed
1859 ###############################################################################
1861 # To create postscript files from dot files...
1862 ifneq ($(DOT),false)
1864 $(DOT) -Tps < $< > $@
1867 $(Echo) "Cannot build $@: The program dot is not installed"
1870 # This rules ensures that header files that are removed still have a rule for
1871 # which they can be "generated." This allows make to ignore them and
1872 # reproduce the dependency lists.
1876 # Define clean-local to clean the current directory. Note that this uses a
1877 # very conservative approach ensuring that empty variables do not cause
1878 # errors or disastrous removal.
1880 ifneq ($(strip $(ObjRootDir)),)
1881 -$(Verb) $(RM) -rf $(ObjRootDir)
1883 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
1884 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1885 -$(Verb) $(RM) -f *$(SHLIBEXT)
1889 -$(Verb) $(RM) -rf Debug Release Profile
1892 ###############################################################################
1893 # DEPENDENCIES: Include the dependency files if we should
1894 ###############################################################################
1895 ifndef DISABLE_AUTO_DEPENDENCIES
1897 # If its not one of the cleaning targets
1898 ifndef IS_CLEANING_TARGET
1900 # Get the list of dependency files
1901 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1902 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1904 # Include bitcode dependency files if using bitcode libraries
1905 ifdef BYTECODE_LIBRARY
1906 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1909 -include $(DependFiles) ""
1915 ###############################################################################
1916 # CHECK: Running the test suite
1917 ###############################################################################
1920 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1921 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1922 $(EchoCmd) Running test suite ; \
1923 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1924 TESTSUITE=$(TESTSUITE) ; \
1926 $(EchoCmd) No Makefile in test directory ; \
1929 $(EchoCmd) No test directory ; \
1935 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1936 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1937 $(EchoCmd) Running test suite ; \
1938 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1940 $(EchoCmd) No Makefile in test directory ; \
1943 $(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-all ; \
1952 $(EchoCmd) No Makefile in test directory ; \
1955 $(EchoCmd) No test directory ; \
1958 ###############################################################################
1959 # UNITTESTS: Running the unittests test suite
1960 ###############################################################################
1963 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1964 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1965 $(EchoCmd) Running unittests test suite ; \
1966 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1968 $(EchoCmd) No Makefile in unittests directory ; \
1971 $(EchoCmd) No unittests directory ; \
1974 ###############################################################################
1975 # DISTRIBUTION: Handle construction of a distribution tarball
1976 ###############################################################################
1978 #------------------------------------------------------------------------
1979 # Define distribution related variables
1980 #------------------------------------------------------------------------
1981 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1982 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1983 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1984 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1985 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1986 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1987 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1988 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1989 Makefile.config.in configure autoconf
1990 DistOther := $(notdir $(wildcard \
1991 $(PROJ_SRC_DIR)/*.h \
1992 $(PROJ_SRC_DIR)/*.td \
1993 $(PROJ_SRC_DIR)/*.def \
1994 $(PROJ_SRC_DIR)/*.ll \
1995 $(PROJ_SRC_DIR)/*.in))
1996 DistSubDirs := $(SubDirs)
1997 DistSources = $(Sources) $(EXTRA_DIST)
1998 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2000 #------------------------------------------------------------------------
2001 # We MUST build distribution with OBJ_DIR != SRC_DIR
2002 #------------------------------------------------------------------------
2003 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2004 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2005 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2009 #------------------------------------------------------------------------
2010 # Prevent attempt to run dist targets from anywhere but the top level
2011 #------------------------------------------------------------------------
2013 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2014 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2017 #------------------------------------------------------------------------
2018 # Provide the top level targets
2019 #------------------------------------------------------------------------
2021 dist-gzip:: $(DistTarGZip)
2023 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2024 $(Echo) Packing gzipped distribution tar file.
2025 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2026 $(GZIP) -c > "$(DistTarGZip)"
2028 dist-bzip2:: $(DistTarBZ2)
2030 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2031 $(Echo) Packing bzipped distribution tar file.
2032 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2033 $(BZIP2) -c >$(DistTarBZ2)
2035 dist-zip:: $(DistZip)
2037 $(DistZip) : $(TopDistDir)/.makedistdir
2038 $(Echo) Packing zipped distribution file.
2039 $(Verb) rm -f $(DistZip)
2040 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2042 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2043 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2045 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2047 dist-check:: $(DistTarGZip)
2048 $(Echo) Checking distribution tar file.
2049 $(Verb) if test -d $(DistCheckDir) ; then \
2050 $(RM) -rf $(DistCheckDir) ; \
2052 $(Verb) $(MKDIR) $(DistCheckDir)
2053 $(Verb) cd $(DistCheckDir) && \
2054 $(MKDIR) $(DistCheckDir)/build && \
2055 $(MKDIR) $(DistCheckDir)/install && \
2056 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2058 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2059 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2062 $(MAKE) unittests && \
2063 $(MAKE) install && \
2064 $(MAKE) uninstall && \
2065 $(MAKE) dist-clean && \
2066 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2069 $(Echo) Cleaning distribution files
2070 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2075 #------------------------------------------------------------------------
2076 # Provide the recursive distdir target for building the distribution directory
2077 #------------------------------------------------------------------------
2078 distdir: $(DistDir)/.makedistdir
2079 $(DistDir)/.makedistdir: $(DistSources)
2080 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2081 if test -d "$(DistDir)" ; then \
2082 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2085 $(EchoCmd) Removing old $(DistDir) ; \
2086 $(RM) -rf $(DistDir); \
2087 $(EchoCmd) Making 'all' to verify build ; \
2088 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2090 $(Echo) Building Distribution Directory $(DistDir)
2091 $(Verb) $(MKDIR) $(DistDir)
2092 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2093 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2094 for file in $(DistFiles) ; do \
2096 $(PROJ_SRC_DIR)/*) \
2097 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2099 $(PROJ_SRC_ROOT)/*) \
2100 file=`echo "$$file" | \
2101 sed "s#^$$srcrootstrip/##"` \
2104 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2105 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2106 from_dir="$(PROJ_SRC_DIR)" ; \
2107 elif test -f "$$file" || test -d "$$file" ; then \
2110 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2111 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2112 to_dir="$(DistDir)/$$dir"; \
2113 $(MKDIR) "$$to_dir" ; \
2115 to_dir="$(DistDir)"; \
2117 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2118 if test -n "$$mid_dir" ; then \
2119 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2121 if test -d "$$from_dir/$$file"; then \
2122 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2123 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2124 cd $(PROJ_SRC_DIR) ; \
2125 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2126 ( cd $$to_dir ; $(TAR) xf - ) ; \
2127 cd $(PROJ_OBJ_DIR) ; \
2130 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2131 ( cd $$to_dir ; $(TAR) xf - ) ; \
2132 cd $(PROJ_OBJ_DIR) ; \
2134 elif test -f "$$from_dir/$$file" ; then \
2135 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2136 elif test -L "$$from_dir/$$file" ; then \
2137 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2138 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2139 $(EchoCmd) "===== WARNING: Distribution Source " \
2140 "$$from_dir/$$file Not Found!" ; \
2141 elif test "$(Verb)" != '@' ; then \
2142 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2145 $(Verb) for subdir in $(DistSubDirs) ; do \
2146 if test "$$subdir" \!= "." ; then \
2147 new_distdir="$(DistDir)/$$subdir" ; \
2148 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2149 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2150 DistDir="$$new_distdir" distdir ) || exit 1; \
2153 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2154 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2155 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2156 -name .svn \) -print` ;\
2157 $(MAKE) dist-hook ; \
2158 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2159 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2160 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2161 -o ! -type d ! -perm -444 -exec \
2162 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2163 || chmod -R a+r $(DistDir) ; \
2166 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2172 ###############################################################################
2173 # TOP LEVEL - targets only to apply at the top level directory
2174 ###############################################################################
2178 #------------------------------------------------------------------------
2179 # Install support for the project's include files:
2180 #------------------------------------------------------------------------
2183 $(Echo) Install circumvented with NO_INSTALL
2185 $(Echo) Uninstall circumvented with NO_INSTALL
2188 $(Echo) Installing include files
2189 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2190 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2191 cd $(PROJ_SRC_ROOT)/include && \
2192 for hdr in `find . -type f \
2193 '(' -name LICENSE.TXT \
2198 ')' -print | grep -v CVS | \
2199 grep -v .svn` ; do \
2200 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2201 if test \! -d "$$instdir" ; then \
2202 $(EchoCmd) Making install directory $$instdir ; \
2203 $(MKDIR) $$instdir ;\
2205 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2208 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2209 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2210 cd $(PROJ_OBJ_ROOT)/include && \
2211 for hdr in `find . -type f \
2212 '(' -name LICENSE.TXT \
2217 ')' -print | grep -v CVS | \
2218 grep -v .svn` ; do \
2219 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2220 if test \! -d "$$instdir" ; then \
2221 $(EchoCmd) Making install directory $$instdir ; \
2222 $(MKDIR) $$instdir ;\
2224 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2230 $(Echo) Uninstalling include files
2231 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2232 cd $(PROJ_SRC_ROOT)/include && \
2233 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2234 '!' '(' -name '*~' -o -name '.#*' \
2235 -o -name '*.in' ')' -print ')' | \
2236 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2237 cd $(PROJ_SRC_ROOT)/include && \
2238 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2239 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2245 @echo searching for overlength lines in files: $(Sources)
2248 egrep -n '.{81}' $(Sources) /dev/null
2251 @echo searching for tabs in files: $(Sources)
2254 egrep -n ' ' $(Sources) /dev/null
2257 @ls -l $(LibDir) | awk '\
2258 BEGIN { sum = 0; } \
2260 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2261 @ls -l $(ToolDir) | awk '\
2262 BEGIN { sum = 0; } \
2264 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2265 #------------------------------------------------------------------------
2266 # Print out the directories used for building
2267 #------------------------------------------------------------------------
2269 $(Echo) "BuildMode : " '$(BuildMode)'
2270 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2271 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2272 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2273 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2274 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2275 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2276 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2277 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2278 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2279 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2280 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2281 $(Echo) "UserTargets : " '$(UserTargets)'
2282 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2283 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2284 $(Echo) "ObjDir : " '$(ObjDir)'
2285 $(Echo) "LibDir : " '$(LibDir)'
2286 $(Echo) "ToolDir : " '$(ToolDir)'
2287 $(Echo) "ExmplDir : " '$(ExmplDir)'
2288 $(Echo) "Sources : " '$(Sources)'
2289 $(Echo) "TDFiles : " '$(TDFiles)'
2290 $(Echo) "INCFiles : " '$(INCFiles)'
2291 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2292 $(Echo) "PreConditions: " '$(PreConditions)'
2293 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2294 $(Echo) "Compile.C : " '$(Compile.C)'
2295 $(Echo) "Archive : " '$(Archive)'
2296 $(Echo) "YaccFiles : " '$(YaccFiles)'
2297 $(Echo) "LexFiles : " '$(LexFiles)'
2298 $(Echo) "Module : " '$(Module)'
2299 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2300 $(Echo) "SubDirs : " '$(SubDirs)'
2301 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2302 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2307 # General debugging rule, use 'make dbg-print-XXX' to print the
2308 # definition, value and origin of XXX.
2310 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))