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)]:
510 ifdef BUILD_DIRS_ONLY
511 EchoCmd := $(EchoCmd) "(build tools)":
516 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
519 ifeq ($(LLVM_CROSS_COMPILING),1)
520 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
522 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
525 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
527 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
530 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
533 LLI := $(LLVMToolDir)/lli$(EXEEXT)
536 LLC := $(LLVMToolDir)/llc$(EXEEXT)
539 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
542 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
545 #--------------------------------------------------------------------
546 # Adjust to user's request
547 #--------------------------------------------------------------------
549 ifeq ($(HOST_OS),Darwin)
550 DARWIN_VERSION := `sw_vers -productVersion`
551 # Strip a number like 10.4.7 to 10.4
552 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
553 # Get "4" out of 10.4 for later pieces in the makefile.
554 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
556 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
557 SharedLinkOptions := -dynamiclib
559 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
562 SharedLinkOptions=-shared
565 ifeq ($(TARGET_OS),Darwin)
567 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
572 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
573 ifneq ($(HOST_OS),Darwin)
574 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
586 # Adjust settings for verbose mode
589 AR.Flags += >/dev/null 2>/dev/null
590 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
592 ConfigureScriptFLAGS :=
595 # By default, strip symbol information from executable
597 Strip := $(PLATFORMSTRIPOPTS)
598 StripWarnMsg := "(without symbols)"
599 Install.StripFlag += -s
602 ifdef TOOL_NO_EXPORTS
605 DynamicFlag := $(RDYNAMIC)
608 # Adjust linker flags for building an executable
609 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
610 ifneq ($(HOST_OS), Darwin)
612 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
614 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
616 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
620 ifneq ($(DARWIN_MAJVERS),4)
621 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
627 #----------------------------------------------------------
628 # Options To Invoke Tools
629 #----------------------------------------------------------
631 ifdef EXTRA_LD_OPTIONS
632 LD.Flags += $(EXTRA_LD_OPTIONS)
636 CompileCommonOpts += -pedantic -Wno-long-long
638 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
640 # Enable cast-qual for C++; the workaround is to use const_cast.
641 CXX.Flags += -Wcast-qual
643 ifeq ($(HOST_OS),HP-UX)
644 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
647 # If we are building a universal binary on Mac OS/X, pass extra options. This
648 # is useful to people that want to link the LLVM libraries into their universal
651 # The following can be optionally specified:
652 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
653 # For Mac OS/X 10.4 Intel machines, the traditional one is:
654 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
655 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
656 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
659 ifndef UNIVERSAL_ARCH
660 UNIVERSAL_ARCH := i386 ppc
662 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
663 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
664 ifdef UNIVERSAL_SDK_PATH
665 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
668 # Building universal cannot compute dependencies automatically.
669 DISABLE_AUTO_DEPENDENCIES=1
671 ifeq ($(TARGET_OS),Darwin)
672 ifeq ($(ARCH),x86_64)
673 TargetCommonOpts = -m64
676 TargetCommonOpts = -m32
682 ifeq ($(HOST_OS),SunOS)
683 CPP.BaseFlags += -include llvm/Support/Solaris.h
686 ifeq ($(HOST_OS),AuroraUX)
687 CPP.BaseFlags += -include llvm/Support/Solaris.h
688 endif # !HOST_OS - AuroraUX.
690 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
691 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
692 # All -I flags should go here, so that they don't confuse llvm-config.
693 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
694 $(patsubst %,-I%/include,\
695 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
696 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
699 ifeq ($(INCLUDE_BUILD_DIR),1)
700 CPP.Flags += -I$(ObjDir)
703 # SHOW_DIAGNOSTICS support.
704 ifeq ($(SHOW_DIAGNOSTICS),1)
705 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
706 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
711 Compile.C = $(Compile.Wrapper) \
712 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
713 $(TargetCommonOpts) $(CompileCommonOpts) -c
714 Compile.CXX = $(Compile.Wrapper) \
715 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
716 $(TargetCommonOpts) $(CompileCommonOpts) -c
717 Preprocess.CXX= $(Compile.Wrapper) \
718 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
719 $(CompileCommonOpts) $(CXX.Flags) -E
720 Link = $(Compile.Wrapper) \
721 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
722 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
724 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
725 $(TargetCommonOpts) $(CompileCommonOpts)
726 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
727 $(TargetCommonOpts) $(CompileCommonOpts) -E
729 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
730 $(TargetCommonOpts) $(CompileCommonOpts)
732 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
733 ScriptInstall = $(INSTALL) -m 0755
734 DataInstall = $(INSTALL) -m 0644
736 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
737 # paths. In this case, the SYSPATH function (defined in
738 # Makefile.config) transforms Unix paths into Windows paths.
739 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
740 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
741 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
742 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
743 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
745 Archive = $(AR) $(AR.Flags)
746 LArchive = $(LLVMToolDir)/llvm-ar rcsf
755 #----------------------------------------------------------
756 # Get the list of source files and compute object file
758 #----------------------------------------------------------
761 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
762 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
764 Sources := $(SOURCES)
768 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
771 BaseNameSources := $(sort $(basename $(Sources)))
773 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
774 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
776 #----------------------------------------------------------
777 # For Mingw MSYS bash and Python/w32:
779 # $(ECHOPATH) prints DOSish pathstring.
780 # ex) $(ECHOPATH) /include/sys/types.h
781 # --> C:/mingw/include/sys/types.h
782 # built-in "echo" does not transform path to DOSish path.
784 # FIXME: It would not be needed when MSYS's python
786 #----------------------------------------------------------
788 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
789 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
791 ECHOPATH := $(Verb)$(ECHO)
794 ###############################################################################
795 # DIRECTORIES: Handle recursive descent of directory structure
796 ###############################################################################
798 #---------------------------------------------------------
799 # Provide rules to make install dirs. This must be early
800 # in the file so they get built before dependencies
801 #---------------------------------------------------------
803 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
806 # To create other directories, as needed, and timestamp their creation
808 $(Verb) $(MKDIR) $* > /dev/null
809 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
811 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
812 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
814 #---------------------------------------------------------
815 # Handle the DIRS options for sequential construction
816 #---------------------------------------------------------
822 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
823 $(RecursiveTargets)::
824 $(Verb) for dir in $(DIRS); do \
825 if ([ ! -f $$dir/Makefile ] || \
826 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
828 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
830 ($(MAKE) -C $$dir $@ ) || exit 1; \
833 $(RecursiveTargets)::
834 $(Verb) for dir in $(DIRS); do \
835 ($(MAKE) -C $$dir $@ ) || exit 1; \
841 #---------------------------------------------------------
842 # Handle the EXPERIMENTAL_DIRS options ensuring success
843 # after each directory is built.
844 #---------------------------------------------------------
845 ifdef EXPERIMENTAL_DIRS
846 $(RecursiveTargets)::
847 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
848 if ([ ! -f $$dir/Makefile ] || \
849 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
851 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
853 ($(MAKE) -C $$dir $@ ) || exit 0; \
857 #-----------------------------------------------------------
858 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
859 #-----------------------------------------------------------
860 ifdef OPTIONAL_PARALLEL_DIRS
861 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
864 #-----------------------------------------------------------
865 # Handle the PARALLEL_DIRS options for parallel construction
866 #-----------------------------------------------------------
869 SubDirs += $(PARALLEL_DIRS)
871 # Unfortunately, this list must be maintained if new recursive targets are added
872 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
873 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
874 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
875 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
876 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
877 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
878 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
880 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
884 SD=$(PROJ_SRC_DIR)/$(@D); \
886 if [ ! -f $$SD/Makefile ]; then \
888 DD=$(notdir $(@D)); \
890 if ([ ! -f $$DD/Makefile ] || \
891 command test $$DD/Makefile -ot \
892 $$SD/Makefile ); then \
894 $(CP) $$SD/Makefile $$DD/Makefile; \
896 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
899 #---------------------------------------------------------
900 # Handle the OPTIONAL_DIRS options for directores that may
902 #---------------------------------------------------------
905 SubDirs += $(OPTIONAL_DIRS)
907 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
908 $(RecursiveTargets)::
909 $(Verb) for dir in $(OPTIONAL_DIRS); do \
910 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
911 if ([ ! -f $$dir/Makefile ] || \
912 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
914 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
916 ($(MAKE) -C$$dir $@ ) || exit 1; \
920 $(RecursiveTargets)::
921 $(Verb) for dir in $(OPTIONAL_DIRS); do \
922 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
923 ($(MAKE) -C$$dir $@ ) || exit 1; \
929 #---------------------------------------------------------
930 # Handle the CONFIG_FILES options
931 #---------------------------------------------------------
936 $(Echo) Install circumvented with NO_INSTALL
938 $(Echo) UnInstall circumvented with NO_INSTALL
940 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
941 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
942 $(Verb)for file in $(CONFIG_FILES); do \
943 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
944 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
945 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
946 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
948 $(ECHO) Error: cannot find config file $${file}. ; \
953 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
954 $(Verb)for file in $(CONFIG_FILES); do \
955 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
961 ###############################################################################
962 # Set up variables for building libraries
963 ###############################################################################
965 #---------------------------------------------------------
966 # Define various command line options pertaining to the
967 # libraries needed when linking. There are "Proj" libs
968 # (defined by the user's project) and "LLVM" libs (defined
969 # by the LLVM project).
970 #---------------------------------------------------------
973 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
974 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
975 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
976 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
980 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
981 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
982 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
983 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
986 # Loadable module for Win32 requires all symbols resolved for linking.
987 # Then all symbols in LLVM.dll will be available.
988 ifeq ($(ENABLE_SHARED),1)
989 ifdef LOADABLE_MODULE
990 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
991 LINK_COMPONENTS += all
996 ifndef IS_CLEANING_TARGET
997 ifdef LINK_COMPONENTS
999 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1000 # clean in tools, then do a make in tools (instead of at the top level).
1002 @echo "*** llvm-config doesn't exist - rebuilding it."
1003 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1005 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1007 ifeq ($(ENABLE_SHARED), 1)
1008 # We can take the "auto-import" feature to get rid of using dllimport.
1009 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1010 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1013 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1014 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1017 ifndef NO_LLVM_CONFIG
1018 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1019 ifeq ($(LLVMConfigLibs),Error)
1020 $(error llvm-config --libs failed)
1022 LLVMLibsOptions += $(LLVMConfigLibs)
1023 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1024 ifeq ($(LLVMConfigLibfiles),Error)
1025 $(error llvm-config --libfiles failed)
1027 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1034 # Set up the library exports file.
1035 ifdef EXPORTED_SYMBOL_FILE
1037 # First, set up the native export file, which may differ from the source
1040 ifeq ($(HOST_OS),Darwin)
1041 # Darwin convention prefixes symbols with underscores.
1042 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1043 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1044 $(Verb) sed -e 's/^/_/' < $< > $@
1046 -$(Verb) $(RM) -f $(NativeExportsFile)
1048 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1049 # Gold and BFD ld require a version script rather than a plain list.
1050 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1051 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1052 $(Verb) echo "{" > $@
1053 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1054 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1055 ifneq ($(HOST_OS),OpenBSD)
1056 $(Verb) echo " local: *;" >> $@
1058 $(Verb) echo "};" >> $@
1060 -$(Verb) $(RM) -f $(NativeExportsFile)
1062 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1063 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1064 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1065 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1066 $(Echo) Generating $(notdir $@)
1067 $(Verb) $(ECHO) "EXPORTS" > $@
1068 $(Verb) $(CAT) $< >> $@
1070 -$(Verb) $(RM) -f $(NativeExportsFile)
1072 # Default behavior: just use the exports file verbatim.
1073 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1078 # Now add the linker command-line options to use the native export file.
1081 ifeq ($(HOST_OS),Darwin)
1082 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1085 # gold, bfd ld, etc.
1086 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1087 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1091 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1092 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1093 SharedLinkOptions += $(NativeExportsFile)
1098 ###############################################################################
1099 # Library Build Rules: Four ways to build a library
1100 ###############################################################################
1102 #---------------------------------------------------------
1103 # Bytecode Module Targets:
1104 # If the user set MODULE_NAME then they want to build a
1105 # bytecode module from the sources. We compile all the
1106 # sources and link it together into a single bytecode
1108 #---------------------------------------------------------
1111 ifeq ($(strip $(LLVMCC)),)
1112 $(warning Modules require LLVM capable compiler but none is available ****)
1115 Module := $(LibDir)/$(MODULE_NAME).bc
1116 LinkModule := $(LLVMLD) -r
1119 ifdef EXPORTED_SYMBOL_FILE
1120 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1123 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1124 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1125 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1127 all-local:: $(Module)
1130 ifneq ($(strip $(Module)),)
1131 -$(Verb) $(RM) -f $(Module)
1134 ifdef BYTECODE_DESTINATION
1135 ModuleDestDir := $(BYTECODE_DESTINATION)
1137 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1142 $(Echo) Install circumvented with NO_INSTALL
1144 $(Echo) Uninstall circumvented with NO_INSTALL
1146 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1148 install-module:: $(DestModule)
1149 install-local:: $(DestModule)
1151 $(DestModule): $(ModuleDestDir) $(Module)
1152 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1153 $(Verb) $(DataInstall) $(Module) $(DestModule)
1156 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1157 -$(Verb) $(RM) -f $(DestModule)
1163 # if we're building a library ...
1166 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1167 LIBRARYNAME := $(strip $(LIBRARYNAME))
1168 ifdef LOADABLE_MODULE
1169 BaseLibName.A := $(LIBRARYNAME).a
1170 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1172 BaseLibName.A := lib$(LIBRARYNAME).a
1173 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1175 LibName.A := $(LibDir)/$(BaseLibName.A)
1176 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1177 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1178 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1180 #---------------------------------------------------------
1181 # Shared Library Targets:
1182 # If the user asked for a shared library to be built
1183 # with the SHARED_LIBRARY variable, then we provide
1184 # targets for building them.
1185 #---------------------------------------------------------
1186 ifdef SHARED_LIBRARY
1188 all-local:: $(LibName.SO)
1190 ifdef EXPORTED_SYMBOL_FILE
1191 $(LibName.SO): $(NativeExportsFile)
1194 ifdef LINK_LIBS_IN_SHARED
1195 ifdef LOADABLE_MODULE
1196 SharedLibKindMessage := "Loadable Module"
1197 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1199 SharedLibKindMessage := "Shared Library"
1201 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1202 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1204 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1205 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1207 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1208 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1209 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1213 ifneq ($(strip $(LibName.SO)),)
1214 -$(Verb) $(RM) -f $(LibName.SO)
1219 $(Echo) Install circumvented with NO_INSTALL
1221 $(Echo) Uninstall circumvented with NO_INSTALL
1224 # Win32.DLL prefers to be located on the "PATH" of binaries.
1225 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1226 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1228 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1230 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1232 install-local:: $(DestSharedLib)
1234 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1235 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1236 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1239 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1240 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1244 #---------------------------------------------------------
1245 # Bytecode Library Targets:
1246 # If the user asked for a bytecode library to be built
1247 # with the BYTECODE_LIBRARY variable, then we provide
1248 # targets for building them.
1249 #---------------------------------------------------------
1250 ifdef BYTECODE_LIBRARY
1251 ifeq ($(strip $(LLVMCC)),)
1252 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1255 all-local:: $(LibName.BCA)
1257 ifdef EXPORTED_SYMBOL_FILE
1258 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1260 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1261 $(LLVMToolDir)/llvm-ar
1262 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1264 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1266 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1268 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1269 $(LLVMToolDir)/llvm-ar
1270 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1272 $(Verb) $(LArchive) $@ $(ObjectsBC)
1277 ifneq ($(strip $(LibName.BCA)),)
1278 -$(Verb) $(RM) -f $(LibName.BCA)
1281 ifdef BYTECODE_DESTINATION
1282 BytecodeDestDir := $(BYTECODE_DESTINATION)
1284 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1287 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1289 install-bytecode-local:: $(DestBytecodeLib)
1293 $(Echo) Install circumvented with NO_INSTALL
1295 $(Echo) Uninstall circumvented with NO_INSTALL
1297 install-local:: $(DestBytecodeLib)
1299 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1300 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1301 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1304 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1305 -$(Verb) $(RM) -f $(DestBytecodeLib)
1310 #---------------------------------------------------------
1312 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1313 # building an archive.
1314 #---------------------------------------------------------
1315 ifndef NO_BUILD_ARCHIVE
1316 ifndef BUILD_ARCHIVE
1317 ifndef LOADABLE_MODULE
1323 #---------------------------------------------------------
1324 # Archive Library Targets:
1325 # If the user wanted a regular archive library built,
1326 # then we provide targets for building them.
1327 #---------------------------------------------------------
1330 all-local:: $(LibName.A)
1332 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1333 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1334 -$(Verb) $(RM) -f $@
1335 $(Verb) $(Archive) $@ $(ObjectsO)
1336 $(Verb) $(Ranlib) $@
1339 ifneq ($(strip $(LibName.A)),)
1340 -$(Verb) $(RM) -f $(LibName.A)
1345 $(Echo) Install circumvented with NO_INSTALL
1347 $(Echo) Uninstall circumvented with NO_INSTALL
1349 ifdef NO_INSTALL_ARCHIVES
1351 $(Echo) Install circumvented with NO_INSTALL
1353 $(Echo) Uninstall circumvented with NO_INSTALL
1355 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1357 install-local:: $(DestArchiveLib)
1359 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1360 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1361 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1362 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1365 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1366 -$(Verb) $(RM) -f $(DestArchiveLib)
1374 ###############################################################################
1375 # Tool Build Rules: Build executable tool based on TOOLNAME option
1376 ###############################################################################
1380 #---------------------------------------------------------
1381 # Set up variables for building a tool.
1382 #---------------------------------------------------------
1383 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1385 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1387 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1390 # TOOLALIAS is a name to symlink (or copy) the tool to.
1393 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1395 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1399 #---------------------------------------------------------
1401 #---------------------------------------------------------
1403 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1404 # not exporting all of the weak symbols from the binary. This reduces dyld
1405 # startup time by 4x on darwin in some cases.
1406 ifdef TOOL_NO_EXPORTS
1407 ifeq ($(HOST_OS),Darwin)
1409 # Tiger tools don't support this.
1410 ifneq ($(DARWIN_MAJVERS),4)
1411 LD.Flags += -Wl,-exported_symbol,_main
1415 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1416 ifneq ($(ARCH), Mips)
1417 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1422 #---------------------------------------------------------
1423 # Tool Order File Support
1424 #---------------------------------------------------------
1426 ifeq ($(HOST_OS),Darwin)
1427 ifdef TOOL_ORDER_FILE
1429 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1434 #---------------------------------------------------------
1435 # Tool Version Info Support
1436 #---------------------------------------------------------
1438 ifeq ($(HOST_OS),Darwin)
1439 ifdef TOOL_INFO_PLIST
1441 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1443 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1445 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1446 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1447 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1448 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1449 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1450 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1456 #---------------------------------------------------------
1457 # Provide targets for building the tools
1458 #---------------------------------------------------------
1459 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1462 ifneq ($(strip $(ToolBuildPath)),)
1463 -$(Verb) $(RM) -f $(ToolBuildPath)
1465 ifneq ($(strip $(ToolAliasBuildPath)),)
1466 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1470 $(ToolBuildPath): $(ExmplDir)/.dir
1472 $(ToolBuildPath): $(ToolDir)/.dir
1475 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1476 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1477 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1478 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1479 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1482 ifneq ($(strip $(ToolAliasBuildPath)),)
1483 $(ToolAliasBuildPath): $(ToolBuildPath)
1484 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1485 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1486 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1487 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1493 $(Echo) Install circumvented with NO_INSTALL
1495 $(Echo) Uninstall circumvented with NO_INSTALL
1497 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1499 install-local:: $(DestTool)
1501 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1502 $(Echo) Installing $(BuildMode) $(DestTool)
1503 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1506 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1507 -$(Verb) $(RM) -f $(DestTool)
1509 # TOOLALIAS install.
1511 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1513 install-local:: $(DestToolAlias)
1515 $(DestToolAlias): $(DestTool)
1516 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1517 $(Verb) $(RM) -f $(DestToolAlias)
1518 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1521 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1522 -$(Verb) $(RM) -f $(DestToolAlias)
1528 ###############################################################################
1529 # Object Build Rules: Build object files based on sources
1530 ###############################################################################
1532 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1533 ifeq ($(HOST_OS),HP-UX)
1534 DISABLE_AUTO_DEPENDENCIES=1
1537 # Provide rule sets for when dependency generation is enabled
1538 ifndef DISABLE_AUTO_DEPENDENCIES
1540 #---------------------------------------------------------
1541 # Create .o files in the ObjDir directory from the .cpp and .c files...
1542 #---------------------------------------------------------
1544 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1545 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1547 # If the build succeeded, move the dependency file over, otherwise
1549 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1550 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1552 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1553 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1554 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1557 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1558 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1559 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1562 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1563 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1564 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1567 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1568 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1569 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1572 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1573 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1574 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1577 #---------------------------------------------------------
1578 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1579 #---------------------------------------------------------
1581 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1582 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1584 # If the build succeeded, move the dependency file over, otherwise
1586 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1587 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1589 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1590 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1591 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1592 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1593 $(BC_DEPEND_MOVEFILE)
1595 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1596 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1597 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1598 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1599 $(BC_DEPEND_MOVEFILE)
1601 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1602 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1603 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1604 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1605 $(BC_DEPEND_MOVEFILE)
1607 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1608 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1609 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1610 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1611 $(BC_DEPEND_MOVEFILE)
1613 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1614 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1615 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1616 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1617 $(BC_DEPEND_MOVEFILE)
1619 # Provide alternate rule sets if dependencies are disabled
1622 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1623 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1624 $(Compile.CXX) $< -o $@
1626 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1627 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1628 $(Compile.CXX) $< -o $@
1630 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1631 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1632 $(Compile.CXX) $< -o $@
1634 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1635 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1636 $(Compile.C) $< -o $@
1638 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1639 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1640 $(Compile.C) $< -o $@
1642 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1643 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1644 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1646 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1647 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1648 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1650 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1651 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1652 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1654 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1655 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1656 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1658 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1659 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1660 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1665 ## Rules for building preprocessed (.i/.ii) outputs.
1666 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1667 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1668 $(Verb) $(Preprocess.CXX) $< -o $@
1670 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1671 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1672 $(Verb) $(Preprocess.CXX) $< -o $@
1674 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1675 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1676 $(Verb) $(Preprocess.CXX) $< -o $@
1678 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1679 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1680 $(Verb) $(Preprocess.C) $< -o $@
1682 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1683 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1684 $(Verb) $(Preprocess.C) $< -o $@
1687 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1688 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1689 $(Compile.CXX) $< -o $@ -S
1691 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1692 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1693 $(Compile.CXX) $< -o $@ -S
1695 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1696 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1697 $(Compile.CXX) $< -o $@ -S
1699 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1700 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1701 $(Compile.C) $< -o $@ -S
1703 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1704 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1705 $(Compile.C) $< -o $@ -S
1708 # make the C and C++ compilers strip debug info out of bytecode libraries.
1710 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1711 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1712 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1714 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1715 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1716 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1720 #---------------------------------------------------------
1721 # Provide rule to build .bc files from .ll sources,
1722 # regardless of dependencies
1723 #---------------------------------------------------------
1724 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1725 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1726 $(Verb) $(LLVMAS) $< -f -o $@
1728 ###############################################################################
1729 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1730 ###############################################################################
1733 TABLEGEN_INC_FILES_COMMON = 1
1736 ifdef TABLEGEN_INC_FILES_COMMON
1738 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1739 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1740 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1742 # INCFiles rule: All of the tblgen generated files are emitted to
1743 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1744 # us to only "touch" the real file if the contents of it change. IOW, if
1745 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1746 # dependencies of the .inc files are, unless the contents of the .inc file
1748 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1749 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1751 endif # TABLEGEN_INC_FILES_COMMON
1755 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1756 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1757 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1758 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1759 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1760 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1761 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1763 # All .inc.tmp files depend on the .td files.
1764 $(INCTMPFiles) : $(TDFiles)
1766 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1767 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1768 $(Echo) "Building $(<F) register info implementation with tblgen"
1769 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1771 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1772 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1773 $(Echo) "Building $(<F) instruction information with tblgen"
1774 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1776 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1777 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1778 $(Echo) "Building $(<F) assembly writer with tblgen"
1779 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1781 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1782 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1783 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1784 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1786 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1787 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1788 $(Echo) "Building $(<F) assembly matcher with tblgen"
1789 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1791 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1792 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1793 $(Echo) "Building $(<F) MC code emitter with tblgen"
1794 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1796 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1797 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1798 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1799 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1801 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1802 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1803 $(Echo) "Building $(<F) code emitter with tblgen"
1804 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1806 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1807 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1808 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1809 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1811 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1812 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1813 $(Echo) "Building $(<F) disassembly tables with tblgen"
1814 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1816 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1817 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1818 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1819 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1821 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1822 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1823 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1824 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1826 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1827 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1828 $(Echo) "Building $(<F) subtarget information with tblgen"
1829 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1831 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1832 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1833 $(Echo) "Building $(<F) calling convention information with tblgen"
1834 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1836 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1837 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1838 $(Echo) "Building $(<F) intrinsics information with tblgen"
1839 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1841 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1842 $(Echo) "Building $(<F) decoder tables with tblgen"
1843 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1847 -$(Verb) $(RM) -f $(INCFiles)
1851 ###############################################################################
1852 # OTHER RULES: Other rules needed
1853 ###############################################################################
1855 # To create postscript files from dot files...
1856 ifneq ($(DOT),false)
1858 $(DOT) -Tps < $< > $@
1861 $(Echo) "Cannot build $@: The program dot is not installed"
1864 # This rules ensures that header files that are removed still have a rule for
1865 # which they can be "generated." This allows make to ignore them and
1866 # reproduce the dependency lists.
1870 # Define clean-local to clean the current directory. Note that this uses a
1871 # very conservative approach ensuring that empty variables do not cause
1872 # errors or disastrous removal.
1874 ifneq ($(strip $(ObjRootDir)),)
1875 -$(Verb) $(RM) -rf $(ObjRootDir)
1877 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1878 -$(Verb) $(RM) -f *$(SHLIBEXT)
1882 -$(Verb) $(RM) -rf Debug Release Profile
1885 ###############################################################################
1886 # DEPENDENCIES: Include the dependency files if we should
1887 ###############################################################################
1888 ifndef DISABLE_AUTO_DEPENDENCIES
1890 # If its not one of the cleaning targets
1891 ifndef IS_CLEANING_TARGET
1893 # Get the list of dependency files
1894 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1895 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1897 # Include bitcode dependency files if using bitcode libraries
1898 ifdef BYTECODE_LIBRARY
1899 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1902 -include $(DependFiles) ""
1908 ###############################################################################
1909 # CHECK: Running the test suite
1910 ###############################################################################
1913 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1914 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1915 $(EchoCmd) Running test suite ; \
1916 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1917 TESTSUITE=$(TESTSUITE) ; \
1919 $(EchoCmd) No Makefile in test directory ; \
1922 $(EchoCmd) No test directory ; \
1928 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1929 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1930 $(EchoCmd) Running test suite ; \
1931 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1933 $(EchoCmd) No Makefile in test directory ; \
1936 $(EchoCmd) No test directory ; \
1940 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1941 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1942 $(EchoCmd) Running test suite ; \
1943 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1945 $(EchoCmd) No Makefile in test directory ; \
1948 $(EchoCmd) No test directory ; \
1951 ###############################################################################
1952 # UNITTESTS: Running the unittests test suite
1953 ###############################################################################
1956 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1957 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1958 $(EchoCmd) Running unittests test suite ; \
1959 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1961 $(EchoCmd) No Makefile in unittests directory ; \
1964 $(EchoCmd) No unittests directory ; \
1967 ###############################################################################
1968 # DISTRIBUTION: Handle construction of a distribution tarball
1969 ###############################################################################
1971 #------------------------------------------------------------------------
1972 # Define distribution related variables
1973 #------------------------------------------------------------------------
1974 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1975 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1976 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1977 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1978 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1979 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1980 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1981 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1982 Makefile.config.in configure autoconf
1983 DistOther := $(notdir $(wildcard \
1984 $(PROJ_SRC_DIR)/*.h \
1985 $(PROJ_SRC_DIR)/*.td \
1986 $(PROJ_SRC_DIR)/*.def \
1987 $(PROJ_SRC_DIR)/*.ll \
1988 $(PROJ_SRC_DIR)/*.in))
1989 DistSubDirs := $(SubDirs)
1990 DistSources = $(Sources) $(EXTRA_DIST)
1991 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1993 #------------------------------------------------------------------------
1994 # We MUST build distribution with OBJ_DIR != SRC_DIR
1995 #------------------------------------------------------------------------
1996 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
1997 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1998 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2002 #------------------------------------------------------------------------
2003 # Prevent attempt to run dist targets from anywhere but the top level
2004 #------------------------------------------------------------------------
2006 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2007 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2010 #------------------------------------------------------------------------
2011 # Provide the top level targets
2012 #------------------------------------------------------------------------
2014 dist-gzip:: $(DistTarGZip)
2016 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2017 $(Echo) Packing gzipped distribution tar file.
2018 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2019 $(GZIP) -c > "$(DistTarGZip)"
2021 dist-bzip2:: $(DistTarBZ2)
2023 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2024 $(Echo) Packing bzipped distribution tar file.
2025 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2026 $(BZIP2) -c >$(DistTarBZ2)
2028 dist-zip:: $(DistZip)
2030 $(DistZip) : $(TopDistDir)/.makedistdir
2031 $(Echo) Packing zipped distribution file.
2032 $(Verb) rm -f $(DistZip)
2033 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2035 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2036 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2038 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2040 dist-check:: $(DistTarGZip)
2041 $(Echo) Checking distribution tar file.
2042 $(Verb) if test -d $(DistCheckDir) ; then \
2043 $(RM) -rf $(DistCheckDir) ; \
2045 $(Verb) $(MKDIR) $(DistCheckDir)
2046 $(Verb) cd $(DistCheckDir) && \
2047 $(MKDIR) $(DistCheckDir)/build && \
2048 $(MKDIR) $(DistCheckDir)/install && \
2049 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2051 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2052 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2055 $(MAKE) unittests && \
2056 $(MAKE) install && \
2057 $(MAKE) uninstall && \
2058 $(MAKE) dist-clean && \
2059 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2062 $(Echo) Cleaning distribution files
2063 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2068 #------------------------------------------------------------------------
2069 # Provide the recursive distdir target for building the distribution directory
2070 #------------------------------------------------------------------------
2071 distdir: $(DistDir)/.makedistdir
2072 $(DistDir)/.makedistdir: $(DistSources)
2073 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2074 if test -d "$(DistDir)" ; then \
2075 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2078 $(EchoCmd) Removing old $(DistDir) ; \
2079 $(RM) -rf $(DistDir); \
2080 $(EchoCmd) Making 'all' to verify build ; \
2081 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2083 $(Echo) Building Distribution Directory $(DistDir)
2084 $(Verb) $(MKDIR) $(DistDir)
2085 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2086 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2087 for file in $(DistFiles) ; do \
2089 $(PROJ_SRC_DIR)/*) \
2090 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2092 $(PROJ_SRC_ROOT)/*) \
2093 file=`echo "$$file" | \
2094 sed "s#^$$srcrootstrip/##"` \
2097 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2098 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2099 from_dir="$(PROJ_SRC_DIR)" ; \
2100 elif test -f "$$file" || test -d "$$file" ; then \
2103 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2104 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2105 to_dir="$(DistDir)/$$dir"; \
2106 $(MKDIR) "$$to_dir" ; \
2108 to_dir="$(DistDir)"; \
2110 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2111 if test -n "$$mid_dir" ; then \
2112 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2114 if test -d "$$from_dir/$$file"; then \
2115 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2116 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2117 cd $(PROJ_SRC_DIR) ; \
2118 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2119 ( cd $$to_dir ; $(TAR) xf - ) ; \
2120 cd $(PROJ_OBJ_DIR) ; \
2123 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2124 ( cd $$to_dir ; $(TAR) xf - ) ; \
2125 cd $(PROJ_OBJ_DIR) ; \
2127 elif test -f "$$from_dir/$$file" ; then \
2128 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2129 elif test -L "$$from_dir/$$file" ; then \
2130 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2131 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2132 $(EchoCmd) "===== WARNING: Distribution Source " \
2133 "$$from_dir/$$file Not Found!" ; \
2134 elif test "$(Verb)" != '@' ; then \
2135 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2138 $(Verb) for subdir in $(DistSubDirs) ; do \
2139 if test "$$subdir" \!= "." ; then \
2140 new_distdir="$(DistDir)/$$subdir" ; \
2141 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2142 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2143 DistDir="$$new_distdir" distdir ) || exit 1; \
2146 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2147 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2148 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2149 -name .svn \) -print` ;\
2150 $(MAKE) dist-hook ; \
2151 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2152 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2153 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2154 -o ! -type d ! -perm -444 -exec \
2155 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2156 || chmod -R a+r $(DistDir) ; \
2159 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2165 ###############################################################################
2166 # TOP LEVEL - targets only to apply at the top level directory
2167 ###############################################################################
2171 #------------------------------------------------------------------------
2172 # Install support for the project's include files:
2173 #------------------------------------------------------------------------
2176 $(Echo) Install circumvented with NO_INSTALL
2178 $(Echo) Uninstall circumvented with NO_INSTALL
2181 $(Echo) Installing include files
2182 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2183 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2184 cd $(PROJ_SRC_ROOT)/include && \
2185 for hdr in `find . -type f \
2186 '(' -name LICENSE.TXT \
2191 ')' -print | grep -v CVS | \
2192 grep -v .svn` ; do \
2193 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2194 if test \! -d "$$instdir" ; then \
2195 $(EchoCmd) Making install directory $$instdir ; \
2196 $(MKDIR) $$instdir ;\
2198 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2201 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2202 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2203 cd $(PROJ_OBJ_ROOT)/include && \
2204 for hdr in `find . -type f \
2205 '(' -name LICENSE.TXT \
2210 ')' -print | grep -v CVS | \
2211 grep -v .svn` ; do \
2212 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2213 if test \! -d "$$instdir" ; then \
2214 $(EchoCmd) Making install directory $$instdir ; \
2215 $(MKDIR) $$instdir ;\
2217 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2223 $(Echo) Uninstalling include files
2224 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2225 cd $(PROJ_SRC_ROOT)/include && \
2226 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2227 '!' '(' -name '*~' -o -name '.#*' \
2228 -o -name '*.in' ')' -print ')' | \
2229 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2230 cd $(PROJ_SRC_ROOT)/include && \
2231 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2232 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2238 @echo searching for overlength lines in files: $(Sources)
2241 egrep -n '.{81}' $(Sources) /dev/null
2244 @echo searching for tabs in files: $(Sources)
2247 egrep -n ' ' $(Sources) /dev/null
2250 @ls -l $(LibDir) | awk '\
2251 BEGIN { sum = 0; } \
2253 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2254 @ls -l $(ToolDir) | awk '\
2255 BEGIN { sum = 0; } \
2257 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2258 #------------------------------------------------------------------------
2259 # Print out the directories used for building
2260 #------------------------------------------------------------------------
2262 $(Echo) "BuildMode : " '$(BuildMode)'
2263 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2264 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2265 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2266 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2267 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2268 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2269 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2270 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2271 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2272 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2273 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2274 $(Echo) "UserTargets : " '$(UserTargets)'
2275 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2276 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2277 $(Echo) "ObjDir : " '$(ObjDir)'
2278 $(Echo) "LibDir : " '$(LibDir)'
2279 $(Echo) "ToolDir : " '$(ToolDir)'
2280 $(Echo) "ExmplDir : " '$(ExmplDir)'
2281 $(Echo) "Sources : " '$(Sources)'
2282 $(Echo) "TDFiles : " '$(TDFiles)'
2283 $(Echo) "INCFiles : " '$(INCFiles)'
2284 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2285 $(Echo) "PreConditions: " '$(PreConditions)'
2286 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2287 $(Echo) "Compile.C : " '$(Compile.C)'
2288 $(Echo) "Archive : " '$(Archive)'
2289 $(Echo) "YaccFiles : " '$(YaccFiles)'
2290 $(Echo) "LexFiles : " '$(LexFiles)'
2291 $(Echo) "Module : " '$(Module)'
2292 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2293 $(Echo) "SubDirs : " '$(SubDirs)'
2294 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2295 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2300 # General debugging rule, use 'make dbg-print-XXX' to print the
2301 # definition, value and origin of XXX.
2303 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))