1 #===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 # This file is included by all of the LLVM makefiles. For details on how to use
11 # it properly, please see the document MakefileGuide.html in the docs directory.
13 #===-----------------------------------------------------------------------====#
15 ################################################################################
16 # TARGETS: Define standard targets that can be invoked
17 ################################################################################
19 #--------------------------------------------------------------------
20 # Define the various target sets
21 #--------------------------------------------------------------------
22 RecursiveTargets := all clean clean-all install uninstall install-bytecode \
24 LocalTargets := all-local clean-local clean-all-local check-local \
25 install-local printvars uninstall-local \
26 install-bytecode-local
27 TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
29 UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
30 InternalTargets := preconditions distdir dist-hook
32 ################################################################################
33 # INITIALIZATION: Basic things the makefile needs
34 ################################################################################
36 #--------------------------------------------------------------------
37 # Set the VPATH so that we can find source files.
38 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Reset the list of suffixes we know how to build.
43 #--------------------------------------------------------------------
45 .SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm
46 .SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
48 #--------------------------------------------------------------------
49 # Mark all of these targets as phony to avoid implicit rule search
50 #--------------------------------------------------------------------
51 .PHONY: $(UserTargets) $(InternalTargets)
53 #--------------------------------------------------------------------
54 # Make sure all the user-target rules are double colon rules and
55 # they are defined first.
56 #--------------------------------------------------------------------
60 #------------------------------------------------------------------------
61 # LLVMBuild Integration
62 #------------------------------------------------------------------------
64 # We use llvm-build to generate all the data required by the Makefile based
65 # build system in one swoop:
67 # - We generate a file (a Makefile fragment) in the object root which contains
68 # all the definitions that are required by Makefiles across the entire
71 # - We generate the library table used by llvm-config.
73 # - We generate the dependencies for the Makefile fragment, so that we will
74 # automatically reconfigure outselves.
76 # The path to the llvm-build tool itself.
77 LLVMBuildTool := $(PROJ_SRC_ROOT)/utils/llvm-build/llvm-build
79 # The files we are going to generate using llvm-build.
80 LLVMBuildMakeFrag := $(PROJ_OBJ_ROOT)/Makefile.llvmbuild
81 LLVMConfigLibraryDependenciesInc := \
82 $(PROJ_OBJ_ROOT)/tools/llvm-config/LibraryDependencies.inc
84 # This is for temporary backwards compatibility.
85 ifndef TARGET_NATIVE_ARCH
86 TARGET_NATIVE_ARCH := $(ARCH)
89 # The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
92 # Note that this target gets its real dependencies generated for us by
95 # We include a dependency on this Makefile to ensure that changes to the
96 # generation command get picked up.
97 $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules \
98 $(PROJ_OBJ_ROOT)/Makefile.config
99 $(Echo) Constructing LLVMBuild project information.
100 $(Verb) $(LLVMBuildTool) \
101 --native-target "$(TARGET_NATIVE_ARCH)" \
102 --enable-targets "$(TARGETS_TO_BUILD)" \
103 --write-library-table $(LLVMConfigLibraryDependenciesInc) \
104 --write-make-fragment $(LLVMBuildMakeFrag)
106 # For completeness, let Make know how the extra files are generated.
107 $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
109 # Include the generated Makefile fragment.
111 # We currently only include the dependencies for the fragment itself if we are
112 # at the top-level. Otherwise, recursive invocations would ends up doing
113 # substantially more redundant stat'ing.
115 # This means that we won't properly regenerate things for developers used to
116 # building from a subdirectory, but that is always somewhat unreliable.
118 LLVMBUILD_INCLUDE_DEPENDENCIES := 1
120 # Clean the generated makefile fragment at the top-level.
122 -$(Verb) $(RM) -f $(LLVMBuildMakeFrag)
124 -include $(LLVMBuildMakeFrag)
126 ################################################################################
127 # PRECONDITIONS: that which must be built/checked first
128 ################################################################################
130 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
131 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
132 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
133 ConfigureScript := $(PROJ_SRC_ROOT)/configure
134 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
135 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
136 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
137 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
138 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
139 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
140 ifneq ($(MakefileCommonIn),)
141 PreConditions += $(MakefileCommon)
144 ifneq ($(MakefileConfigIn),)
145 PreConditions += $(MakefileConfig)
148 preconditions: $(PreConditions)
150 #------------------------------------------------------------------------
151 # Make sure the BUILT_SOURCES are built first
152 #------------------------------------------------------------------------
153 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
156 ifneq ($(strip $(BUILT_SOURCES)),)
157 -$(Verb) $(RM) -f $(BUILT_SOURCES)
160 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
162 $(Verb) if test -x config.status ; then \
163 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
164 $(MKDIR) .spotless.save ; \
165 $(MV) config.status .spotless.save ; \
166 $(MV) mklib .spotless.save ; \
167 $(MV) projects .spotless.save ; \
169 $(MV) .spotless.save/config.status . ; \
170 $(MV) .spotless.save/mklib . ; \
171 $(MV) .spotless.save/projects . ; \
172 $(RM) -rf .spotless.save ; \
173 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
174 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
175 $(ConfigStatusScript) ; \
177 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
181 $(EchoCmd) "spotless target not supported for objdir == srcdir"
184 $(BUILT_SOURCES) : $(ObjMakefiles)
186 #------------------------------------------------------------------------
187 # Make sure we're not using a stale configuration
188 #------------------------------------------------------------------------
190 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
191 $(Verb) cd $(PROJ_OBJ_ROOT) && \
192 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
193 $(ConfigStatusScript)
195 .PRECIOUS: $(ConfigStatusScript)
196 $(ConfigStatusScript): $(ConfigureScript)
197 $(Echo) Reconfiguring with $<
198 $(Verb) cd $(PROJ_OBJ_ROOT) && \
199 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
200 $(ConfigStatusScript)
202 #------------------------------------------------------------------------
203 # Make sure the configuration makefile is up to date
204 #------------------------------------------------------------------------
205 ifneq ($(MakefileConfigIn),)
206 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
207 $(Echo) Regenerating $@
208 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
211 ifneq ($(MakefileCommonIn),)
212 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
213 $(Echo) Regenerating $@
214 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
217 #------------------------------------------------------------------------
218 # If the Makefile in the source tree has been updated, copy it over into the
219 # build tree. But, only do this if the source and object makefiles differ
220 #------------------------------------------------------------------------
222 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
225 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
227 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
228 $(Echo) "Updating Makefile"
229 $(Verb) $(MKDIR) $(@D)
230 $(Verb) $(CP) -f $< $@
232 # Copy the Makefile.* files unless we're in the root directory which avoids
233 # the copying of Makefile.config.in or other things that should be explicitly
235 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
237 *Makefile.rules) ;; \
239 *) $(EchoCmd) "Updating $(@F)" ; \
246 #------------------------------------------------------------------------
247 # Set up the basic dependencies
248 #------------------------------------------------------------------------
249 $(UserTargets):: $(PreConditions)
253 clean-all:: clean-local clean-all-local
254 install:: install-local
255 uninstall:: uninstall-local
256 install-local:: all-local
257 install-bytecode:: install-bytecode-local
259 ###############################################################################
260 # VARIABLES: Set up various variables based on configuration data
261 ###############################################################################
263 # Variable for if this make is for a "cleaning" target
264 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
268 #--------------------------------------------------------------------
269 # Variables derived from configuration we are building
270 #--------------------------------------------------------------------
273 ifeq ($(ENABLE_OPTIMIZED),1)
275 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
276 ifneq ($(HOST_OS),FreeBSD)
277 ifneq ($(HOST_OS),Darwin)
278 OmitFramePointer := -fomit-frame-pointer
282 # Darwin requires -fstrict-aliasing to be explicitly enabled.
283 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
284 # with -fstrict-aliasing and ipa-type-escape radr://6756684
285 #ifeq ($(HOST_OS),Darwin)
286 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
288 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
289 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
290 LD.Flags += $(OPTIMIZE_OPTION)
292 BuildMode := $(BuildMode)+Debug
299 ifdef NO_DEBUG_SYMBOLS
300 BuildMode := Unoptimized
314 ifeq ($(ENABLE_LIBCPP),1)
315 CXX.Flags += -stdlib=libc++
316 LD.Flags += -stdlib=libc++
319 ifeq ($(ENABLE_PROFILING),1)
320 BuildMode := $(BuildMode)+Profile
321 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
322 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
323 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
327 ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
328 CXX.Flags += -fvisibility-inlines-hidden
331 ifdef ENABLE_EXPENSIVE_CHECKS
332 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
333 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
337 # IF REQUIRES_EH=1 is specified then don't disable exceptions
339 CXX.Flags += -fno-exceptions
341 # If the library requires EH, it also requires RTTI.
345 ifdef REQUIRES_FRAME_POINTER
346 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
347 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
348 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
351 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
352 ifneq ($(REQUIRES_RTTI), 1)
353 CXX.Flags += -fno-rtti
356 ifeq ($(ENABLE_COVERAGE),1)
357 BuildMode := $(BuildMode)+Coverage
358 CXX.Flags += -ftest-coverage -fprofile-arcs
359 C.Flags += -ftest-coverage -fprofile-arcs
362 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
363 # then disable assertions by defining the appropriate preprocessor symbols.
364 ifeq ($(DISABLE_ASSERTIONS),1)
365 CPP.Defines += -DNDEBUG
367 BuildMode := $(BuildMode)+Asserts
368 CPP.Defines += -D_DEBUG
371 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
372 # configured), then enable expensive checks by defining the
373 # appropriate preprocessor symbols.
374 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
375 BuildMode := $(BuildMode)+Checks
376 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
379 # LOADABLE_MODULE implies several other things so we force them to be
381 ifdef LOADABLE_MODULE
383 LINK_LIBS_IN_SHARED := 1
391 ifeq ($(ENABLE_PIC),1)
392 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
393 # Nothing. Win32 defaults to PIC and warns when given -fPIC
395 ifeq ($(HOST_OS),Darwin)
396 # Common symbols not allowed in dylib files
397 CXX.Flags += -fno-common
398 C.Flags += -fno-common
400 # Linux and others; pass -fPIC
406 ifeq ($(HOST_OS),Darwin)
407 CXX.Flags += -mdynamic-no-pic
408 C.Flags += -mdynamic-no-pic
412 # Support makefile variable to disable any kind of timestamp/non-deterministic
413 # info from being used in the build.
414 ifeq ($(ENABLE_TIMESTAMPS),1)
415 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
417 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
420 ifeq ($(HOST_OS),MingW)
422 CPP.Defines += -D__NO_CTYPE_INLINE
423 ifeq ($(LLVM_CROSS_COMPILING),1)
424 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
426 LD.Flags += -Wl,--allow-multiple-definition
431 CXX.Flags += -Woverloaded-virtual
432 CPP.BaseFlags += $(CPP.Defines)
435 # Make Floating point IEEE compliant on Alpha.
438 CPP.BaseFlags += -mieee
439 ifeq ($(ENABLE_PIC),0)
441 CPP.BaseFlags += -fPIC
444 LD.Flags += -Wl,--no-relax
447 # GNU ld/PECOFF accepts but ignores them below;
451 # FIXME: autoconf should be aware of them.
452 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
453 HAVE_LINK_VERSION_SCRIPT := 0
455 RDYNAMIC := -Wl,--export-all-symbols
458 #--------------------------------------------------------------------
459 # Directory locations
460 #--------------------------------------------------------------------
462 ifeq ($(LLVM_CROSS_COMPILING),1)
463 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
466 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
467 ObjDir := $(ObjRootDir)
468 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
469 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
470 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
471 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
472 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
473 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
475 #--------------------------------------------------------------------
476 # Locations of shared libraries
477 #--------------------------------------------------------------------
480 SharedLibDir := $(LibDir)
481 LLVMSharedLibDir := $(LLVMLibDir)
483 # Win32.DLL prefers to be located on the "PATH" of binaries.
484 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
485 SharedLibDir := $(ToolDir)
486 LLVMSharedLibDir := $(LLVMToolDir)
488 ifeq ($(HOST_OS),Cygwin)
495 #--------------------------------------------------------------------
496 # LLVM Capable Compiler
497 #--------------------------------------------------------------------
499 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
501 LLVMCXX := $(LLVMGXX)
503 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
504 ifneq ($(CLANGPATH),)
505 LLVMCC := $(CLANGPATH)
506 LLVMCXX := $(CLANGXXPATH)
508 ifeq ($(ENABLE_BUILT_CLANG),1)
509 LLVMCC := $(LLVMToolDir)/clang
510 LLVMCXX := $(LLVMToolDir)/clang++
516 #--------------------------------------------------------------------
517 # Full Paths To Compiled Tools and Utilities
518 #--------------------------------------------------------------------
519 EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
520 ifdef BUILD_DIRS_ONLY
521 EchoCmd := $(EchoCmd) "(build tools)":
526 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
529 ifeq ($(LLVM_CROSS_COMPILING),1)
530 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
532 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
535 ifeq ($(LLVM_CROSS_COMPILING),1)
536 LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config$(BUILD_EXEEXT)
538 LLVM_CONFIG := $(LLVMToolDir)/llvm-config$(EXEEXT)
541 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
544 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
547 LLI := $(LLVMToolDir)/lli$(EXEEXT)
550 LLC := $(LLVMToolDir)/llc$(EXEEXT)
553 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
556 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
559 #--------------------------------------------------------------------
560 # Adjust to user's request
561 #--------------------------------------------------------------------
563 ifeq ($(HOST_OS),Darwin)
564 DARWIN_VERSION := `sw_vers -productVersion`
565 # Strip a number like 10.4.7 to 10.4
566 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
567 # Get "4" out of 10.4 for later pieces in the makefile.
568 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
570 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
571 SharedLinkOptions := -dynamiclib
573 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
576 SharedLinkOptions=-shared
579 ifeq ($(TARGET_OS),Darwin)
581 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
586 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
587 ifneq ($(HOST_OS),Darwin)
588 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
600 # Adjust settings for verbose mode
603 AR.Flags += >/dev/null 2>/dev/null
604 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
606 ConfigureScriptFLAGS :=
609 # By default, strip symbol information from executable
611 Strip := $(PLATFORMSTRIPOPTS)
612 StripWarnMsg := "(without symbols)"
613 Install.StripFlag += -s
616 ifdef TOOL_NO_EXPORTS
619 DynamicFlag := $(RDYNAMIC)
622 # Adjust linker flags for building an executable
623 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
624 ifneq ($(HOST_OS), Darwin)
626 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
628 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
630 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
634 ifneq ($(DARWIN_MAJVERS),4)
635 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
641 #----------------------------------------------------------
642 # Options To Invoke Tools
643 #----------------------------------------------------------
645 ifdef EXTRA_LD_OPTIONS
646 LD.Flags += $(EXTRA_LD_OPTIONS)
650 CompileCommonOpts += -pedantic -Wno-long-long
652 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
654 # Enable cast-qual for C++; the workaround is to use const_cast.
655 CXX.Flags += -Wcast-qual
657 ifeq ($(HOST_OS),HP-UX)
658 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
661 # If we are building a universal binary on Mac OS/X, pass extra options. This
662 # is useful to people that want to link the LLVM libraries into their universal
665 # The following can be optionally specified:
666 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
667 # For Mac OS/X 10.4 Intel machines, the traditional one is:
668 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
669 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
670 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
673 ifndef UNIVERSAL_ARCH
674 UNIVERSAL_ARCH := i386 ppc
676 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
677 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
678 ifdef UNIVERSAL_SDK_PATH
679 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
682 # Building universal cannot compute dependencies automatically.
683 DISABLE_AUTO_DEPENDENCIES=1
685 ifeq ($(TARGET_OS),Darwin)
686 ifeq ($(ARCH),x86_64)
687 TargetCommonOpts = -m64
690 TargetCommonOpts = -m32
696 ifeq ($(HOST_OS),SunOS)
697 CPP.BaseFlags += -include llvm/Support/Solaris.h
700 ifeq ($(HOST_OS),AuroraUX)
701 CPP.BaseFlags += -include llvm/Support/Solaris.h
702 endif # !HOST_OS - AuroraUX.
704 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
705 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
706 # All -I flags should go here, so that they don't confuse llvm-config.
707 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
708 $(patsubst %,-I%/include,\
709 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
710 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
713 ifeq ($(INCLUDE_BUILD_DIR),1)
714 CPP.Flags += -I$(ObjDir)
717 # SHOW_DIAGNOSTICS support.
718 ifeq ($(SHOW_DIAGNOSTICS),1)
719 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
720 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
725 Compile.C = $(Compile.Wrapper) \
726 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
727 $(TargetCommonOpts) $(CompileCommonOpts) -c
728 Compile.CXX = $(Compile.Wrapper) \
729 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
730 $(TargetCommonOpts) $(CompileCommonOpts) -c
731 Preprocess.CXX= $(Compile.Wrapper) \
732 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
733 $(CompileCommonOpts) $(CXX.Flags) -E
734 Link = $(Compile.Wrapper) \
735 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
736 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
738 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
739 $(TargetCommonOpts) $(CompileCommonOpts)
740 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
741 $(TargetCommonOpts) $(CompileCommonOpts) -E
743 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
744 $(TargetCommonOpts) $(CompileCommonOpts)
746 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
747 ScriptInstall = $(INSTALL) -m 0755
748 DataInstall = $(INSTALL) -m 0644
750 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
751 # paths. In this case, the SYSPATH function (defined in
752 # Makefile.config) transforms Unix paths into Windows paths.
753 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
754 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
755 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
756 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
757 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
759 Archive = $(AR) $(AR.Flags)
760 LArchive = $(LLVMToolDir)/llvm-ar rcsf
769 #----------------------------------------------------------
770 # Get the list of source files and compute object file
772 #----------------------------------------------------------
775 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
776 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
778 Sources := $(SOURCES)
782 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
785 BaseNameSources := $(sort $(basename $(Sources)))
787 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
788 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
790 #----------------------------------------------------------
791 # For Mingw MSYS bash and Python/w32:
793 # $(ECHOPATH) prints DOSish pathstring.
794 # ex) $(ECHOPATH) /include/sys/types.h
795 # --> C:/mingw/include/sys/types.h
796 # built-in "echo" does not transform path to DOSish path.
798 # FIXME: It would not be needed when MSYS's python
800 #----------------------------------------------------------
802 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
803 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
805 ECHOPATH := $(Verb)$(ECHO)
808 ###############################################################################
809 # DIRECTORIES: Handle recursive descent of directory structure
810 ###############################################################################
812 #---------------------------------------------------------
813 # Provide rules to make install dirs. This must be early
814 # in the file so they get built before dependencies
815 #---------------------------------------------------------
817 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
820 # To create other directories, as needed, and timestamp their creation
822 $(Verb) $(MKDIR) $* > /dev/null
823 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
825 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
826 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
828 #---------------------------------------------------------
829 # Handle the DIRS options for sequential construction
830 #---------------------------------------------------------
836 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
837 $(RecursiveTargets)::
838 $(Verb) for dir in $(DIRS); do \
839 if ([ ! -f $$dir/Makefile ] || \
840 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
842 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
844 ($(MAKE) -C $$dir $@ ) || exit 1; \
847 $(RecursiveTargets)::
848 $(Verb) for dir in $(DIRS); do \
849 ($(MAKE) -C $$dir $@ ) || exit 1; \
855 #---------------------------------------------------------
856 # Handle the EXPERIMENTAL_DIRS options ensuring success
857 # after each directory is built.
858 #---------------------------------------------------------
859 ifdef EXPERIMENTAL_DIRS
860 $(RecursiveTargets)::
861 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
862 if ([ ! -f $$dir/Makefile ] || \
863 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
865 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
867 ($(MAKE) -C $$dir $@ ) || exit 0; \
871 #-----------------------------------------------------------
872 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
873 #-----------------------------------------------------------
874 ifdef OPTIONAL_PARALLEL_DIRS
875 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
878 #-----------------------------------------------------------
879 # Handle the PARALLEL_DIRS options for parallel construction
880 #-----------------------------------------------------------
883 SubDirs += $(PARALLEL_DIRS)
885 # Unfortunately, this list must be maintained if new recursive targets are added
886 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
887 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
888 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
889 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
890 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
891 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
892 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
894 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
898 SD=$(PROJ_SRC_DIR)/$(@D); \
900 if [ ! -f $$SD/Makefile ]; then \
902 DD=$(notdir $(@D)); \
904 if ([ ! -f $$DD/Makefile ] || \
905 command test $$DD/Makefile -ot \
906 $$SD/Makefile ); then \
908 $(CP) $$SD/Makefile $$DD/Makefile; \
910 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
913 #---------------------------------------------------------
914 # Handle the OPTIONAL_DIRS options for directores that may
916 #---------------------------------------------------------
919 SubDirs += $(OPTIONAL_DIRS)
921 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
922 $(RecursiveTargets)::
923 $(Verb) for dir in $(OPTIONAL_DIRS); do \
924 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
925 if ([ ! -f $$dir/Makefile ] || \
926 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
928 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
930 ($(MAKE) -C$$dir $@ ) || exit 1; \
934 $(RecursiveTargets)::
935 $(Verb) for dir in $(OPTIONAL_DIRS); do \
936 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
937 ($(MAKE) -C$$dir $@ ) || exit 1; \
943 #---------------------------------------------------------
944 # Handle the CONFIG_FILES options
945 #---------------------------------------------------------
950 $(Echo) Install circumvented with NO_INSTALL
952 $(Echo) UnInstall circumvented with NO_INSTALL
954 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
955 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
956 $(Verb)for file in $(CONFIG_FILES); do \
957 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
958 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
959 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
960 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
962 $(ECHO) Error: cannot find config file $${file}. ; \
967 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
968 $(Verb)for file in $(CONFIG_FILES); do \
969 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
975 ###############################################################################
976 # Set up variables for building libraries
977 ###############################################################################
979 #---------------------------------------------------------
980 # Define various command line options pertaining to the
981 # libraries needed when linking. There are "Proj" libs
982 # (defined by the user's project) and "LLVM" libs (defined
983 # by the LLVM project).
984 #---------------------------------------------------------
987 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
988 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
989 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
990 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
994 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
995 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
996 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
997 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
1000 # Loadable module for Win32 requires all symbols resolved for linking.
1001 # Then all symbols in LLVM.dll will be available.
1002 ifeq ($(ENABLE_SHARED),1)
1003 ifdef LOADABLE_MODULE
1004 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
1005 LINK_COMPONENTS += all
1010 ifndef IS_CLEANING_TARGET
1011 ifdef LINK_COMPONENTS
1013 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1014 # clean in tools, then do a make in tools (instead of at the top level).
1016 @echo "*** llvm-config doesn't exist - rebuilding it."
1017 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1019 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1021 ifeq ($(ENABLE_SHARED), 1)
1022 # We can take the "auto-import" feature to get rid of using dllimport.
1023 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1024 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1027 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1028 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1031 ifndef NO_LLVM_CONFIG
1032 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1033 ifeq ($(LLVMConfigLibs),Error)
1034 $(error llvm-config --libs failed)
1036 LLVMLibsOptions += $(LLVMConfigLibs)
1037 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1038 ifeq ($(LLVMConfigLibfiles),Error)
1039 $(error llvm-config --libfiles failed)
1041 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1048 # Set up the library exports file.
1049 ifdef EXPORTED_SYMBOL_FILE
1051 # First, set up the native export file, which may differ from the source
1054 ifeq ($(HOST_OS),Darwin)
1055 # Darwin convention prefixes symbols with underscores.
1056 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1057 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1058 $(Verb) sed -e 's/^/_/' < $< > $@
1060 -$(Verb) $(RM) -f $(NativeExportsFile)
1062 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1063 # Gold and BFD ld require a version script rather than a plain list.
1064 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1065 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1066 $(Verb) echo "{" > $@
1067 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1068 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1069 ifneq ($(HOST_OS),OpenBSD)
1070 $(Verb) echo " local: *;" >> $@
1072 $(Verb) echo "};" >> $@
1074 -$(Verb) $(RM) -f $(NativeExportsFile)
1076 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1077 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1078 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1079 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1080 $(Echo) Generating $(notdir $@)
1081 $(Verb) $(ECHO) "EXPORTS" > $@
1082 $(Verb) $(CAT) $< >> $@
1084 -$(Verb) $(RM) -f $(NativeExportsFile)
1086 # Default behavior: just use the exports file verbatim.
1087 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1092 # Now add the linker command-line options to use the native export file.
1095 ifeq ($(HOST_OS),Darwin)
1096 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1099 # gold, bfd ld, etc.
1100 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1101 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1105 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1106 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1107 SharedLinkOptions += $(NativeExportsFile)
1112 ###############################################################################
1113 # Library Build Rules: Four ways to build a library
1114 ###############################################################################
1116 #---------------------------------------------------------
1117 # Bytecode Module Targets:
1118 # If the user set MODULE_NAME then they want to build a
1119 # bytecode module from the sources. We compile all the
1120 # sources and link it together into a single bytecode
1122 #---------------------------------------------------------
1125 ifeq ($(strip $(LLVMCC)),)
1126 $(warning Modules require LLVM capable compiler but none is available ****)
1129 Module := $(LibDir)/$(MODULE_NAME).bc
1130 LinkModule := $(LLVMLD) -r
1133 ifdef EXPORTED_SYMBOL_FILE
1134 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1137 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1138 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1139 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1141 all-local:: $(Module)
1144 ifneq ($(strip $(Module)),)
1145 -$(Verb) $(RM) -f $(Module)
1148 ifdef BYTECODE_DESTINATION
1149 ModuleDestDir := $(BYTECODE_DESTINATION)
1151 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1156 $(Echo) Install circumvented with NO_INSTALL
1158 $(Echo) Uninstall circumvented with NO_INSTALL
1160 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1162 install-module:: $(DestModule)
1163 install-local:: $(DestModule)
1165 $(DestModule): $(ModuleDestDir) $(Module)
1166 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1167 $(Verb) $(DataInstall) $(Module) $(DestModule)
1170 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1171 -$(Verb) $(RM) -f $(DestModule)
1177 # if we're building a library ...
1180 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1181 LIBRARYNAME := $(strip $(LIBRARYNAME))
1182 ifdef LOADABLE_MODULE
1183 BaseLibName.A := $(LIBRARYNAME).a
1184 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1186 BaseLibName.A := lib$(LIBRARYNAME).a
1187 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1189 LibName.A := $(LibDir)/$(BaseLibName.A)
1190 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1191 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1192 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1194 #---------------------------------------------------------
1195 # Shared Library Targets:
1196 # If the user asked for a shared library to be built
1197 # with the SHARED_LIBRARY variable, then we provide
1198 # targets for building them.
1199 #---------------------------------------------------------
1200 ifdef SHARED_LIBRARY
1202 all-local:: $(LibName.SO)
1204 ifdef EXPORTED_SYMBOL_FILE
1205 $(LibName.SO): $(NativeExportsFile)
1208 ifdef LINK_LIBS_IN_SHARED
1209 ifdef LOADABLE_MODULE
1210 SharedLibKindMessage := "Loadable Module"
1211 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1213 SharedLibKindMessage := "Shared Library"
1215 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1216 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1218 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1219 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1221 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1222 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1223 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1227 ifneq ($(strip $(LibName.SO)),)
1228 -$(Verb) $(RM) -f $(LibName.SO)
1233 $(Echo) Install circumvented with NO_INSTALL
1235 $(Echo) Uninstall circumvented with NO_INSTALL
1238 # Win32.DLL prefers to be located on the "PATH" of binaries.
1239 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1240 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1242 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1244 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1246 install-local:: $(DestSharedLib)
1248 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1249 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1250 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1253 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1254 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1258 #---------------------------------------------------------
1259 # Bytecode Library Targets:
1260 # If the user asked for a bytecode library to be built
1261 # with the BYTECODE_LIBRARY variable, then we provide
1262 # targets for building them.
1263 #---------------------------------------------------------
1264 ifdef BYTECODE_LIBRARY
1265 ifeq ($(strip $(LLVMCC)),)
1266 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1269 all-local:: $(LibName.BCA)
1271 ifdef EXPORTED_SYMBOL_FILE
1272 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1274 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1275 $(LLVMToolDir)/llvm-ar
1276 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1278 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1280 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1282 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1283 $(LLVMToolDir)/llvm-ar
1284 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1286 $(Verb) $(LArchive) $@ $(ObjectsBC)
1291 ifneq ($(strip $(LibName.BCA)),)
1292 -$(Verb) $(RM) -f $(LibName.BCA)
1295 ifdef BYTECODE_DESTINATION
1296 BytecodeDestDir := $(BYTECODE_DESTINATION)
1298 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1301 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1303 install-bytecode-local:: $(DestBytecodeLib)
1307 $(Echo) Install circumvented with NO_INSTALL
1309 $(Echo) Uninstall circumvented with NO_INSTALL
1311 install-local:: $(DestBytecodeLib)
1313 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1314 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1315 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1318 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1319 -$(Verb) $(RM) -f $(DestBytecodeLib)
1324 #---------------------------------------------------------
1326 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1327 # building an archive.
1328 #---------------------------------------------------------
1329 ifndef NO_BUILD_ARCHIVE
1330 ifndef BUILD_ARCHIVE
1331 ifndef LOADABLE_MODULE
1337 #---------------------------------------------------------
1338 # Archive Library Targets:
1339 # If the user wanted a regular archive library built,
1340 # then we provide targets for building them.
1341 #---------------------------------------------------------
1344 all-local:: $(LibName.A)
1346 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1347 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1348 -$(Verb) $(RM) -f $@
1349 $(Verb) $(Archive) $@ $(ObjectsO)
1350 $(Verb) $(Ranlib) $@
1353 ifneq ($(strip $(LibName.A)),)
1354 -$(Verb) $(RM) -f $(LibName.A)
1359 $(Echo) Install circumvented with NO_INSTALL
1361 $(Echo) Uninstall circumvented with NO_INSTALL
1363 ifdef NO_INSTALL_ARCHIVES
1365 $(Echo) Install circumvented with NO_INSTALL
1367 $(Echo) Uninstall circumvented with NO_INSTALL
1369 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1371 install-local:: $(DestArchiveLib)
1373 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1374 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1375 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1376 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1379 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1380 -$(Verb) $(RM) -f $(DestArchiveLib)
1388 ###############################################################################
1389 # Tool Build Rules: Build executable tool based on TOOLNAME option
1390 ###############################################################################
1394 #---------------------------------------------------------
1395 # Set up variables for building a tool.
1396 #---------------------------------------------------------
1397 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1399 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1401 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1404 # TOOLALIAS is a name to symlink (or copy) the tool to.
1407 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1409 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1413 #---------------------------------------------------------
1415 #---------------------------------------------------------
1417 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1418 # not exporting all of the weak symbols from the binary. This reduces dyld
1419 # startup time by 4x on darwin in some cases.
1420 ifdef TOOL_NO_EXPORTS
1421 ifeq ($(HOST_OS),Darwin)
1423 # Tiger tools don't support this.
1424 ifneq ($(DARWIN_MAJVERS),4)
1425 LD.Flags += -Wl,-exported_symbol,_main
1429 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1430 ifneq ($(ARCH), Mips)
1431 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1436 #---------------------------------------------------------
1437 # Tool Order File Support
1438 #---------------------------------------------------------
1440 ifeq ($(HOST_OS),Darwin)
1441 ifdef TOOL_ORDER_FILE
1443 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1448 #---------------------------------------------------------
1449 # Tool Version Info Support
1450 #---------------------------------------------------------
1452 ifeq ($(HOST_OS),Darwin)
1453 ifdef TOOL_INFO_PLIST
1455 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1457 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1459 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1460 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1461 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1462 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1463 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1464 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1470 #---------------------------------------------------------
1471 # Provide targets for building the tools
1472 #---------------------------------------------------------
1473 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1476 ifneq ($(strip $(ToolBuildPath)),)
1477 -$(Verb) $(RM) -f $(ToolBuildPath)
1479 ifneq ($(strip $(ToolAliasBuildPath)),)
1480 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1484 $(ToolBuildPath): $(ExmplDir)/.dir
1486 $(ToolBuildPath): $(ToolDir)/.dir
1489 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1490 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1491 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1492 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1493 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1496 ifneq ($(strip $(ToolAliasBuildPath)),)
1497 $(ToolAliasBuildPath): $(ToolBuildPath)
1498 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1499 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1500 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1501 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1507 $(Echo) Install circumvented with NO_INSTALL
1509 $(Echo) Uninstall circumvented with NO_INSTALL
1513 ToolBinDir = $(DESTDIR)$(PROJ_internal_prefix)/bin
1515 ToolBinDir = $(DESTDIR)$(PROJ_bindir)
1517 DestTool = $(ToolBinDir)/$(TOOLEXENAME)
1519 install-local:: $(DestTool)
1521 $(DestTool): $(ToolBuildPath)
1522 $(Echo) Installing $(BuildMode) $(DestTool)
1523 $(Verb) $(MKDIR) $(ToolBinDir)
1524 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1527 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1528 -$(Verb) $(RM) -f $(DestTool)
1530 # TOOLALIAS install.
1532 DestToolAlias = $(ToolBinDir)/$(TOOLALIAS)$(EXEEXT)
1534 install-local:: $(DestToolAlias)
1536 $(DestToolAlias): $(DestTool)
1537 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1538 $(Verb) $(RM) -f $(DestToolAlias)
1539 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1542 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1543 -$(Verb) $(RM) -f $(DestToolAlias)
1549 ###############################################################################
1550 # Object Build Rules: Build object files based on sources
1551 ###############################################################################
1553 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1554 ifeq ($(HOST_OS),HP-UX)
1555 DISABLE_AUTO_DEPENDENCIES=1
1558 # Provide rule sets for when dependency generation is enabled
1559 ifndef DISABLE_AUTO_DEPENDENCIES
1561 #---------------------------------------------------------
1562 # Create .o files in the ObjDir directory from the .cpp and .c files...
1563 #---------------------------------------------------------
1565 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1566 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1568 # If the build succeeded, move the dependency file over, otherwise
1570 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1571 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1573 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1574 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1575 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1578 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1579 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1580 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1583 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1584 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1585 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1588 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1589 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1590 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1593 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1594 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1595 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1598 #---------------------------------------------------------
1599 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1600 #---------------------------------------------------------
1602 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1603 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1605 # If the build succeeded, move the dependency file over, otherwise
1607 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1608 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1610 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1611 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1612 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1613 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1614 $(BC_DEPEND_MOVEFILE)
1616 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1617 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1618 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1619 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1620 $(BC_DEPEND_MOVEFILE)
1622 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1623 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1624 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1625 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1626 $(BC_DEPEND_MOVEFILE)
1628 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1629 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1630 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1631 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1632 $(BC_DEPEND_MOVEFILE)
1634 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1635 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1636 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1637 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1638 $(BC_DEPEND_MOVEFILE)
1640 # Provide alternate rule sets if dependencies are disabled
1643 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1644 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1645 $(Compile.CXX) $< -o $@
1647 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1648 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1649 $(Compile.CXX) $< -o $@
1651 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1652 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1653 $(Compile.CXX) $< -o $@
1655 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1656 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1657 $(Compile.C) $< -o $@
1659 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1660 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1661 $(Compile.C) $< -o $@
1663 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1664 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1665 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1667 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1668 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1669 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1671 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1672 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1673 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1675 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1676 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1677 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1679 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1680 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1681 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1686 ## Rules for building preprocessed (.i/.ii) outputs.
1687 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1688 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1689 $(Verb) $(Preprocess.CXX) $< -o $@
1691 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1692 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1693 $(Verb) $(Preprocess.CXX) $< -o $@
1695 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1696 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1697 $(Verb) $(Preprocess.CXX) $< -o $@
1699 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1700 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1701 $(Verb) $(Preprocess.C) $< -o $@
1703 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1704 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1705 $(Verb) $(Preprocess.C) $< -o $@
1708 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1709 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1710 $(Compile.CXX) $< -o $@ -S
1712 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1713 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1714 $(Compile.CXX) $< -o $@ -S
1716 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1717 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1718 $(Compile.CXX) $< -o $@ -S
1720 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1721 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1722 $(Compile.C) $< -o $@ -S
1724 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1725 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1726 $(Compile.C) $< -o $@ -S
1729 # make the C and C++ compilers strip debug info out of bytecode libraries.
1731 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1732 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1733 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1735 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1736 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1737 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1741 #---------------------------------------------------------
1742 # Provide rule to build .bc files from .ll sources,
1743 # regardless of dependencies
1744 #---------------------------------------------------------
1745 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1746 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1747 $(Verb) $(LLVMAS) $< -f -o $@
1749 ###############################################################################
1750 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1751 ###############################################################################
1754 TABLEGEN_INC_FILES_COMMON = 1
1757 ifdef TABLEGEN_INC_FILES_COMMON
1759 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1760 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1761 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1763 # INCFiles rule: All of the tblgen generated files are emitted to
1764 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1765 # us to only "touch" the real file if the contents of it change. IOW, if
1766 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1767 # dependencies of the .inc files are, unless the contents of the .inc file
1769 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1770 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1772 endif # TABLEGEN_INC_FILES_COMMON
1776 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1777 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1778 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1779 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1780 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1781 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1782 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1784 # All .inc.tmp files depend on the .td files.
1785 $(INCTMPFiles) : $(TDFiles)
1787 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1788 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1789 $(Echo) "Building $(<F) register info implementation with tblgen"
1790 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1792 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1793 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1794 $(Echo) "Building $(<F) instruction information with tblgen"
1795 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1797 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1798 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1799 $(Echo) "Building $(<F) assembly writer with tblgen"
1800 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1802 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1803 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1804 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1805 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1807 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1808 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1809 $(Echo) "Building $(<F) assembly matcher with tblgen"
1810 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1812 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1813 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1814 $(Echo) "Building $(<F) MC code emitter with tblgen"
1815 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1817 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1818 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1819 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1820 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1822 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1823 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1824 $(Echo) "Building $(<F) code emitter with tblgen"
1825 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1827 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1828 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1829 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1830 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1832 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1833 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1834 $(Echo) "Building $(<F) disassembly tables with tblgen"
1835 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1837 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1838 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1839 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1840 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1842 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1843 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1844 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1845 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1847 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1848 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1849 $(Echo) "Building $(<F) subtarget information with tblgen"
1850 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1852 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1853 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1854 $(Echo) "Building $(<F) calling convention information with tblgen"
1855 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1857 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1858 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1859 $(Echo) "Building $(<F) intrinsics information with tblgen"
1860 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1862 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1863 $(Echo) "Building $(<F) decoder tables with tblgen"
1864 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1866 $(ObjDir)/%GenDFAPacketizer.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1867 $(Echo) "Building $(<F) DFA packetizer tables with tblgen"
1868 $(Verb) $(LLVMTableGen) -gen-dfa-packetizer -o $(call SYSPATH, $@) $<
1871 -$(Verb) $(RM) -f $(INCFiles)
1875 ###############################################################################
1876 # OTHER RULES: Other rules needed
1877 ###############################################################################
1879 # To create postscript files from dot files...
1880 ifneq ($(DOT),false)
1882 $(DOT) -Tps < $< > $@
1885 $(Echo) "Cannot build $@: The program dot is not installed"
1888 # This rules ensures that header files that are removed still have a rule for
1889 # which they can be "generated." This allows make to ignore them and
1890 # reproduce the dependency lists.
1894 # Define clean-local to clean the current directory. Note that this uses a
1895 # very conservative approach ensuring that empty variables do not cause
1896 # errors or disastrous removal.
1898 ifneq ($(strip $(ObjRootDir)),)
1899 -$(Verb) $(RM) -rf $(ObjRootDir)
1901 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1902 -$(Verb) $(RM) -f *$(SHLIBEXT)
1906 -$(Verb) $(RM) -rf Debug Release Profile
1909 ###############################################################################
1910 # DEPENDENCIES: Include the dependency files if we should
1911 ###############################################################################
1912 ifndef DISABLE_AUTO_DEPENDENCIES
1914 # If its not one of the cleaning targets
1915 ifndef IS_CLEANING_TARGET
1917 # Get the list of dependency files
1918 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1919 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1921 # Include bitcode dependency files if using bitcode libraries
1922 ifdef BYTECODE_LIBRARY
1923 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1926 -include $(DependFiles) ""
1932 ###############################################################################
1933 # CHECK: Running the test suite
1934 ###############################################################################
1937 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1938 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1939 $(EchoCmd) Running test suite ; \
1940 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1941 TESTSUITE=$(TESTSUITE) ; \
1943 $(EchoCmd) No Makefile in test directory ; \
1946 $(EchoCmd) No test directory ; \
1952 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1953 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1954 $(EchoCmd) Running test suite ; \
1955 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1957 $(EchoCmd) No Makefile in test directory ; \
1960 $(EchoCmd) No test directory ; \
1964 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1965 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1966 $(EchoCmd) Running test suite ; \
1967 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1969 $(EchoCmd) No Makefile in test directory ; \
1972 $(EchoCmd) No test directory ; \
1975 ###############################################################################
1976 # UNITTESTS: Running the unittests test suite
1977 ###############################################################################
1980 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1981 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1982 $(EchoCmd) Running unittests test suite ; \
1983 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1985 $(EchoCmd) No Makefile in unittests directory ; \
1988 $(EchoCmd) No unittests directory ; \
1991 ###############################################################################
1992 # DISTRIBUTION: Handle construction of a distribution tarball
1993 ###############################################################################
1995 #------------------------------------------------------------------------
1996 # Define distribution related variables
1997 #------------------------------------------------------------------------
1998 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1999 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
2000 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
2001 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
2002 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
2003 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
2004 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
2005 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
2006 Makefile.config.in configure autoconf
2007 DistOther := $(notdir $(wildcard \
2008 $(PROJ_SRC_DIR)/*.h \
2009 $(PROJ_SRC_DIR)/*.td \
2010 $(PROJ_SRC_DIR)/*.def \
2011 $(PROJ_SRC_DIR)/*.ll \
2012 $(PROJ_SRC_DIR)/*.in))
2013 DistSubDirs := $(SubDirs)
2014 DistSources = $(Sources) $(EXTRA_DIST)
2015 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2017 #------------------------------------------------------------------------
2018 # We MUST build distribution with OBJ_DIR != SRC_DIR
2019 #------------------------------------------------------------------------
2020 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2021 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2022 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2026 #------------------------------------------------------------------------
2027 # Prevent attempt to run dist targets from anywhere but the top level
2028 #------------------------------------------------------------------------
2030 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2031 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2034 #------------------------------------------------------------------------
2035 # Provide the top level targets
2036 #------------------------------------------------------------------------
2038 dist-gzip:: $(DistTarGZip)
2040 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2041 $(Echo) Packing gzipped distribution tar file.
2042 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2043 $(GZIP) -c > "$(DistTarGZip)"
2045 dist-bzip2:: $(DistTarBZ2)
2047 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2048 $(Echo) Packing bzipped distribution tar file.
2049 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2050 $(BZIP2) -c >$(DistTarBZ2)
2052 dist-zip:: $(DistZip)
2054 $(DistZip) : $(TopDistDir)/.makedistdir
2055 $(Echo) Packing zipped distribution file.
2056 $(Verb) rm -f $(DistZip)
2057 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2059 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2060 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2062 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2064 dist-check:: $(DistTarGZip)
2065 $(Echo) Checking distribution tar file.
2066 $(Verb) if test -d $(DistCheckDir) ; then \
2067 $(RM) -rf $(DistCheckDir) ; \
2069 $(Verb) $(MKDIR) $(DistCheckDir)
2070 $(Verb) cd $(DistCheckDir) && \
2071 $(MKDIR) $(DistCheckDir)/build && \
2072 $(MKDIR) $(DistCheckDir)/install && \
2073 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2075 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2076 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2079 $(MAKE) unittests && \
2080 $(MAKE) install && \
2081 $(MAKE) uninstall && \
2082 $(MAKE) dist-clean && \
2083 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2086 $(Echo) Cleaning distribution files
2087 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2092 #------------------------------------------------------------------------
2093 # Provide the recursive distdir target for building the distribution directory
2094 #------------------------------------------------------------------------
2095 distdir: $(DistDir)/.makedistdir
2096 $(DistDir)/.makedistdir: $(DistSources)
2097 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2098 if test -d "$(DistDir)" ; then \
2099 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2102 $(EchoCmd) Removing old $(DistDir) ; \
2103 $(RM) -rf $(DistDir); \
2104 $(EchoCmd) Making 'all' to verify build ; \
2105 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2107 $(Echo) Building Distribution Directory $(DistDir)
2108 $(Verb) $(MKDIR) $(DistDir)
2109 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2110 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2111 for file in $(DistFiles) ; do \
2113 $(PROJ_SRC_DIR)/*) \
2114 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2116 $(PROJ_SRC_ROOT)/*) \
2117 file=`echo "$$file" | \
2118 sed "s#^$$srcrootstrip/##"` \
2121 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2122 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2123 from_dir="$(PROJ_SRC_DIR)" ; \
2124 elif test -f "$$file" || test -d "$$file" ; then \
2127 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2128 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2129 to_dir="$(DistDir)/$$dir"; \
2130 $(MKDIR) "$$to_dir" ; \
2132 to_dir="$(DistDir)"; \
2134 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2135 if test -n "$$mid_dir" ; then \
2136 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2138 if test -d "$$from_dir/$$file"; then \
2139 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2140 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2141 cd $(PROJ_SRC_DIR) ; \
2142 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2143 ( cd $$to_dir ; $(TAR) xf - ) ; \
2144 cd $(PROJ_OBJ_DIR) ; \
2147 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2148 ( cd $$to_dir ; $(TAR) xf - ) ; \
2149 cd $(PROJ_OBJ_DIR) ; \
2151 elif test -f "$$from_dir/$$file" ; then \
2152 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2153 elif test -L "$$from_dir/$$file" ; then \
2154 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2155 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2156 $(EchoCmd) "===== WARNING: Distribution Source " \
2157 "$$from_dir/$$file Not Found!" ; \
2158 elif test "$(Verb)" != '@' ; then \
2159 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2162 $(Verb) for subdir in $(DistSubDirs) ; do \
2163 if test "$$subdir" \!= "." ; then \
2164 new_distdir="$(DistDir)/$$subdir" ; \
2165 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2166 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2167 DistDir="$$new_distdir" distdir ) || exit 1; \
2170 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2171 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2172 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2173 -name .svn \) -print` ;\
2174 $(MAKE) dist-hook ; \
2175 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2176 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2177 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2178 -o ! -type d ! -perm -444 -exec \
2179 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2180 || chmod -R a+r $(DistDir) ; \
2183 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2189 ###############################################################################
2190 # TOP LEVEL - targets only to apply at the top level directory
2191 ###############################################################################
2195 #------------------------------------------------------------------------
2196 # Install support for the project's include files:
2197 #------------------------------------------------------------------------
2200 $(Echo) Install circumvented with NO_INSTALL
2202 $(Echo) Uninstall circumvented with NO_INSTALL
2205 $(Echo) Installing include files
2206 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2207 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2208 cd $(PROJ_SRC_ROOT)/include && \
2209 for hdr in `find . -type f \
2210 '(' -name LICENSE.TXT \
2215 ')' -print | grep -v CVS | \
2216 grep -v .svn` ; do \
2217 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2218 if test \! -d "$$instdir" ; then \
2219 $(EchoCmd) Making install directory $$instdir ; \
2220 $(MKDIR) $$instdir ;\
2222 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2225 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2226 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2227 cd $(PROJ_OBJ_ROOT)/include && \
2228 for hdr in `find . -type f \
2229 '(' -name LICENSE.TXT \
2234 ')' -print | grep -v CVS | \
2235 grep -v .svn` ; do \
2236 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2237 if test \! -d "$$instdir" ; then \
2238 $(EchoCmd) Making install directory $$instdir ; \
2239 $(MKDIR) $$instdir ;\
2241 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2247 $(Echo) Uninstalling include files
2248 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2249 cd $(PROJ_SRC_ROOT)/include && \
2250 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2251 '!' '(' -name '*~' -o -name '.#*' \
2252 -o -name '*.in' ')' -print ')' | \
2253 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2254 cd $(PROJ_SRC_ROOT)/include && \
2255 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2256 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2262 @echo searching for overlength lines in files: $(Sources)
2265 egrep -n '.{81}' $(Sources) /dev/null
2268 @echo searching for tabs in files: $(Sources)
2271 egrep -n ' ' $(Sources) /dev/null
2274 @ls -l $(LibDir) | awk '\
2275 BEGIN { sum = 0; } \
2277 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2278 @ls -l $(ToolDir) | awk '\
2279 BEGIN { sum = 0; } \
2281 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2282 #------------------------------------------------------------------------
2283 # Print out the directories used for building
2284 #------------------------------------------------------------------------
2286 $(Echo) "BuildMode : " '$(BuildMode)'
2287 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2288 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2289 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2290 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2291 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2292 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2293 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2294 $(Echo) "PROJ_internal_prefix : " '$(PROJ_internal_prefix)'
2295 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2296 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2297 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2298 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2299 $(Echo) "UserTargets : " '$(UserTargets)'
2300 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2301 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2302 $(Echo) "ObjDir : " '$(ObjDir)'
2303 $(Echo) "LibDir : " '$(LibDir)'
2304 $(Echo) "ToolDir : " '$(ToolDir)'
2305 $(Echo) "ExmplDir : " '$(ExmplDir)'
2306 $(Echo) "Sources : " '$(Sources)'
2307 $(Echo) "TDFiles : " '$(TDFiles)'
2308 $(Echo) "INCFiles : " '$(INCFiles)'
2309 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2310 $(Echo) "PreConditions: " '$(PreConditions)'
2311 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2312 $(Echo) "Compile.C : " '$(Compile.C)'
2313 $(Echo) "Archive : " '$(Archive)'
2314 $(Echo) "YaccFiles : " '$(YaccFiles)'
2315 $(Echo) "LexFiles : " '$(LexFiles)'
2316 $(Echo) "Module : " '$(Module)'
2317 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2318 $(Echo) "SubDirs : " '$(SubDirs)'
2319 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2320 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2325 # General debugging rule, use 'make dbg-print-XXX' to print the
2326 # definition, value and origin of XXX.
2328 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))