1 #===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 # This file is included by all of the LLVM makefiles. For details on how to use
11 # it properly, please see the document MakefileGuide.html in the docs directory.
13 #===-----------------------------------------------------------------------====#
15 ################################################################################
16 # TARGETS: Define standard targets that can be invoked
17 ################################################################################
19 #--------------------------------------------------------------------
20 # Define the various target sets
21 #--------------------------------------------------------------------
22 RecursiveTargets := all clean clean-all install uninstall install-bytecode \
24 LocalTargets := all-local clean-local clean-all-local check-local \
25 install-local printvars uninstall-local \
26 install-bytecode-local
27 TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
29 UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
30 InternalTargets := preconditions distdir dist-hook
32 ################################################################################
33 # INITIALIZATION: Basic things the makefile needs
34 ################################################################################
36 #--------------------------------------------------------------------
37 # Set the VPATH so that we can find source files.
38 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Reset the list of suffixes we know how to build.
43 #--------------------------------------------------------------------
45 .SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm
46 .SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
48 #--------------------------------------------------------------------
49 # Mark all of these targets as phony to avoid implicit rule search
50 #--------------------------------------------------------------------
51 .PHONY: $(UserTargets) $(InternalTargets)
53 #--------------------------------------------------------------------
54 # Make sure all the user-target rules are double colon rules and
55 # they are defined first.
56 #--------------------------------------------------------------------
60 #------------------------------------------------------------------------
61 # LLVMBuild Integration
62 #------------------------------------------------------------------------
64 # We use llvm-build to generate all the data required by the Makefile based
65 # build system in one swoop:
67 # - We generate a file (a Makefile fragment) in the object root which contains
68 # all the definitions that are required by Makefiles across the entire
71 # - We generate the library table used by llvm-config.
73 # - We generate the dependencies for the Makefile fragment, so that we will
74 # automatically reconfigure outselves.
76 # The path to the llvm-build tool itself.
77 LLVMBuildTool := $(PROJ_SRC_ROOT)/utils/llvm-build/llvm-build
79 # The files we are going to generate using llvm-build.
80 LLVMBuildMakeFrag := $(PROJ_OBJ_ROOT)/Makefile.llvmbuild
81 LLVMConfigLibraryDependenciesInc := \
82 $(PROJ_OBJ_ROOT)/tools/llvm-config-2/LibraryDependencies.inc
84 # The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
87 # Note that this target gets its real dependencies generated for us by
90 # We include a dependency on this Makefile to ensure that changes to the
91 # generation command get picked up.
92 $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
93 $(Echo) Constructing LLVMBuild project information.
94 $(Verb) $(LLVMBuildTool) \
95 --native-target "$(ARCH)" \
96 --enable-targets "$(TARGETS_TO_BUILD)" \
97 --write-library-table $(LLVMConfigLibraryDependenciesInc) \
98 --write-make-fragment $(LLVMBuildMakeFrag)
100 # For completeness, let Make know how the extra files are generated.
101 $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
103 # Include the generated Makefile fragment.
105 # We currently only include the dependencies for the fragment itself if we are
106 # at the top-level. Otherwise, recursive invocations would ends up doing
107 # substantially more redundant stat'ing.
109 # This means that we won't properly regenerate things for developers used to
110 # building from a subdirectory, but that is always somewhat unreliable.
112 LLVMBUILD_INCLUDE_DEPENDENCIES := 1
114 -include $(LLVMBuildMakeFrag)
116 ################################################################################
117 # PRECONDITIONS: that which must be built/checked first
118 ################################################################################
120 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
121 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
122 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
123 ConfigureScript := $(PROJ_SRC_ROOT)/configure
124 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
125 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
126 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
127 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
128 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
129 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
130 ifneq ($(MakefileCommonIn),)
131 PreConditions += $(MakefileCommon)
134 ifneq ($(MakefileConfigIn),)
135 PreConditions += $(MakefileConfig)
138 preconditions: $(PreConditions)
140 #------------------------------------------------------------------------
141 # Make sure the BUILT_SOURCES are built first
142 #------------------------------------------------------------------------
143 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
146 ifneq ($(strip $(BUILT_SOURCES)),)
147 -$(Verb) $(RM) -f $(BUILT_SOURCES)
150 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
152 $(Verb) if test -x config.status ; then \
153 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
154 $(MKDIR) .spotless.save ; \
155 $(MV) config.status .spotless.save ; \
156 $(MV) mklib .spotless.save ; \
157 $(MV) projects .spotless.save ; \
159 $(MV) .spotless.save/config.status . ; \
160 $(MV) .spotless.save/mklib . ; \
161 $(MV) .spotless.save/projects . ; \
162 $(RM) -rf .spotless.save ; \
163 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
164 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
165 $(ConfigStatusScript) ; \
167 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
171 $(EchoCmd) "spotless target not supported for objdir == srcdir"
174 $(BUILT_SOURCES) : $(ObjMakefiles)
176 #------------------------------------------------------------------------
177 # Make sure we're not using a stale configuration
178 #------------------------------------------------------------------------
180 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
181 $(Verb) cd $(PROJ_OBJ_ROOT) && \
182 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
183 $(ConfigStatusScript)
185 .PRECIOUS: $(ConfigStatusScript)
186 $(ConfigStatusScript): $(ConfigureScript)
187 $(Echo) Reconfiguring with $<
188 $(Verb) cd $(PROJ_OBJ_ROOT) && \
189 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
190 $(ConfigStatusScript)
192 #------------------------------------------------------------------------
193 # Make sure the configuration makefile is up to date
194 #------------------------------------------------------------------------
195 ifneq ($(MakefileConfigIn),)
196 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
197 $(Echo) Regenerating $@
198 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
201 ifneq ($(MakefileCommonIn),)
202 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
203 $(Echo) Regenerating $@
204 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
207 #------------------------------------------------------------------------
208 # If the Makefile in the source tree has been updated, copy it over into the
209 # build tree. But, only do this if the source and object makefiles differ
210 #------------------------------------------------------------------------
212 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
215 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
217 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
218 $(Echo) "Updating Makefile"
219 $(Verb) $(MKDIR) $(@D)
220 $(Verb) $(CP) -f $< $@
222 # Copy the Makefile.* files unless we're in the root directory which avoids
223 # the copying of Makefile.config.in or other things that should be explicitly
225 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
227 *Makefile.rules) ;; \
229 *) $(EchoCmd) "Updating $(@F)" ; \
236 #------------------------------------------------------------------------
237 # Set up the basic dependencies
238 #------------------------------------------------------------------------
239 $(UserTargets):: $(PreConditions)
243 clean-all:: clean-local clean-all-local
244 install:: install-local
245 uninstall:: uninstall-local
246 install-local:: all-local
247 install-bytecode:: install-bytecode-local
249 ###############################################################################
250 # VARIABLES: Set up various variables based on configuration data
251 ###############################################################################
253 # Variable for if this make is for a "cleaning" target
254 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
258 #--------------------------------------------------------------------
259 # Variables derived from configuration we are building
260 #--------------------------------------------------------------------
263 ifeq ($(ENABLE_OPTIMIZED),1)
265 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
266 ifneq ($(HOST_OS),FreeBSD)
267 ifneq ($(HOST_OS),Darwin)
268 OmitFramePointer := -fomit-frame-pointer
272 # Darwin requires -fstrict-aliasing to be explicitly enabled.
273 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
274 # with -fstrict-aliasing and ipa-type-escape radr://6756684
275 #ifeq ($(HOST_OS),Darwin)
276 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
278 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
279 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
280 LD.Flags += $(OPTIMIZE_OPTION)
282 BuildMode := $(BuildMode)+Debug
289 ifdef NO_DEBUG_SYMBOLS
290 BuildMode := Unoptimized
304 ifeq ($(ENABLE_LIBCPP),1)
305 CXX.Flags += -stdlib=libc++
306 LD.Flags += -stdlib=libc++
309 ifeq ($(ENABLE_PROFILING),1)
310 BuildMode := $(BuildMode)+Profile
311 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
312 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
313 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
317 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
318 # CXX.Flags += -fvisibility-inlines-hidden
321 ifdef ENABLE_EXPENSIVE_CHECKS
322 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
323 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
327 # IF REQUIRES_EH=1 is specified then don't disable exceptions
329 CXX.Flags += -fno-exceptions
331 # If the library requires EH, it also requires RTTI.
335 ifdef REQUIRES_FRAME_POINTER
336 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
337 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
338 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
341 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
342 ifneq ($(REQUIRES_RTTI), 1)
343 CXX.Flags += -fno-rtti
346 ifeq ($(ENABLE_COVERAGE),1)
347 BuildMode := $(BuildMode)+Coverage
348 CXX.Flags += -ftest-coverage -fprofile-arcs
349 C.Flags += -ftest-coverage -fprofile-arcs
352 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
353 # then disable assertions by defining the appropriate preprocessor symbols.
354 ifeq ($(DISABLE_ASSERTIONS),1)
355 CPP.Defines += -DNDEBUG
357 BuildMode := $(BuildMode)+Asserts
358 CPP.Defines += -D_DEBUG
361 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
362 # configured), then enable expensive checks by defining the
363 # appropriate preprocessor symbols.
364 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
365 BuildMode := $(BuildMode)+Checks
366 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
369 # LOADABLE_MODULE implies several other things so we force them to be
371 ifdef LOADABLE_MODULE
373 LINK_LIBS_IN_SHARED := 1
381 ifeq ($(ENABLE_PIC),1)
382 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
383 # Nothing. Win32 defaults to PIC and warns when given -fPIC
385 ifeq ($(HOST_OS),Darwin)
386 # Common symbols not allowed in dylib files
387 CXX.Flags += -fno-common
388 C.Flags += -fno-common
390 # Linux and others; pass -fPIC
396 ifeq ($(HOST_OS),Darwin)
397 CXX.Flags += -mdynamic-no-pic
398 C.Flags += -mdynamic-no-pic
402 # Support makefile variable to disable any kind of timestamp/non-deterministic
403 # info from being used in the build.
404 ifeq ($(ENABLE_TIMESTAMPS),1)
405 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
407 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
410 ifeq ($(HOST_OS),MingW)
412 CPP.Defines += -D__NO_CTYPE_INLINE
413 ifeq ($(LLVM_CROSS_COMPILING),1)
414 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
416 LD.Flags += -Wl,--allow-multiple-definition
421 CXX.Flags += -Woverloaded-virtual
422 CPP.BaseFlags += $(CPP.Defines)
425 # Make Floating point IEEE compliant on Alpha.
428 CPP.BaseFlags += -mieee
429 ifeq ($(ENABLE_PIC),0)
431 CPP.BaseFlags += -fPIC
434 LD.Flags += -Wl,--no-relax
437 # GNU ld/PECOFF accepts but ignores them below;
441 # FIXME: autoconf should be aware of them.
442 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
443 HAVE_LINK_VERSION_SCRIPT := 0
445 RDYNAMIC := -Wl,--export-all-symbols
448 #--------------------------------------------------------------------
449 # Directory locations
450 #--------------------------------------------------------------------
452 ifeq ($(LLVM_CROSS_COMPILING),1)
453 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
456 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
457 ObjDir := $(ObjRootDir)
458 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
459 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
460 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
461 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
462 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
463 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
465 #--------------------------------------------------------------------
466 # Locations of shared libraries
467 #--------------------------------------------------------------------
470 SharedLibDir := $(LibDir)
471 LLVMSharedLibDir := $(LLVMLibDir)
473 # Win32.DLL prefers to be located on the "PATH" of binaries.
474 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
475 SharedLibDir := $(ToolDir)
476 LLVMSharedLibDir := $(LLVMToolDir)
478 ifeq ($(HOST_OS),Cygwin)
485 #--------------------------------------------------------------------
486 # LLVM Capable Compiler
487 #--------------------------------------------------------------------
489 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
491 LLVMCXX := $(LLVMGXX)
493 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
494 ifneq ($(CLANGPATH),)
495 LLVMCC := $(CLANGPATH)
496 LLVMCXX := $(CLANGXXPATH)
498 ifeq ($(ENABLE_BUILT_CLANG),1)
499 LLVMCC := $(LLVMToolDir)/clang
500 LLVMCXX := $(LLVMToolDir)/clang++
506 #--------------------------------------------------------------------
507 # Full Paths To Compiled Tools and Utilities
508 #--------------------------------------------------------------------
509 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
512 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
515 ifeq ($(LLVM_CROSS_COMPILING),1)
516 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
518 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
521 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
523 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
526 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
529 LLI := $(LLVMToolDir)/lli$(EXEEXT)
532 LLC := $(LLVMToolDir)/llc$(EXEEXT)
535 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
538 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
541 #--------------------------------------------------------------------
542 # Adjust to user's request
543 #--------------------------------------------------------------------
545 ifeq ($(HOST_OS),Darwin)
546 DARWIN_VERSION := `sw_vers -productVersion`
547 # Strip a number like 10.4.7 to 10.4
548 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
549 # Get "4" out of 10.4 for later pieces in the makefile.
550 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
552 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
553 SharedLinkOptions := -dynamiclib
555 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
558 SharedLinkOptions=-shared
561 ifeq ($(TARGET_OS),Darwin)
563 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
568 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
569 ifneq ($(HOST_OS),Darwin)
570 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
582 # Adjust settings for verbose mode
585 AR.Flags += >/dev/null 2>/dev/null
586 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
588 ConfigureScriptFLAGS :=
591 # By default, strip symbol information from executable
593 Strip := $(PLATFORMSTRIPOPTS)
594 StripWarnMsg := "(without symbols)"
595 Install.StripFlag += -s
598 ifdef TOOL_NO_EXPORTS
601 DynamicFlag := $(RDYNAMIC)
604 # Adjust linker flags for building an executable
605 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
606 ifneq ($(HOST_OS), Darwin)
608 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
610 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
612 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
616 ifneq ($(DARWIN_MAJVERS),4)
617 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
623 #----------------------------------------------------------
624 # Options To Invoke Tools
625 #----------------------------------------------------------
627 ifdef EXTRA_LD_OPTIONS
628 LD.Flags += $(EXTRA_LD_OPTIONS)
632 CompileCommonOpts += -pedantic -Wno-long-long
634 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
636 # Enable cast-qual for C++; the workaround is to use const_cast.
637 CXX.Flags += -Wcast-qual
639 ifeq ($(HOST_OS),HP-UX)
640 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
643 # If we are building a universal binary on Mac OS/X, pass extra options. This
644 # is useful to people that want to link the LLVM libraries into their universal
647 # The following can be optionally specified:
648 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
649 # For Mac OS/X 10.4 Intel machines, the traditional one is:
650 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
651 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
652 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
655 ifndef UNIVERSAL_ARCH
656 UNIVERSAL_ARCH := i386 ppc
658 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
659 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
660 ifdef UNIVERSAL_SDK_PATH
661 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
664 # Building universal cannot compute dependencies automatically.
665 DISABLE_AUTO_DEPENDENCIES=1
667 ifeq ($(TARGET_OS),Darwin)
668 ifeq ($(ARCH),x86_64)
669 TargetCommonOpts = -m64
672 TargetCommonOpts = -m32
678 ifeq ($(HOST_OS),SunOS)
679 CPP.BaseFlags += -include llvm/Support/Solaris.h
682 ifeq ($(HOST_OS),AuroraUX)
683 CPP.BaseFlags += -include llvm/Support/Solaris.h
684 endif # !HOST_OS - AuroraUX.
686 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
687 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
688 # All -I flags should go here, so that they don't confuse llvm-config.
689 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
690 $(patsubst %,-I%/include,\
691 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
692 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
695 ifeq ($(INCLUDE_BUILD_DIR),1)
696 CPP.Flags += -I$(ObjDir)
699 # SHOW_DIAGNOSTICS support.
700 ifeq ($(SHOW_DIAGNOSTICS),1)
701 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
702 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
707 ifeq ($(BUILD_COMPONENT), 1)
708 Compile.C = $(Compile.Wrapper) \
709 $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
710 $(TargetCommonOpts) $(CompileCommonOpts) -c
711 Compile.CXX = $(Compile.Wrapper) \
712 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
714 $(TargetCommonOpts) $(CompileCommonOpts) -c
715 Preprocess.CXX= $(Compile.Wrapper) \
716 $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
717 $(CompileCommonOpts) $(CXX.Flags) -E
718 Link = $(Compile.Wrapper) \
719 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
720 $(LD.Flags) $(LDFLAGS) \
721 $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
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)
737 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
738 $(TargetCommonOpts) $(CompileCommonOpts)
739 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
740 $(TargetCommonOpts) $(CompileCommonOpts) -E
742 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
743 $(TargetCommonOpts) $(CompileCommonOpts)
745 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
746 ScriptInstall = $(INSTALL) -m 0755
747 DataInstall = $(INSTALL) -m 0644
749 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
750 # paths. In this case, the SYSPATH function (defined in
751 # Makefile.config) transforms Unix paths into Windows paths.
752 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
753 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
754 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
755 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
756 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
758 Archive = $(AR) $(AR.Flags)
759 LArchive = $(LLVMToolDir)/llvm-ar rcsf
768 #----------------------------------------------------------
769 # Get the list of source files and compute object file
771 #----------------------------------------------------------
774 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
775 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
777 Sources := $(SOURCES)
781 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
784 BaseNameSources := $(sort $(basename $(Sources)))
786 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
787 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
789 #----------------------------------------------------------
790 # For Mingw MSYS bash and Python/w32:
792 # $(ECHOPATH) prints DOSish pathstring.
793 # ex) $(ECHOPATH) /include/sys/types.h
794 # --> C:/mingw/include/sys/types.h
795 # built-in "echo" does not transform path to DOSish path.
797 # FIXME: It would not be needed when MSYS's python
799 #----------------------------------------------------------
801 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
802 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
804 ECHOPATH := $(Verb)$(ECHO)
807 ###############################################################################
808 # DIRECTORIES: Handle recursive descent of directory structure
809 ###############################################################################
811 #---------------------------------------------------------
812 # Provide rules to make install dirs. This must be early
813 # in the file so they get built before dependencies
814 #---------------------------------------------------------
816 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
819 # To create other directories, as needed, and timestamp their creation
821 $(Verb) $(MKDIR) $* > /dev/null
822 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
824 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
825 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
827 #---------------------------------------------------------
828 # Handle the DIRS options for sequential construction
829 #---------------------------------------------------------
835 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
836 $(RecursiveTargets)::
837 $(Verb) for dir in $(DIRS); do \
838 if ([ ! -f $$dir/Makefile ] || \
839 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
841 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
843 ($(MAKE) -C $$dir $@ ) || exit 1; \
846 $(RecursiveTargets)::
847 $(Verb) for dir in $(DIRS); do \
848 ($(MAKE) -C $$dir $@ ) || exit 1; \
854 #---------------------------------------------------------
855 # Handle the EXPERIMENTAL_DIRS options ensuring success
856 # after each directory is built.
857 #---------------------------------------------------------
858 ifdef EXPERIMENTAL_DIRS
859 $(RecursiveTargets)::
860 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
861 if ([ ! -f $$dir/Makefile ] || \
862 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
864 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
866 ($(MAKE) -C $$dir $@ ) || exit 0; \
870 #-----------------------------------------------------------
871 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
872 #-----------------------------------------------------------
873 ifdef OPTIONAL_PARALLEL_DIRS
874 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
877 #-----------------------------------------------------------
878 # Handle the PARALLEL_DIRS options for parallel construction
879 #-----------------------------------------------------------
882 SubDirs += $(PARALLEL_DIRS)
884 # Unfortunately, this list must be maintained if new recursive targets are added
885 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
886 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
887 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
888 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
889 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
890 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
891 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
893 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
897 SD=$(PROJ_SRC_DIR)/$(@D); \
899 if [ ! -f $$SD/Makefile ]; then \
901 DD=$(notdir $(@D)); \
903 if ([ ! -f $$DD/Makefile ] || \
904 command test $$DD/Makefile -ot \
905 $$SD/Makefile ); then \
907 $(CP) $$SD/Makefile $$DD/Makefile; \
909 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
912 #---------------------------------------------------------
913 # Handle the OPTIONAL_DIRS options for directores that may
915 #---------------------------------------------------------
918 SubDirs += $(OPTIONAL_DIRS)
920 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
921 $(RecursiveTargets)::
922 $(Verb) for dir in $(OPTIONAL_DIRS); do \
923 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
924 if ([ ! -f $$dir/Makefile ] || \
925 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
927 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
929 ($(MAKE) -C$$dir $@ ) || exit 1; \
933 $(RecursiveTargets)::
934 $(Verb) for dir in $(OPTIONAL_DIRS); do \
935 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
936 ($(MAKE) -C$$dir $@ ) || exit 1; \
942 #---------------------------------------------------------
943 # Handle the CONFIG_FILES options
944 #---------------------------------------------------------
949 $(Echo) Install circumvented with NO_INSTALL
951 $(Echo) UnInstall circumvented with NO_INSTALL
953 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
954 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
955 $(Verb)for file in $(CONFIG_FILES); do \
956 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
957 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
958 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
959 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
961 $(ECHO) Error: cannot find config file $${file}. ; \
966 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
967 $(Verb)for file in $(CONFIG_FILES); do \
968 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
974 ###############################################################################
975 # Set up variables for building libraries
976 ###############################################################################
978 #---------------------------------------------------------
979 # Define various command line options pertaining to the
980 # libraries needed when linking. There are "Proj" libs
981 # (defined by the user's project) and "LLVM" libs (defined
982 # by the LLVM project).
983 #---------------------------------------------------------
986 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
987 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
988 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
989 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
993 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
994 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
995 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
996 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
999 # Loadable module for Win32 requires all symbols resolved for linking.
1000 # Then all symbols in LLVM.dll will be available.
1001 ifeq ($(ENABLE_SHARED),1)
1002 ifdef LOADABLE_MODULE
1003 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
1004 LINK_COMPONENTS += all
1009 ifndef IS_CLEANING_TARGET
1010 ifdef LINK_COMPONENTS
1012 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1013 # clean in tools, then do a make in tools (instead of at the top level).
1015 @echo "*** llvm-config doesn't exist - rebuilding it."
1016 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1018 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1020 ifeq ($(ENABLE_SHARED), 1)
1021 # We can take the "auto-import" feature to get rid of using dllimport.
1022 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1023 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1026 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1027 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1030 ifndef NO_LLVM_CONFIG
1031 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1032 ifeq ($(LLVMConfigLibs),Error)
1033 $(error llvm-config --libs failed)
1035 LLVMLibsOptions += $(LLVMConfigLibs)
1036 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1037 ifeq ($(LLVMConfigLibfiles),Error)
1038 $(error llvm-config --libfiles failed)
1040 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1047 # Set up the library exports file.
1048 ifdef EXPORTED_SYMBOL_FILE
1050 # First, set up the native export file, which may differ from the source
1053 ifeq ($(HOST_OS),Darwin)
1054 # Darwin convention prefixes symbols with underscores.
1055 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1056 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1057 $(Verb) sed -e 's/^/_/' < $< > $@
1059 -$(Verb) $(RM) -f $(NativeExportsFile)
1061 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1062 # Gold and BFD ld require a version script rather than a plain list.
1063 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1064 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1065 $(Verb) echo "{" > $@
1066 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1067 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1068 ifneq ($(HOST_OS),OpenBSD)
1069 $(Verb) echo " local: *;" >> $@
1071 $(Verb) echo "};" >> $@
1073 -$(Verb) $(RM) -f $(NativeExportsFile)
1075 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1076 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1077 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1078 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1079 $(Echo) Generating $(notdir $@)
1080 $(Verb) $(ECHO) "EXPORTS" > $@
1081 $(Verb) $(CAT) $< >> $@
1083 -$(Verb) $(RM) -f $(NativeExportsFile)
1085 # Default behavior: just use the exports file verbatim.
1086 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1091 # Now add the linker command-line options to use the native export file.
1094 ifeq ($(HOST_OS),Darwin)
1095 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1098 # gold, bfd ld, etc.
1099 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1100 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1104 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1105 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1106 SharedLinkOptions += $(NativeExportsFile)
1111 ###############################################################################
1112 # Library Build Rules: Four ways to build a library
1113 ###############################################################################
1115 #---------------------------------------------------------
1116 # Bytecode Module Targets:
1117 # If the user set MODULE_NAME then they want to build a
1118 # bytecode module from the sources. We compile all the
1119 # sources and link it together into a single bytecode
1121 #---------------------------------------------------------
1124 ifeq ($(strip $(LLVMCC)),)
1125 $(warning Modules require LLVM capable compiler but none is available ****)
1128 Module := $(LibDir)/$(MODULE_NAME).bc
1129 LinkModule := $(LLVMLD) -r
1132 ifdef EXPORTED_SYMBOL_FILE
1133 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1136 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1137 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1138 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1140 all-local:: $(Module)
1143 ifneq ($(strip $(Module)),)
1144 -$(Verb) $(RM) -f $(Module)
1147 ifdef BYTECODE_DESTINATION
1148 ModuleDestDir := $(BYTECODE_DESTINATION)
1150 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1155 $(Echo) Install circumvented with NO_INSTALL
1157 $(Echo) Uninstall circumvented with NO_INSTALL
1159 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1161 install-module:: $(DestModule)
1162 install-local:: $(DestModule)
1164 $(DestModule): $(ModuleDestDir) $(Module)
1165 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1166 $(Verb) $(DataInstall) $(Module) $(DestModule)
1169 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1170 -$(Verb) $(RM) -f $(DestModule)
1176 # if we're building a library ...
1179 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1180 LIBRARYNAME := $(strip $(LIBRARYNAME))
1181 ifdef LOADABLE_MODULE
1182 BaseLibName.A := $(LIBRARYNAME).a
1183 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1185 BaseLibName.A := lib$(LIBRARYNAME).a
1186 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1188 LibName.A := $(LibDir)/$(BaseLibName.A)
1189 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1190 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1191 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1193 #---------------------------------------------------------
1194 # Shared Library Targets:
1195 # If the user asked for a shared library to be built
1196 # with the SHARED_LIBRARY variable, then we provide
1197 # targets for building them.
1198 #---------------------------------------------------------
1199 ifdef SHARED_LIBRARY
1201 all-local:: $(LibName.SO)
1203 ifdef EXPORTED_SYMBOL_FILE
1204 $(LibName.SO): $(NativeExportsFile)
1207 ifdef LINK_LIBS_IN_SHARED
1208 ifdef LOADABLE_MODULE
1209 SharedLibKindMessage := "Loadable Module"
1210 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1212 SharedLibKindMessage := "Shared Library"
1214 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1215 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1217 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1218 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1220 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1221 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1222 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1226 ifneq ($(strip $(LibName.SO)),)
1227 -$(Verb) $(RM) -f $(LibName.SO)
1232 $(Echo) Install circumvented with NO_INSTALL
1234 $(Echo) Uninstall circumvented with NO_INSTALL
1237 # Win32.DLL prefers to be located on the "PATH" of binaries.
1238 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1239 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1241 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1243 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1245 install-local:: $(DestSharedLib)
1247 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1248 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1249 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1252 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1253 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1257 #---------------------------------------------------------
1258 # Bytecode Library Targets:
1259 # If the user asked for a bytecode library to be built
1260 # with the BYTECODE_LIBRARY variable, then we provide
1261 # targets for building them.
1262 #---------------------------------------------------------
1263 ifdef BYTECODE_LIBRARY
1264 ifeq ($(strip $(LLVMCC)),)
1265 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1268 all-local:: $(LibName.BCA)
1270 ifdef EXPORTED_SYMBOL_FILE
1271 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1273 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1274 $(LLVMToolDir)/llvm-ar
1275 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1277 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1279 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1281 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1282 $(LLVMToolDir)/llvm-ar
1283 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1285 $(Verb) $(LArchive) $@ $(ObjectsBC)
1290 ifneq ($(strip $(LibName.BCA)),)
1291 -$(Verb) $(RM) -f $(LibName.BCA)
1294 ifdef BYTECODE_DESTINATION
1295 BytecodeDestDir := $(BYTECODE_DESTINATION)
1297 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1300 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1302 install-bytecode-local:: $(DestBytecodeLib)
1306 $(Echo) Install circumvented with NO_INSTALL
1308 $(Echo) Uninstall circumvented with NO_INSTALL
1310 install-local:: $(DestBytecodeLib)
1312 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1313 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1314 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1317 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1318 -$(Verb) $(RM) -f $(DestBytecodeLib)
1323 #---------------------------------------------------------
1325 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1326 # building an archive.
1327 #---------------------------------------------------------
1328 ifndef NO_BUILD_ARCHIVE
1329 ifndef BUILD_ARCHIVE
1330 ifndef LOADABLE_MODULE
1336 #---------------------------------------------------------
1337 # Archive Library Targets:
1338 # If the user wanted a regular archive library built,
1339 # then we provide targets for building them.
1340 #---------------------------------------------------------
1343 all-local:: $(LibName.A)
1345 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1346 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1347 -$(Verb) $(RM) -f $@
1348 $(Verb) $(Archive) $@ $(ObjectsO)
1349 $(Verb) $(Ranlib) $@
1352 ifneq ($(strip $(LibName.A)),)
1353 -$(Verb) $(RM) -f $(LibName.A)
1358 $(Echo) Install circumvented with NO_INSTALL
1360 $(Echo) Uninstall circumvented with NO_INSTALL
1362 ifdef NO_INSTALL_ARCHIVES
1364 $(Echo) Install circumvented with NO_INSTALL
1366 $(Echo) Uninstall circumvented with NO_INSTALL
1368 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1370 install-local:: $(DestArchiveLib)
1372 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1373 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1374 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1375 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1378 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1379 -$(Verb) $(RM) -f $(DestArchiveLib)
1387 ###############################################################################
1388 # Tool Build Rules: Build executable tool based on TOOLNAME option
1389 ###############################################################################
1393 #---------------------------------------------------------
1394 # Set up variables for building a tool.
1395 #---------------------------------------------------------
1396 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1398 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1400 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1403 # TOOLALIAS is a name to symlink (or copy) the tool to.
1406 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1408 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1412 #---------------------------------------------------------
1414 #---------------------------------------------------------
1416 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1417 # not exporting all of the weak symbols from the binary. This reduces dyld
1418 # startup time by 4x on darwin in some cases.
1419 ifdef TOOL_NO_EXPORTS
1420 ifeq ($(HOST_OS),Darwin)
1422 # Tiger tools don't support this.
1423 ifneq ($(DARWIN_MAJVERS),4)
1424 LD.Flags += -Wl,-exported_symbol,_main
1428 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1429 ifneq ($(ARCH), Mips)
1430 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1435 #---------------------------------------------------------
1436 # Tool Order File Support
1437 #---------------------------------------------------------
1439 ifeq ($(HOST_OS),Darwin)
1440 ifdef TOOL_ORDER_FILE
1442 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1447 #---------------------------------------------------------
1448 # Tool Version Info Support
1449 #---------------------------------------------------------
1451 ifeq ($(HOST_OS),Darwin)
1452 ifdef TOOL_INFO_PLIST
1454 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1456 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1458 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1459 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1460 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1461 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1462 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1463 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1469 #---------------------------------------------------------
1470 # Provide targets for building the tools
1471 #---------------------------------------------------------
1472 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1475 ifneq ($(strip $(ToolBuildPath)),)
1476 -$(Verb) $(RM) -f $(ToolBuildPath)
1478 ifneq ($(strip $(ToolAliasBuildPath)),)
1479 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1483 $(ToolBuildPath): $(ExmplDir)/.dir
1485 $(ToolBuildPath): $(ToolDir)/.dir
1488 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1489 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1490 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1491 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1492 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1495 ifneq ($(strip $(ToolAliasBuildPath)),)
1496 $(ToolAliasBuildPath): $(ToolBuildPath)
1497 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1498 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1499 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1500 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1506 $(Echo) Install circumvented with NO_INSTALL
1508 $(Echo) Uninstall circumvented with NO_INSTALL
1510 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1512 install-local:: $(DestTool)
1514 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1515 $(Echo) Installing $(BuildMode) $(DestTool)
1516 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1519 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1520 -$(Verb) $(RM) -f $(DestTool)
1522 # TOOLALIAS install.
1524 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1526 install-local:: $(DestToolAlias)
1528 $(DestToolAlias): $(DestTool)
1529 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1530 $(Verb) $(RM) -f $(DestToolAlias)
1531 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1534 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1535 -$(Verb) $(RM) -f $(DestToolAlias)
1541 ###############################################################################
1542 # Object Build Rules: Build object files based on sources
1543 ###############################################################################
1545 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1546 ifeq ($(HOST_OS),HP-UX)
1547 DISABLE_AUTO_DEPENDENCIES=1
1550 # Provide rule sets for when dependency generation is enabled
1551 ifndef DISABLE_AUTO_DEPENDENCIES
1553 #---------------------------------------------------------
1554 # Create .o files in the ObjDir directory from the .cpp and .c files...
1555 #---------------------------------------------------------
1557 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1558 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1560 # If the build succeeded, move the dependency file over, otherwise
1562 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1563 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1565 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1566 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1567 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1570 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1571 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1572 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1575 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1576 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1577 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1580 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1581 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1582 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1585 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1586 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1587 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1590 #---------------------------------------------------------
1591 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1592 #---------------------------------------------------------
1594 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1595 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1597 # If the build succeeded, move the dependency file over, otherwise
1599 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1600 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1602 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1603 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1604 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1605 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1606 $(BC_DEPEND_MOVEFILE)
1608 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1609 $(Echo) "Compiling $*.mm 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: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1615 $(Echo) "Compiling $*.cc 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: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1621 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1622 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1623 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1624 $(BC_DEPEND_MOVEFILE)
1626 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1627 $(Echo) "Compiling $*.m 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 # Provide alternate rule sets if dependencies are disabled
1635 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1636 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1637 $(Compile.CXX) $< -o $@
1639 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1640 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1641 $(Compile.CXX) $< -o $@
1643 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1644 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1645 $(Compile.CXX) $< -o $@
1647 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1648 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1649 $(Compile.C) $< -o $@
1651 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1652 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1653 $(Compile.C) $< -o $@
1655 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1656 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1657 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1659 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1660 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1661 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1663 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1664 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1665 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1667 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1668 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1669 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1671 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1672 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1673 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1678 ## Rules for building preprocessed (.i/.ii) outputs.
1679 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1680 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1681 $(Verb) $(Preprocess.CXX) $< -o $@
1683 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1684 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1685 $(Verb) $(Preprocess.CXX) $< -o $@
1687 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1688 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1689 $(Verb) $(Preprocess.CXX) $< -o $@
1691 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1692 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1693 $(Verb) $(Preprocess.C) $< -o $@
1695 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1696 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1697 $(Verb) $(Preprocess.C) $< -o $@
1700 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1701 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1702 $(Compile.CXX) $< -o $@ -S
1704 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1705 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1706 $(Compile.CXX) $< -o $@ -S
1708 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1709 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1710 $(Compile.CXX) $< -o $@ -S
1712 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1713 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1714 $(Compile.C) $< -o $@ -S
1716 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1717 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1718 $(Compile.C) $< -o $@ -S
1721 # make the C and C++ compilers strip debug info out of bytecode libraries.
1723 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1724 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1725 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1727 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1728 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1729 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1733 #---------------------------------------------------------
1734 # Provide rule to build .bc files from .ll sources,
1735 # regardless of dependencies
1736 #---------------------------------------------------------
1737 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1738 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1739 $(Verb) $(LLVMAS) $< -f -o $@
1741 ###############################################################################
1742 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1743 ###############################################################################
1746 TABLEGEN_INC_FILES_COMMON = 1
1749 ifdef TABLEGEN_INC_FILES_COMMON
1751 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1752 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1753 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1755 # INCFiles rule: All of the tblgen generated files are emitted to
1756 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1757 # us to only "touch" the real file if the contents of it change. IOW, if
1758 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1759 # dependencies of the .inc files are, unless the contents of the .inc file
1761 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1762 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1764 endif # TABLEGEN_INC_FILES_COMMON
1768 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1769 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1770 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1771 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1772 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1773 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1774 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1776 # All .inc.tmp files depend on the .td files.
1777 $(INCTMPFiles) : $(TDFiles)
1779 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1780 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1781 $(Echo) "Building $(<F) register info implementation with tblgen"
1782 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1784 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1785 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1786 $(Echo) "Building $(<F) instruction information with tblgen"
1787 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1789 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1790 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1791 $(Echo) "Building $(<F) assembly writer with tblgen"
1792 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1794 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1795 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1796 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1797 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1799 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1800 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1801 $(Echo) "Building $(<F) assembly matcher with tblgen"
1802 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1804 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1805 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1806 $(Echo) "Building $(<F) MC code emitter with tblgen"
1807 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1809 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1810 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1811 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1812 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1814 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1815 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1816 $(Echo) "Building $(<F) code emitter with tblgen"
1817 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1819 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1820 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1821 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1822 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1824 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1825 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1826 $(Echo) "Building $(<F) disassembly tables with tblgen"
1827 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1829 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1830 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1831 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1832 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1834 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1835 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1836 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1837 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1839 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1840 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1841 $(Echo) "Building $(<F) subtarget information with tblgen"
1842 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1844 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1845 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1846 $(Echo) "Building $(<F) calling convention information with tblgen"
1847 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1849 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1850 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1851 $(Echo) "Building $(<F) intrinsics information with tblgen"
1852 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1854 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1855 $(Echo) "Building $(<F) decoder tables with tblgen"
1856 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1860 -$(Verb) $(RM) -f $(INCFiles)
1864 ###############################################################################
1865 # OTHER RULES: Other rules needed
1866 ###############################################################################
1868 # To create postscript files from dot files...
1869 ifneq ($(DOT),false)
1871 $(DOT) -Tps < $< > $@
1874 $(Echo) "Cannot build $@: The program dot is not installed"
1877 # This rules ensures that header files that are removed still have a rule for
1878 # which they can be "generated." This allows make to ignore them and
1879 # reproduce the dependency lists.
1883 # Define clean-local to clean the current directory. Note that this uses a
1884 # very conservative approach ensuring that empty variables do not cause
1885 # errors or disastrous removal.
1887 ifneq ($(strip $(ObjRootDir)),)
1888 -$(Verb) $(RM) -rf $(ObjRootDir)
1890 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1891 -$(Verb) $(RM) -f *$(SHLIBEXT)
1895 -$(Verb) $(RM) -rf Debug Release Profile
1898 ###############################################################################
1899 # DEPENDENCIES: Include the dependency files if we should
1900 ###############################################################################
1901 ifndef DISABLE_AUTO_DEPENDENCIES
1903 # If its not one of the cleaning targets
1904 ifndef IS_CLEANING_TARGET
1906 # Get the list of dependency files
1907 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1908 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1910 # Include bitcode dependency files if using bitcode libraries
1911 ifdef BYTECODE_LIBRARY
1912 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1915 -include $(DependFiles) ""
1921 ###############################################################################
1922 # CHECK: Running the test suite
1923 ###############################################################################
1926 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1927 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1928 $(EchoCmd) Running test suite ; \
1929 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1930 TESTSUITE=$(TESTSUITE) ; \
1932 $(EchoCmd) No Makefile in test directory ; \
1935 $(EchoCmd) No test directory ; \
1941 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1942 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1943 $(EchoCmd) Running test suite ; \
1944 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1946 $(EchoCmd) No Makefile in test directory ; \
1949 $(EchoCmd) No test directory ; \
1953 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1954 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1955 $(EchoCmd) Running test suite ; \
1956 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1958 $(EchoCmd) No Makefile in test directory ; \
1961 $(EchoCmd) No test directory ; \
1964 ###############################################################################
1965 # UNITTESTS: Running the unittests test suite
1966 ###############################################################################
1969 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1970 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1971 $(EchoCmd) Running unittests test suite ; \
1972 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1974 $(EchoCmd) No Makefile in unittests directory ; \
1977 $(EchoCmd) No unittests directory ; \
1980 ###############################################################################
1981 # DISTRIBUTION: Handle construction of a distribution tarball
1982 ###############################################################################
1984 #------------------------------------------------------------------------
1985 # Define distribution related variables
1986 #------------------------------------------------------------------------
1987 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1988 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1989 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1990 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1991 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1992 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1993 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1994 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1995 Makefile.config.in configure autoconf
1996 DistOther := $(notdir $(wildcard \
1997 $(PROJ_SRC_DIR)/*.h \
1998 $(PROJ_SRC_DIR)/*.td \
1999 $(PROJ_SRC_DIR)/*.def \
2000 $(PROJ_SRC_DIR)/*.ll \
2001 $(PROJ_SRC_DIR)/*.in))
2002 DistSubDirs := $(SubDirs)
2003 DistSources = $(Sources) $(EXTRA_DIST)
2004 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2006 #------------------------------------------------------------------------
2007 # We MUST build distribution with OBJ_DIR != SRC_DIR
2008 #------------------------------------------------------------------------
2009 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2010 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2011 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2015 #------------------------------------------------------------------------
2016 # Prevent attempt to run dist targets from anywhere but the top level
2017 #------------------------------------------------------------------------
2019 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2020 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2023 #------------------------------------------------------------------------
2024 # Provide the top level targets
2025 #------------------------------------------------------------------------
2027 dist-gzip:: $(DistTarGZip)
2029 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2030 $(Echo) Packing gzipped distribution tar file.
2031 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2032 $(GZIP) -c > "$(DistTarGZip)"
2034 dist-bzip2:: $(DistTarBZ2)
2036 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2037 $(Echo) Packing bzipped distribution tar file.
2038 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2039 $(BZIP2) -c >$(DistTarBZ2)
2041 dist-zip:: $(DistZip)
2043 $(DistZip) : $(TopDistDir)/.makedistdir
2044 $(Echo) Packing zipped distribution file.
2045 $(Verb) rm -f $(DistZip)
2046 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2048 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2049 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2051 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2053 dist-check:: $(DistTarGZip)
2054 $(Echo) Checking distribution tar file.
2055 $(Verb) if test -d $(DistCheckDir) ; then \
2056 $(RM) -rf $(DistCheckDir) ; \
2058 $(Verb) $(MKDIR) $(DistCheckDir)
2059 $(Verb) cd $(DistCheckDir) && \
2060 $(MKDIR) $(DistCheckDir)/build && \
2061 $(MKDIR) $(DistCheckDir)/install && \
2062 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2064 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2065 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2068 $(MAKE) unittests && \
2069 $(MAKE) install && \
2070 $(MAKE) uninstall && \
2071 $(MAKE) dist-clean && \
2072 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2075 $(Echo) Cleaning distribution files
2076 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2081 #------------------------------------------------------------------------
2082 # Provide the recursive distdir target for building the distribution directory
2083 #------------------------------------------------------------------------
2084 distdir: $(DistDir)/.makedistdir
2085 $(DistDir)/.makedistdir: $(DistSources)
2086 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2087 if test -d "$(DistDir)" ; then \
2088 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2091 $(EchoCmd) Removing old $(DistDir) ; \
2092 $(RM) -rf $(DistDir); \
2093 $(EchoCmd) Making 'all' to verify build ; \
2094 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2096 $(Echo) Building Distribution Directory $(DistDir)
2097 $(Verb) $(MKDIR) $(DistDir)
2098 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2099 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2100 for file in $(DistFiles) ; do \
2102 $(PROJ_SRC_DIR)/*) \
2103 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2105 $(PROJ_SRC_ROOT)/*) \
2106 file=`echo "$$file" | \
2107 sed "s#^$$srcrootstrip/##"` \
2110 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2111 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2112 from_dir="$(PROJ_SRC_DIR)" ; \
2113 elif test -f "$$file" || test -d "$$file" ; then \
2116 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2117 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2118 to_dir="$(DistDir)/$$dir"; \
2119 $(MKDIR) "$$to_dir" ; \
2121 to_dir="$(DistDir)"; \
2123 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2124 if test -n "$$mid_dir" ; then \
2125 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2127 if test -d "$$from_dir/$$file"; then \
2128 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2129 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2130 cd $(PROJ_SRC_DIR) ; \
2131 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2132 ( cd $$to_dir ; $(TAR) xf - ) ; \
2133 cd $(PROJ_OBJ_DIR) ; \
2136 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2137 ( cd $$to_dir ; $(TAR) xf - ) ; \
2138 cd $(PROJ_OBJ_DIR) ; \
2140 elif test -f "$$from_dir/$$file" ; then \
2141 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2142 elif test -L "$$from_dir/$$file" ; then \
2143 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2144 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2145 $(EchoCmd) "===== WARNING: Distribution Source " \
2146 "$$from_dir/$$file Not Found!" ; \
2147 elif test "$(Verb)" != '@' ; then \
2148 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2151 $(Verb) for subdir in $(DistSubDirs) ; do \
2152 if test "$$subdir" \!= "." ; then \
2153 new_distdir="$(DistDir)/$$subdir" ; \
2154 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2155 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2156 DistDir="$$new_distdir" distdir ) || exit 1; \
2159 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2160 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2161 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2162 -name .svn \) -print` ;\
2163 $(MAKE) dist-hook ; \
2164 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2165 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2166 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2167 -o ! -type d ! -perm -444 -exec \
2168 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2169 || chmod -R a+r $(DistDir) ; \
2172 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2178 ###############################################################################
2179 # TOP LEVEL - targets only to apply at the top level directory
2180 ###############################################################################
2184 #------------------------------------------------------------------------
2185 # Install support for the project's include files:
2186 #------------------------------------------------------------------------
2189 $(Echo) Install circumvented with NO_INSTALL
2191 $(Echo) Uninstall circumvented with NO_INSTALL
2194 $(Echo) Installing include files
2195 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2196 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2197 cd $(PROJ_SRC_ROOT)/include && \
2198 for hdr in `find . -type f \
2199 '(' -name LICENSE.TXT \
2204 ')' -print | grep -v CVS | \
2205 grep -v .svn` ; do \
2206 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2207 if test \! -d "$$instdir" ; then \
2208 $(EchoCmd) Making install directory $$instdir ; \
2209 $(MKDIR) $$instdir ;\
2211 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2214 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2215 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2216 cd $(PROJ_OBJ_ROOT)/include && \
2217 for hdr in `find . -type f \
2218 '(' -name LICENSE.TXT \
2223 ')' -print | grep -v CVS | \
2224 grep -v .svn` ; do \
2225 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2226 if test \! -d "$$instdir" ; then \
2227 $(EchoCmd) Making install directory $$instdir ; \
2228 $(MKDIR) $$instdir ;\
2230 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2236 $(Echo) Uninstalling include files
2237 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2238 cd $(PROJ_SRC_ROOT)/include && \
2239 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2240 '!' '(' -name '*~' -o -name '.#*' \
2241 -o -name '*.in' ')' -print ')' | \
2242 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2243 cd $(PROJ_SRC_ROOT)/include && \
2244 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2245 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2251 @echo searching for overlength lines in files: $(Sources)
2254 egrep -n '.{81}' $(Sources) /dev/null
2257 @echo searching for tabs in files: $(Sources)
2260 egrep -n ' ' $(Sources) /dev/null
2263 @ls -l $(LibDir) | awk '\
2264 BEGIN { sum = 0; } \
2266 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2267 @ls -l $(ToolDir) | awk '\
2268 BEGIN { sum = 0; } \
2270 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2271 #------------------------------------------------------------------------
2272 # Print out the directories used for building
2273 #------------------------------------------------------------------------
2275 $(Echo) "BuildMode : " '$(BuildMode)'
2276 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2277 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2278 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2279 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2280 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2281 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2282 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2283 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2284 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2285 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2286 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2287 $(Echo) "UserTargets : " '$(UserTargets)'
2288 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2289 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2290 $(Echo) "ObjDir : " '$(ObjDir)'
2291 $(Echo) "LibDir : " '$(LibDir)'
2292 $(Echo) "ToolDir : " '$(ToolDir)'
2293 $(Echo) "ExmplDir : " '$(ExmplDir)'
2294 $(Echo) "Sources : " '$(Sources)'
2295 $(Echo) "TDFiles : " '$(TDFiles)'
2296 $(Echo) "INCFiles : " '$(INCFiles)'
2297 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2298 $(Echo) "PreConditions: " '$(PreConditions)'
2299 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2300 $(Echo) "Compile.C : " '$(Compile.C)'
2301 $(Echo) "Archive : " '$(Archive)'
2302 $(Echo) "YaccFiles : " '$(YaccFiles)'
2303 $(Echo) "LexFiles : " '$(LexFiles)'
2304 $(Echo) "Module : " '$(Module)'
2305 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2306 $(Echo) "SubDirs : " '$(SubDirs)'
2307 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2308 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2313 # General debugging rule, use 'make dbg-print-XXX' to print the
2314 # definition, value and origin of XXX.
2316 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))