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 # FIXME: clang's -fvisibility-inlines-hidden is broken for shared libs. PR11642.
324 ifneq ($(ENABLE_SHARED),1)
325 CXX.Flags += -fvisibility-inlines-hidden
329 ifdef ENABLE_EXPENSIVE_CHECKS
330 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
331 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
335 # IF REQUIRES_EH=1 is specified then don't disable exceptions
337 CXX.Flags += -fno-exceptions
339 # If the library requires EH, it also requires RTTI.
343 ifdef REQUIRES_FRAME_POINTER
344 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
345 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
346 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
349 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
350 ifneq ($(REQUIRES_RTTI), 1)
351 CXX.Flags += -fno-rtti
354 ifeq ($(ENABLE_COVERAGE),1)
355 BuildMode := $(BuildMode)+Coverage
356 CXX.Flags += -ftest-coverage -fprofile-arcs
357 C.Flags += -ftest-coverage -fprofile-arcs
360 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
361 # then disable assertions by defining the appropriate preprocessor symbols.
362 ifeq ($(DISABLE_ASSERTIONS),1)
363 CPP.Defines += -DNDEBUG
365 BuildMode := $(BuildMode)+Asserts
366 CPP.Defines += -D_DEBUG
369 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
370 # configured), then enable expensive checks by defining the
371 # appropriate preprocessor symbols.
372 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
373 BuildMode := $(BuildMode)+Checks
374 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
377 # LOADABLE_MODULE implies several other things so we force them to be
379 ifdef LOADABLE_MODULE
381 LINK_LIBS_IN_SHARED := 1
389 ifeq ($(ENABLE_PIC),1)
390 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
391 # Nothing. Win32 defaults to PIC and warns when given -fPIC
393 ifeq ($(HOST_OS),Darwin)
394 # Common symbols not allowed in dylib files
395 CXX.Flags += -fno-common
396 C.Flags += -fno-common
398 # Linux and others; pass -fPIC
404 ifeq ($(HOST_OS),Darwin)
405 CXX.Flags += -mdynamic-no-pic
406 C.Flags += -mdynamic-no-pic
410 # Support makefile variable to disable any kind of timestamp/non-deterministic
411 # info from being used in the build.
412 ifeq ($(ENABLE_TIMESTAMPS),1)
413 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
415 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
418 ifeq ($(HOST_OS),MingW)
420 CPP.Defines += -D__NO_CTYPE_INLINE
421 ifeq ($(LLVM_CROSS_COMPILING),1)
422 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
424 LD.Flags += -Wl,--allow-multiple-definition
429 CXX.Flags += -Woverloaded-virtual
430 CPP.BaseFlags += $(CPP.Defines)
433 # Make Floating point IEEE compliant on Alpha.
436 CPP.BaseFlags += -mieee
437 ifeq ($(ENABLE_PIC),0)
439 CPP.BaseFlags += -fPIC
442 LD.Flags += -Wl,--no-relax
445 # GNU ld/PECOFF accepts but ignores them below;
449 # FIXME: autoconf should be aware of them.
450 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
451 HAVE_LINK_VERSION_SCRIPT := 0
453 RDYNAMIC := -Wl,--export-all-symbols
456 #--------------------------------------------------------------------
457 # Directory locations
458 #--------------------------------------------------------------------
460 ifeq ($(LLVM_CROSS_COMPILING),1)
461 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
464 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
465 ObjDir := $(ObjRootDir)
466 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
467 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
468 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
469 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
470 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
471 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
473 #--------------------------------------------------------------------
474 # Locations of shared libraries
475 #--------------------------------------------------------------------
478 SharedLibDir := $(LibDir)
479 LLVMSharedLibDir := $(LLVMLibDir)
481 # Win32.DLL prefers to be located on the "PATH" of binaries.
482 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
483 SharedLibDir := $(ToolDir)
484 LLVMSharedLibDir := $(LLVMToolDir)
486 ifeq ($(HOST_OS),Cygwin)
493 #--------------------------------------------------------------------
494 # LLVM Capable Compiler
495 #--------------------------------------------------------------------
497 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
499 LLVMCXX := $(LLVMGXX)
501 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
502 ifneq ($(CLANGPATH),)
503 LLVMCC := $(CLANGPATH)
504 LLVMCXX := $(CLANGXXPATH)
506 ifeq ($(ENABLE_BUILT_CLANG),1)
507 LLVMCC := $(LLVMToolDir)/clang
508 LLVMCXX := $(LLVMToolDir)/clang++
514 #--------------------------------------------------------------------
515 # Full Paths To Compiled Tools and Utilities
516 #--------------------------------------------------------------------
517 EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
518 ifdef BUILD_DIRS_ONLY
519 EchoCmd := $(EchoCmd) "(build tools)":
524 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
527 ifeq ($(LLVM_CROSS_COMPILING),1)
528 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
530 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
533 ifeq ($(LLVM_CROSS_COMPILING),1)
534 LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config$(BUILD_EXEEXT)
536 LLVM_CONFIG := $(LLVMToolDir)/llvm-config$(EXEEXT)
539 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
542 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
545 LLI := $(LLVMToolDir)/lli$(EXEEXT)
548 LLC := $(LLVMToolDir)/llc$(EXEEXT)
551 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
554 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
557 #--------------------------------------------------------------------
558 # Adjust to user's request
559 #--------------------------------------------------------------------
561 ifeq ($(HOST_OS),Darwin)
562 DARWIN_VERSION := `sw_vers -productVersion`
563 # Strip a number like 10.4.7 to 10.4
564 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
565 # Get "4" out of 10.4 for later pieces in the makefile.
566 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
568 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
569 SharedLinkOptions := -dynamiclib
571 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
574 SharedLinkOptions=-shared
577 ifeq ($(TARGET_OS),Darwin)
579 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
584 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
585 ifneq ($(HOST_OS),Darwin)
586 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
598 # Adjust settings for verbose mode
601 AR.Flags += >/dev/null 2>/dev/null
602 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
604 ConfigureScriptFLAGS :=
607 # By default, strip symbol information from executable
609 Strip := $(PLATFORMSTRIPOPTS)
610 StripWarnMsg := "(without symbols)"
611 Install.StripFlag += -s
614 ifdef TOOL_NO_EXPORTS
617 DynamicFlag := $(RDYNAMIC)
620 # Adjust linker flags for building an executable
621 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
622 ifneq ($(HOST_OS), Darwin)
624 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
626 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
628 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
632 ifneq ($(DARWIN_MAJVERS),4)
633 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
639 #----------------------------------------------------------
640 # Options To Invoke Tools
641 #----------------------------------------------------------
643 ifdef EXTRA_LD_OPTIONS
644 LD.Flags += $(EXTRA_LD_OPTIONS)
648 CompileCommonOpts += -pedantic -Wno-long-long
650 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
652 # Enable cast-qual for C++; the workaround is to use const_cast.
653 CXX.Flags += -Wcast-qual
655 ifeq ($(HOST_OS),HP-UX)
656 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
659 # If we are building a universal binary on Mac OS/X, pass extra options. This
660 # is useful to people that want to link the LLVM libraries into their universal
663 # The following can be optionally specified:
664 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
665 # For Mac OS/X 10.4 Intel machines, the traditional one is:
666 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
667 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
668 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
671 ifndef UNIVERSAL_ARCH
672 UNIVERSAL_ARCH := i386 ppc
674 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
675 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
676 ifdef UNIVERSAL_SDK_PATH
677 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
680 # Building universal cannot compute dependencies automatically.
681 DISABLE_AUTO_DEPENDENCIES=1
683 ifeq ($(TARGET_OS),Darwin)
684 ifeq ($(ARCH),x86_64)
685 TargetCommonOpts = -m64
688 TargetCommonOpts = -m32
694 ifeq ($(HOST_OS),SunOS)
695 CPP.BaseFlags += -include llvm/Support/Solaris.h
698 ifeq ($(HOST_OS),AuroraUX)
699 CPP.BaseFlags += -include llvm/Support/Solaris.h
700 endif # !HOST_OS - AuroraUX.
702 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
703 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
704 # All -I flags should go here, so that they don't confuse llvm-config.
705 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
706 $(patsubst %,-I%/include,\
707 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
708 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
711 ifeq ($(INCLUDE_BUILD_DIR),1)
712 CPP.Flags += -I$(ObjDir)
715 # SHOW_DIAGNOSTICS support.
716 ifeq ($(SHOW_DIAGNOSTICS),1)
717 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
718 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
723 Compile.C = $(Compile.Wrapper) \
724 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
725 $(TargetCommonOpts) $(CompileCommonOpts) -c
726 Compile.CXX = $(Compile.Wrapper) \
727 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
728 $(TargetCommonOpts) $(CompileCommonOpts) -c
729 Preprocess.CXX= $(Compile.Wrapper) \
730 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
731 $(CompileCommonOpts) $(CXX.Flags) -E
732 Link = $(Compile.Wrapper) \
733 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
734 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
736 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
737 $(TargetCommonOpts) $(CompileCommonOpts)
738 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
739 $(TargetCommonOpts) $(CompileCommonOpts) -E
741 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
742 $(TargetCommonOpts) $(CompileCommonOpts)
744 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
745 ScriptInstall = $(INSTALL) -m 0755
746 DataInstall = $(INSTALL) -m 0644
748 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
749 # paths. In this case, the SYSPATH function (defined in
750 # Makefile.config) transforms Unix paths into Windows paths.
751 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
752 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
753 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
754 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
755 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
757 Archive = $(AR) $(AR.Flags)
758 LArchive = $(LLVMToolDir)/llvm-ar rcsf
767 #----------------------------------------------------------
768 # Get the list of source files and compute object file
770 #----------------------------------------------------------
773 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
774 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
776 Sources := $(SOURCES)
780 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
783 BaseNameSources := $(sort $(basename $(Sources)))
785 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
786 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
788 #----------------------------------------------------------
789 # For Mingw MSYS bash and Python/w32:
791 # $(ECHOPATH) prints DOSish pathstring.
792 # ex) $(ECHOPATH) /include/sys/types.h
793 # --> C:/mingw/include/sys/types.h
794 # built-in "echo" does not transform path to DOSish path.
796 # FIXME: It would not be needed when MSYS's python
798 #----------------------------------------------------------
800 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
801 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
803 ECHOPATH := $(Verb)$(ECHO)
806 ###############################################################################
807 # DIRECTORIES: Handle recursive descent of directory structure
808 ###############################################################################
810 #---------------------------------------------------------
811 # Provide rules to make install dirs. This must be early
812 # in the file so they get built before dependencies
813 #---------------------------------------------------------
815 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
818 # To create other directories, as needed, and timestamp their creation
820 $(Verb) $(MKDIR) $* > /dev/null
821 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
823 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
824 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
826 #---------------------------------------------------------
827 # Handle the DIRS options for sequential construction
828 #---------------------------------------------------------
834 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
835 $(RecursiveTargets)::
836 $(Verb) for dir in $(DIRS); do \
837 if ([ ! -f $$dir/Makefile ] || \
838 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
840 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
842 ($(MAKE) -C $$dir $@ ) || exit 1; \
845 $(RecursiveTargets)::
846 $(Verb) for dir in $(DIRS); do \
847 ($(MAKE) -C $$dir $@ ) || exit 1; \
853 #---------------------------------------------------------
854 # Handle the EXPERIMENTAL_DIRS options ensuring success
855 # after each directory is built.
856 #---------------------------------------------------------
857 ifdef EXPERIMENTAL_DIRS
858 $(RecursiveTargets)::
859 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
860 if ([ ! -f $$dir/Makefile ] || \
861 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
863 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
865 ($(MAKE) -C $$dir $@ ) || exit 0; \
869 #-----------------------------------------------------------
870 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
871 #-----------------------------------------------------------
872 ifdef OPTIONAL_PARALLEL_DIRS
873 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
876 #-----------------------------------------------------------
877 # Handle the PARALLEL_DIRS options for parallel construction
878 #-----------------------------------------------------------
881 SubDirs += $(PARALLEL_DIRS)
883 # Unfortunately, this list must be maintained if new recursive targets are added
884 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
885 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
886 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
887 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
888 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
889 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
890 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
892 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
896 SD=$(PROJ_SRC_DIR)/$(@D); \
898 if [ ! -f $$SD/Makefile ]; then \
900 DD=$(notdir $(@D)); \
902 if ([ ! -f $$DD/Makefile ] || \
903 command test $$DD/Makefile -ot \
904 $$SD/Makefile ); then \
906 $(CP) $$SD/Makefile $$DD/Makefile; \
908 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
911 #---------------------------------------------------------
912 # Handle the OPTIONAL_DIRS options for directores that may
914 #---------------------------------------------------------
917 SubDirs += $(OPTIONAL_DIRS)
919 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
920 $(RecursiveTargets)::
921 $(Verb) for dir in $(OPTIONAL_DIRS); do \
922 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
923 if ([ ! -f $$dir/Makefile ] || \
924 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
926 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
928 ($(MAKE) -C$$dir $@ ) || exit 1; \
932 $(RecursiveTargets)::
933 $(Verb) for dir in $(OPTIONAL_DIRS); do \
934 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
935 ($(MAKE) -C$$dir $@ ) || exit 1; \
941 #---------------------------------------------------------
942 # Handle the CONFIG_FILES options
943 #---------------------------------------------------------
948 $(Echo) Install circumvented with NO_INSTALL
950 $(Echo) UnInstall circumvented with NO_INSTALL
952 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
953 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
954 $(Verb)for file in $(CONFIG_FILES); do \
955 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
956 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
957 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
958 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
960 $(ECHO) Error: cannot find config file $${file}. ; \
965 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
966 $(Verb)for file in $(CONFIG_FILES); do \
967 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
973 ###############################################################################
974 # Set up variables for building libraries
975 ###############################################################################
977 #---------------------------------------------------------
978 # Define various command line options pertaining to the
979 # libraries needed when linking. There are "Proj" libs
980 # (defined by the user's project) and "LLVM" libs (defined
981 # by the LLVM project).
982 #---------------------------------------------------------
985 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
986 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
987 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
988 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
992 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
993 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
994 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
995 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
998 # Loadable module for Win32 requires all symbols resolved for linking.
999 # Then all symbols in LLVM.dll will be available.
1000 ifeq ($(ENABLE_SHARED),1)
1001 ifdef LOADABLE_MODULE
1002 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
1003 LINK_COMPONENTS += all
1008 ifndef IS_CLEANING_TARGET
1009 ifdef LINK_COMPONENTS
1011 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1012 # clean in tools, then do a make in tools (instead of at the top level).
1014 @echo "*** llvm-config doesn't exist - rebuilding it."
1015 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1017 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1019 ifeq ($(ENABLE_SHARED), 1)
1020 # We can take the "auto-import" feature to get rid of using dllimport.
1021 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1022 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1025 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1026 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1029 ifndef NO_LLVM_CONFIG
1030 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1031 ifeq ($(LLVMConfigLibs),Error)
1032 $(error llvm-config --libs failed)
1034 LLVMLibsOptions += $(LLVMConfigLibs)
1035 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1036 ifeq ($(LLVMConfigLibfiles),Error)
1037 $(error llvm-config --libfiles failed)
1039 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1046 # Set up the library exports file.
1047 ifdef EXPORTED_SYMBOL_FILE
1049 # First, set up the native export file, which may differ from the source
1052 ifeq ($(HOST_OS),Darwin)
1053 # Darwin convention prefixes symbols with underscores.
1054 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1055 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1056 $(Verb) sed -e 's/^/_/' < $< > $@
1058 -$(Verb) $(RM) -f $(NativeExportsFile)
1060 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1061 # Gold and BFD ld require a version script rather than a plain list.
1062 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1063 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1064 $(Verb) echo "{" > $@
1065 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1066 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1067 ifneq ($(HOST_OS),OpenBSD)
1068 $(Verb) echo " local: *;" >> $@
1070 $(Verb) echo "};" >> $@
1072 -$(Verb) $(RM) -f $(NativeExportsFile)
1074 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1075 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1076 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1077 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1078 $(Echo) Generating $(notdir $@)
1079 $(Verb) $(ECHO) "EXPORTS" > $@
1080 $(Verb) $(CAT) $< >> $@
1082 -$(Verb) $(RM) -f $(NativeExportsFile)
1084 # Default behavior: just use the exports file verbatim.
1085 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1090 # Now add the linker command-line options to use the native export file.
1093 ifeq ($(HOST_OS),Darwin)
1094 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1097 # gold, bfd ld, etc.
1098 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1099 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1103 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1104 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1105 SharedLinkOptions += $(NativeExportsFile)
1110 ###############################################################################
1111 # Library Build Rules: Four ways to build a library
1112 ###############################################################################
1114 #---------------------------------------------------------
1115 # Bytecode Module Targets:
1116 # If the user set MODULE_NAME then they want to build a
1117 # bytecode module from the sources. We compile all the
1118 # sources and link it together into a single bytecode
1120 #---------------------------------------------------------
1123 ifeq ($(strip $(LLVMCC)),)
1124 $(warning Modules require LLVM capable compiler but none is available ****)
1127 Module := $(LibDir)/$(MODULE_NAME).bc
1128 LinkModule := $(LLVMLD) -r
1131 ifdef EXPORTED_SYMBOL_FILE
1132 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1135 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1136 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1137 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1139 all-local:: $(Module)
1142 ifneq ($(strip $(Module)),)
1143 -$(Verb) $(RM) -f $(Module)
1146 ifdef BYTECODE_DESTINATION
1147 ModuleDestDir := $(BYTECODE_DESTINATION)
1149 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1154 $(Echo) Install circumvented with NO_INSTALL
1156 $(Echo) Uninstall circumvented with NO_INSTALL
1158 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1160 install-module:: $(DestModule)
1161 install-local:: $(DestModule)
1163 $(DestModule): $(ModuleDestDir) $(Module)
1164 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1165 $(Verb) $(DataInstall) $(Module) $(DestModule)
1168 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1169 -$(Verb) $(RM) -f $(DestModule)
1175 # if we're building a library ...
1178 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1179 LIBRARYNAME := $(strip $(LIBRARYNAME))
1180 ifdef LOADABLE_MODULE
1181 BaseLibName.A := $(LIBRARYNAME).a
1182 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1184 BaseLibName.A := lib$(LIBRARYNAME).a
1185 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1187 LibName.A := $(LibDir)/$(BaseLibName.A)
1188 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1189 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1190 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1192 #---------------------------------------------------------
1193 # Shared Library Targets:
1194 # If the user asked for a shared library to be built
1195 # with the SHARED_LIBRARY variable, then we provide
1196 # targets for building them.
1197 #---------------------------------------------------------
1198 ifdef SHARED_LIBRARY
1200 all-local:: $(LibName.SO)
1202 ifdef EXPORTED_SYMBOL_FILE
1203 $(LibName.SO): $(NativeExportsFile)
1206 ifdef LINK_LIBS_IN_SHARED
1207 ifdef LOADABLE_MODULE
1208 SharedLibKindMessage := "Loadable Module"
1209 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1211 SharedLibKindMessage := "Shared Library"
1213 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1214 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1216 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1217 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1219 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1220 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1221 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1225 ifneq ($(strip $(LibName.SO)),)
1226 -$(Verb) $(RM) -f $(LibName.SO)
1231 $(Echo) Install circumvented with NO_INSTALL
1233 $(Echo) Uninstall circumvented with NO_INSTALL
1236 # Win32.DLL prefers to be located on the "PATH" of binaries.
1237 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1238 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1240 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1242 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1244 install-local:: $(DestSharedLib)
1246 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1247 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1248 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1251 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1252 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1256 #---------------------------------------------------------
1257 # Bytecode Library Targets:
1258 # If the user asked for a bytecode library to be built
1259 # with the BYTECODE_LIBRARY variable, then we provide
1260 # targets for building them.
1261 #---------------------------------------------------------
1262 ifdef BYTECODE_LIBRARY
1263 ifeq ($(strip $(LLVMCC)),)
1264 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1267 all-local:: $(LibName.BCA)
1269 ifdef EXPORTED_SYMBOL_FILE
1270 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1272 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1273 $(LLVMToolDir)/llvm-ar
1274 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1276 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1278 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1280 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1281 $(LLVMToolDir)/llvm-ar
1282 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1284 $(Verb) $(LArchive) $@ $(ObjectsBC)
1289 ifneq ($(strip $(LibName.BCA)),)
1290 -$(Verb) $(RM) -f $(LibName.BCA)
1293 ifdef BYTECODE_DESTINATION
1294 BytecodeDestDir := $(BYTECODE_DESTINATION)
1296 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1299 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1301 install-bytecode-local:: $(DestBytecodeLib)
1305 $(Echo) Install circumvented with NO_INSTALL
1307 $(Echo) Uninstall circumvented with NO_INSTALL
1309 install-local:: $(DestBytecodeLib)
1311 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1312 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1313 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1316 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1317 -$(Verb) $(RM) -f $(DestBytecodeLib)
1322 #---------------------------------------------------------
1324 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1325 # building an archive.
1326 #---------------------------------------------------------
1327 ifndef NO_BUILD_ARCHIVE
1328 ifndef BUILD_ARCHIVE
1329 ifndef LOADABLE_MODULE
1335 #---------------------------------------------------------
1336 # Archive Library Targets:
1337 # If the user wanted a regular archive library built,
1338 # then we provide targets for building them.
1339 #---------------------------------------------------------
1342 all-local:: $(LibName.A)
1344 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1345 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1346 -$(Verb) $(RM) -f $@
1347 $(Verb) $(Archive) $@ $(ObjectsO)
1348 $(Verb) $(Ranlib) $@
1351 ifneq ($(strip $(LibName.A)),)
1352 -$(Verb) $(RM) -f $(LibName.A)
1357 $(Echo) Install circumvented with NO_INSTALL
1359 $(Echo) Uninstall circumvented with NO_INSTALL
1361 ifdef NO_INSTALL_ARCHIVES
1363 $(Echo) Install circumvented with NO_INSTALL
1365 $(Echo) Uninstall circumvented with NO_INSTALL
1367 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1369 install-local:: $(DestArchiveLib)
1371 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1372 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1373 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1374 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1377 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1378 -$(Verb) $(RM) -f $(DestArchiveLib)
1386 ###############################################################################
1387 # Tool Build Rules: Build executable tool based on TOOLNAME option
1388 ###############################################################################
1392 #---------------------------------------------------------
1393 # Set up variables for building a tool.
1394 #---------------------------------------------------------
1395 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1397 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1399 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1402 # TOOLALIAS is a name to symlink (or copy) the tool to.
1405 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1407 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1411 #---------------------------------------------------------
1413 #---------------------------------------------------------
1415 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1416 # not exporting all of the weak symbols from the binary. This reduces dyld
1417 # startup time by 4x on darwin in some cases.
1418 ifdef TOOL_NO_EXPORTS
1419 ifeq ($(HOST_OS),Darwin)
1421 # Tiger tools don't support this.
1422 ifneq ($(DARWIN_MAJVERS),4)
1423 LD.Flags += -Wl,-exported_symbol,_main
1427 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1428 ifneq ($(ARCH), Mips)
1429 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1434 #---------------------------------------------------------
1435 # Tool Order File Support
1436 #---------------------------------------------------------
1438 ifeq ($(HOST_OS),Darwin)
1439 ifdef TOOL_ORDER_FILE
1441 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1446 #---------------------------------------------------------
1447 # Tool Version Info Support
1448 #---------------------------------------------------------
1450 ifeq ($(HOST_OS),Darwin)
1451 ifdef TOOL_INFO_PLIST
1453 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1455 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1457 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1458 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1459 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1460 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1461 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1462 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1468 #---------------------------------------------------------
1469 # Provide targets for building the tools
1470 #---------------------------------------------------------
1471 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1474 ifneq ($(strip $(ToolBuildPath)),)
1475 -$(Verb) $(RM) -f $(ToolBuildPath)
1477 ifneq ($(strip $(ToolAliasBuildPath)),)
1478 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1482 $(ToolBuildPath): $(ExmplDir)/.dir
1484 $(ToolBuildPath): $(ToolDir)/.dir
1487 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1488 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1489 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1490 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1491 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1494 ifneq ($(strip $(ToolAliasBuildPath)),)
1495 $(ToolAliasBuildPath): $(ToolBuildPath)
1496 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1497 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1498 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1499 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1505 $(Echo) Install circumvented with NO_INSTALL
1507 $(Echo) Uninstall circumvented with NO_INSTALL
1511 ToolBinDir = $(DESTDIR)$(PROJ_internal_prefix)/bin
1513 ToolBinDir = $(DESTDIR)$(PROJ_bindir)
1515 DestTool = $(ToolBinDir)/$(TOOLEXENAME)
1517 install-local:: $(DestTool)
1519 $(DestTool): $(ToolBuildPath)
1520 $(Echo) Installing $(BuildMode) $(DestTool)
1521 $(Verb) $(MKDIR) $(ToolBinDir)
1522 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1525 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1526 -$(Verb) $(RM) -f $(DestTool)
1528 # TOOLALIAS install.
1530 DestToolAlias = $(ToolBinDir)/$(TOOLALIAS)$(EXEEXT)
1532 install-local:: $(DestToolAlias)
1534 $(DestToolAlias): $(DestTool)
1535 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1536 $(Verb) $(RM) -f $(DestToolAlias)
1537 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1540 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1541 -$(Verb) $(RM) -f $(DestToolAlias)
1547 ###############################################################################
1548 # Object Build Rules: Build object files based on sources
1549 ###############################################################################
1551 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1552 ifeq ($(HOST_OS),HP-UX)
1553 DISABLE_AUTO_DEPENDENCIES=1
1556 # Provide rule sets for when dependency generation is enabled
1557 ifndef DISABLE_AUTO_DEPENDENCIES
1559 #---------------------------------------------------------
1560 # Create .o files in the ObjDir directory from the .cpp and .c files...
1561 #---------------------------------------------------------
1563 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1564 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1566 # If the build succeeded, move the dependency file over, otherwise
1568 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1569 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1571 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1572 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1573 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1576 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1577 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1578 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1581 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1582 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1583 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1586 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1587 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1588 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1591 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1592 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1593 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1596 #---------------------------------------------------------
1597 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1598 #---------------------------------------------------------
1600 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1601 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1603 # If the build succeeded, move the dependency file over, otherwise
1605 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1606 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1608 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1609 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1610 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1611 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1612 $(BC_DEPEND_MOVEFILE)
1614 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1615 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1616 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1617 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1618 $(BC_DEPEND_MOVEFILE)
1620 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1621 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1622 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1623 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1624 $(BC_DEPEND_MOVEFILE)
1626 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1627 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1628 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1629 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1630 $(BC_DEPEND_MOVEFILE)
1632 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1633 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1634 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1635 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1636 $(BC_DEPEND_MOVEFILE)
1638 # Provide alternate rule sets if dependencies are disabled
1641 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1642 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1643 $(Compile.CXX) $< -o $@
1645 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1646 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1647 $(Compile.CXX) $< -o $@
1649 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1650 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1651 $(Compile.CXX) $< -o $@
1653 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1654 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1655 $(Compile.C) $< -o $@
1657 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1658 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1659 $(Compile.C) $< -o $@
1661 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1662 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1663 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1665 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1666 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1667 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1669 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1670 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1671 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1673 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1674 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1675 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1677 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1678 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1679 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1684 ## Rules for building preprocessed (.i/.ii) outputs.
1685 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1686 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1687 $(Verb) $(Preprocess.CXX) $< -o $@
1689 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1690 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1691 $(Verb) $(Preprocess.CXX) $< -o $@
1693 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1694 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1695 $(Verb) $(Preprocess.CXX) $< -o $@
1697 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1698 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1699 $(Verb) $(Preprocess.C) $< -o $@
1701 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1702 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1703 $(Verb) $(Preprocess.C) $< -o $@
1706 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1707 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1708 $(Compile.CXX) $< -o $@ -S
1710 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1711 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1712 $(Compile.CXX) $< -o $@ -S
1714 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1715 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1716 $(Compile.CXX) $< -o $@ -S
1718 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1719 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1720 $(Compile.C) $< -o $@ -S
1722 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1723 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1724 $(Compile.C) $< -o $@ -S
1727 # make the C and C++ compilers strip debug info out of bytecode libraries.
1729 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1730 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1731 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1733 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1734 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1735 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1739 #---------------------------------------------------------
1740 # Provide rule to build .bc files from .ll sources,
1741 # regardless of dependencies
1742 #---------------------------------------------------------
1743 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1744 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1745 $(Verb) $(LLVMAS) $< -f -o $@
1747 ###############################################################################
1748 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1749 ###############################################################################
1752 TABLEGEN_INC_FILES_COMMON = 1
1755 ifdef TABLEGEN_INC_FILES_COMMON
1757 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1758 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1759 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1761 # INCFiles rule: All of the tblgen generated files are emitted to
1762 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1763 # us to only "touch" the real file if the contents of it change. IOW, if
1764 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1765 # dependencies of the .inc files are, unless the contents of the .inc file
1767 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1768 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1770 endif # TABLEGEN_INC_FILES_COMMON
1774 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1775 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1776 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1777 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1778 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1779 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1780 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1782 # All .inc.tmp files depend on the .td files.
1783 $(INCTMPFiles) : $(TDFiles)
1785 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1786 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1787 $(Echo) "Building $(<F) register info implementation with tblgen"
1788 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1790 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1791 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1792 $(Echo) "Building $(<F) instruction information with tblgen"
1793 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1795 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1796 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1797 $(Echo) "Building $(<F) assembly writer with tblgen"
1798 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1800 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1801 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1802 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1803 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1805 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1806 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1807 $(Echo) "Building $(<F) assembly matcher with tblgen"
1808 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1810 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1811 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1812 $(Echo) "Building $(<F) MC code emitter with tblgen"
1813 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1815 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1816 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1817 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1818 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1820 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1821 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1822 $(Echo) "Building $(<F) code emitter with tblgen"
1823 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1825 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1826 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1827 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1828 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1830 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1831 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1832 $(Echo) "Building $(<F) disassembly tables with tblgen"
1833 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1835 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1836 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1837 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1838 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1840 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1841 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1842 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1843 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1845 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1846 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1847 $(Echo) "Building $(<F) subtarget information with tblgen"
1848 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1850 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1851 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1852 $(Echo) "Building $(<F) calling convention information with tblgen"
1853 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1855 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1856 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1857 $(Echo) "Building $(<F) intrinsics information with tblgen"
1858 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1860 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1861 $(Echo) "Building $(<F) decoder tables with tblgen"
1862 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1864 $(ObjDir)/%GenDFAPacketizer.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1865 $(Echo) "Building $(<F) DFA packetizer tables with tblgen"
1866 $(Verb) $(LLVMTableGen) -gen-dfa-packetizer -o $(call SYSPATH, $@) $<
1869 -$(Verb) $(RM) -f $(INCFiles)
1873 ###############################################################################
1874 # OTHER RULES: Other rules needed
1875 ###############################################################################
1877 # To create postscript files from dot files...
1878 ifneq ($(DOT),false)
1880 $(DOT) -Tps < $< > $@
1883 $(Echo) "Cannot build $@: The program dot is not installed"
1886 # This rules ensures that header files that are removed still have a rule for
1887 # which they can be "generated." This allows make to ignore them and
1888 # reproduce the dependency lists.
1892 # Define clean-local to clean the current directory. Note that this uses a
1893 # very conservative approach ensuring that empty variables do not cause
1894 # errors or disastrous removal.
1896 ifneq ($(strip $(ObjRootDir)),)
1897 -$(Verb) $(RM) -rf $(ObjRootDir)
1899 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1900 -$(Verb) $(RM) -f *$(SHLIBEXT)
1904 -$(Verb) $(RM) -rf Debug Release Profile
1907 ###############################################################################
1908 # DEPENDENCIES: Include the dependency files if we should
1909 ###############################################################################
1910 ifndef DISABLE_AUTO_DEPENDENCIES
1912 # If its not one of the cleaning targets
1913 ifndef IS_CLEANING_TARGET
1915 # Get the list of dependency files
1916 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1917 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1919 # Include bitcode dependency files if using bitcode libraries
1920 ifdef BYTECODE_LIBRARY
1921 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1924 -include $(DependFiles) ""
1930 ###############################################################################
1931 # CHECK: Running the test suite
1932 ###############################################################################
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 \
1939 TESTSUITE=$(TESTSUITE) ; \
1941 $(EchoCmd) No Makefile in test directory ; \
1944 $(EchoCmd) No test directory ; \
1950 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1951 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1952 $(EchoCmd) Running test suite ; \
1953 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1955 $(EchoCmd) No Makefile in test directory ; \
1958 $(EchoCmd) No test directory ; \
1962 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1963 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1964 $(EchoCmd) Running test suite ; \
1965 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1967 $(EchoCmd) No Makefile in test directory ; \
1970 $(EchoCmd) No test directory ; \
1973 ###############################################################################
1974 # UNITTESTS: Running the unittests test suite
1975 ###############################################################################
1978 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1979 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1980 $(EchoCmd) Running unittests test suite ; \
1981 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1983 $(EchoCmd) No Makefile in unittests directory ; \
1986 $(EchoCmd) No unittests directory ; \
1989 ###############################################################################
1990 # DISTRIBUTION: Handle construction of a distribution tarball
1991 ###############################################################################
1993 #------------------------------------------------------------------------
1994 # Define distribution related variables
1995 #------------------------------------------------------------------------
1996 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1997 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1998 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1999 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
2000 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
2001 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
2002 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
2003 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
2004 Makefile.config.in configure autoconf
2005 DistOther := $(notdir $(wildcard \
2006 $(PROJ_SRC_DIR)/*.h \
2007 $(PROJ_SRC_DIR)/*.td \
2008 $(PROJ_SRC_DIR)/*.def \
2009 $(PROJ_SRC_DIR)/*.ll \
2010 $(PROJ_SRC_DIR)/*.in))
2011 DistSubDirs := $(SubDirs)
2012 DistSources = $(Sources) $(EXTRA_DIST)
2013 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2015 #------------------------------------------------------------------------
2016 # We MUST build distribution with OBJ_DIR != SRC_DIR
2017 #------------------------------------------------------------------------
2018 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2019 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2020 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2024 #------------------------------------------------------------------------
2025 # Prevent attempt to run dist targets from anywhere but the top level
2026 #------------------------------------------------------------------------
2028 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2029 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2032 #------------------------------------------------------------------------
2033 # Provide the top level targets
2034 #------------------------------------------------------------------------
2036 dist-gzip:: $(DistTarGZip)
2038 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2039 $(Echo) Packing gzipped distribution tar file.
2040 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2041 $(GZIP) -c > "$(DistTarGZip)"
2043 dist-bzip2:: $(DistTarBZ2)
2045 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2046 $(Echo) Packing bzipped distribution tar file.
2047 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2048 $(BZIP2) -c >$(DistTarBZ2)
2050 dist-zip:: $(DistZip)
2052 $(DistZip) : $(TopDistDir)/.makedistdir
2053 $(Echo) Packing zipped distribution file.
2054 $(Verb) rm -f $(DistZip)
2055 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2057 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2058 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2060 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2062 dist-check:: $(DistTarGZip)
2063 $(Echo) Checking distribution tar file.
2064 $(Verb) if test -d $(DistCheckDir) ; then \
2065 $(RM) -rf $(DistCheckDir) ; \
2067 $(Verb) $(MKDIR) $(DistCheckDir)
2068 $(Verb) cd $(DistCheckDir) && \
2069 $(MKDIR) $(DistCheckDir)/build && \
2070 $(MKDIR) $(DistCheckDir)/install && \
2071 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2073 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2074 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2077 $(MAKE) unittests && \
2078 $(MAKE) install && \
2079 $(MAKE) uninstall && \
2080 $(MAKE) dist-clean && \
2081 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2084 $(Echo) Cleaning distribution files
2085 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2090 #------------------------------------------------------------------------
2091 # Provide the recursive distdir target for building the distribution directory
2092 #------------------------------------------------------------------------
2093 distdir: $(DistDir)/.makedistdir
2094 $(DistDir)/.makedistdir: $(DistSources)
2095 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2096 if test -d "$(DistDir)" ; then \
2097 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2100 $(EchoCmd) Removing old $(DistDir) ; \
2101 $(RM) -rf $(DistDir); \
2102 $(EchoCmd) Making 'all' to verify build ; \
2103 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2105 $(Echo) Building Distribution Directory $(DistDir)
2106 $(Verb) $(MKDIR) $(DistDir)
2107 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2108 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2109 for file in $(DistFiles) ; do \
2111 $(PROJ_SRC_DIR)/*) \
2112 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2114 $(PROJ_SRC_ROOT)/*) \
2115 file=`echo "$$file" | \
2116 sed "s#^$$srcrootstrip/##"` \
2119 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2120 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2121 from_dir="$(PROJ_SRC_DIR)" ; \
2122 elif test -f "$$file" || test -d "$$file" ; then \
2125 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2126 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2127 to_dir="$(DistDir)/$$dir"; \
2128 $(MKDIR) "$$to_dir" ; \
2130 to_dir="$(DistDir)"; \
2132 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2133 if test -n "$$mid_dir" ; then \
2134 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2136 if test -d "$$from_dir/$$file"; then \
2137 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2138 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2139 cd $(PROJ_SRC_DIR) ; \
2140 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2141 ( cd $$to_dir ; $(TAR) xf - ) ; \
2142 cd $(PROJ_OBJ_DIR) ; \
2145 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2146 ( cd $$to_dir ; $(TAR) xf - ) ; \
2147 cd $(PROJ_OBJ_DIR) ; \
2149 elif test -f "$$from_dir/$$file" ; then \
2150 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2151 elif test -L "$$from_dir/$$file" ; then \
2152 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2153 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2154 $(EchoCmd) "===== WARNING: Distribution Source " \
2155 "$$from_dir/$$file Not Found!" ; \
2156 elif test "$(Verb)" != '@' ; then \
2157 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2160 $(Verb) for subdir in $(DistSubDirs) ; do \
2161 if test "$$subdir" \!= "." ; then \
2162 new_distdir="$(DistDir)/$$subdir" ; \
2163 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2164 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2165 DistDir="$$new_distdir" distdir ) || exit 1; \
2168 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2169 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2170 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2171 -name .svn \) -print` ;\
2172 $(MAKE) dist-hook ; \
2173 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2174 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2175 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2176 -o ! -type d ! -perm -444 -exec \
2177 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2178 || chmod -R a+r $(DistDir) ; \
2181 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2187 ###############################################################################
2188 # TOP LEVEL - targets only to apply at the top level directory
2189 ###############################################################################
2193 #------------------------------------------------------------------------
2194 # Install support for the project's include files:
2195 #------------------------------------------------------------------------
2198 $(Echo) Install circumvented with NO_INSTALL
2200 $(Echo) Uninstall circumvented with NO_INSTALL
2203 $(Echo) Installing include files
2204 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2205 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2206 cd $(PROJ_SRC_ROOT)/include && \
2207 for hdr in `find . -type f \
2208 '(' -name LICENSE.TXT \
2213 ')' -print | grep -v CVS | \
2214 grep -v .svn` ; do \
2215 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2216 if test \! -d "$$instdir" ; then \
2217 $(EchoCmd) Making install directory $$instdir ; \
2218 $(MKDIR) $$instdir ;\
2220 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2223 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2224 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2225 cd $(PROJ_OBJ_ROOT)/include && \
2226 for hdr in `find . -type f \
2227 '(' -name LICENSE.TXT \
2232 ')' -print | grep -v CVS | \
2233 grep -v .svn` ; do \
2234 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2235 if test \! -d "$$instdir" ; then \
2236 $(EchoCmd) Making install directory $$instdir ; \
2237 $(MKDIR) $$instdir ;\
2239 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2245 $(Echo) Uninstalling include files
2246 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2247 cd $(PROJ_SRC_ROOT)/include && \
2248 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2249 '!' '(' -name '*~' -o -name '.#*' \
2250 -o -name '*.in' ')' -print ')' | \
2251 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2252 cd $(PROJ_SRC_ROOT)/include && \
2253 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2254 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2260 @echo searching for overlength lines in files: $(Sources)
2263 egrep -n '.{81}' $(Sources) /dev/null
2266 @echo searching for tabs in files: $(Sources)
2269 egrep -n ' ' $(Sources) /dev/null
2272 @ls -l $(LibDir) | awk '\
2273 BEGIN { sum = 0; } \
2275 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2276 @ls -l $(ToolDir) | awk '\
2277 BEGIN { sum = 0; } \
2279 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2280 #------------------------------------------------------------------------
2281 # Print out the directories used for building
2282 #------------------------------------------------------------------------
2284 $(Echo) "BuildMode : " '$(BuildMode)'
2285 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2286 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2287 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2288 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2289 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2290 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2291 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2292 $(Echo) "PROJ_internal_prefix : " '$(PROJ_internal_prefix)'
2293 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2294 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2295 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2296 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2297 $(Echo) "UserTargets : " '$(UserTargets)'
2298 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2299 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2300 $(Echo) "ObjDir : " '$(ObjDir)'
2301 $(Echo) "LibDir : " '$(LibDir)'
2302 $(Echo) "ToolDir : " '$(ToolDir)'
2303 $(Echo) "ExmplDir : " '$(ExmplDir)'
2304 $(Echo) "Sources : " '$(Sources)'
2305 $(Echo) "TDFiles : " '$(TDFiles)'
2306 $(Echo) "INCFiles : " '$(INCFiles)'
2307 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2308 $(Echo) "PreConditions: " '$(PreConditions)'
2309 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2310 $(Echo) "Compile.C : " '$(Compile.C)'
2311 $(Echo) "Archive : " '$(Archive)'
2312 $(Echo) "YaccFiles : " '$(YaccFiles)'
2313 $(Echo) "LexFiles : " '$(LexFiles)'
2314 $(Echo) "Module : " '$(Module)'
2315 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2316 $(Echo) "SubDirs : " '$(SubDirs)'
2317 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2318 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2323 # General debugging rule, use 'make dbg-print-XXX' to print the
2324 # definition, value and origin of XXX.
2326 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))