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 # PRECONDITIONS: that which must be built/checked first
62 ################################################################################
64 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
65 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
66 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
67 ConfigureScript := $(PROJ_SRC_ROOT)/configure
68 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
69 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
70 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
71 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
72 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
73 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
74 ifneq ($(MakefileCommonIn),)
75 PreConditions += $(MakefileCommon)
78 ifneq ($(MakefileConfigIn),)
79 PreConditions += $(MakefileConfig)
82 preconditions: $(PreConditions)
84 #------------------------------------------------------------------------
85 # Make sure the BUILT_SOURCES are built first
86 #------------------------------------------------------------------------
87 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
90 ifneq ($(strip $(BUILT_SOURCES)),)
91 -$(Verb) $(RM) -f $(BUILT_SOURCES)
94 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
96 $(Verb) if test -x config.status ; then \
97 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
98 $(MKDIR) .spotless.save ; \
99 $(MV) config.status .spotless.save ; \
100 $(MV) mklib .spotless.save ; \
101 $(MV) projects .spotless.save ; \
103 $(MV) .spotless.save/config.status . ; \
104 $(MV) .spotless.save/mklib . ; \
105 $(MV) .spotless.save/projects . ; \
106 $(RM) -rf .spotless.save ; \
107 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
108 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
109 $(ConfigStatusScript) ; \
111 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
115 $(EchoCmd) "spotless target not supported for objdir == srcdir"
118 $(BUILT_SOURCES) : $(ObjMakefiles)
120 #------------------------------------------------------------------------
121 # Make sure we're not using a stale configuration
122 #------------------------------------------------------------------------
124 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
125 $(Verb) cd $(PROJ_OBJ_ROOT) && \
126 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
127 $(ConfigStatusScript)
129 .PRECIOUS: $(ConfigStatusScript)
130 $(ConfigStatusScript): $(ConfigureScript)
131 $(Echo) Reconfiguring with $<
132 $(Verb) cd $(PROJ_OBJ_ROOT) && \
133 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
134 $(ConfigStatusScript)
136 #------------------------------------------------------------------------
137 # Make sure the configuration makefile is up to date
138 #------------------------------------------------------------------------
139 ifneq ($(MakefileConfigIn),)
140 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
141 $(Echo) Regenerating $@
142 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
145 ifneq ($(MakefileCommonIn),)
146 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
147 $(Echo) Regenerating $@
148 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
151 #------------------------------------------------------------------------
152 # If the Makefile in the source tree has been updated, copy it over into the
153 # build tree. But, only do this if the source and object makefiles differ
154 #------------------------------------------------------------------------
156 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
159 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
161 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
162 $(Echo) "Updating Makefile"
163 $(Verb) $(MKDIR) $(@D)
164 $(Verb) $(CP) -f $< $@
166 # Copy the Makefile.* files unless we're in the root directory which avoids
167 # the copying of Makefile.config.in or other things that should be explicitly
169 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
171 *Makefile.rules) ;; \
173 *) $(EchoCmd) "Updating $(@F)" ; \
180 #------------------------------------------------------------------------
181 # Set up the basic dependencies
182 #------------------------------------------------------------------------
183 $(UserTargets):: $(PreConditions)
187 clean-all:: clean-local clean-all-local
188 install:: install-local
189 uninstall:: uninstall-local
190 install-local:: all-local
191 install-bytecode:: install-bytecode-local
193 ###############################################################################
194 # VARIABLES: Set up various variables based on configuration data
195 ###############################################################################
197 # Variable for if this make is for a "cleaning" target
198 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
202 #--------------------------------------------------------------------
203 # Variables derived from configuration we are building
204 #--------------------------------------------------------------------
207 ifeq ($(ENABLE_OPTIMIZED),1)
209 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
210 ifneq ($(HOST_OS),FreeBSD)
211 ifneq ($(HOST_OS),GNU/kFreeBSD)
212 ifneq ($(HOST_OS),Darwin)
213 OmitFramePointer := -fomit-frame-pointer
218 # Darwin requires -fstrict-aliasing to be explicitly enabled.
219 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
220 # with -fstrict-aliasing and ipa-type-escape radr://6756684
221 #ifeq ($(HOST_OS),Darwin)
222 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
224 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
225 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
226 LD.Flags += $(OPTIMIZE_OPTION)
228 BuildMode := $(BuildMode)+Debug
235 ifdef NO_DEBUG_SYMBOLS
236 BuildMode := Unoptimized
250 ifeq ($(ENABLE_LIBCPP),1)
251 CXX.Flags += -stdlib=libc++
252 LD.Flags += -stdlib=libc++
255 ifeq ($(ENABLE_CXX11),1)
256 CXX.Flags += -std=c++11
259 ifeq ($(ENABLE_WERROR),1)
264 ifeq ($(ENABLE_PROFILING),1)
265 BuildMode := $(BuildMode)+Profile
266 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
267 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
268 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
272 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
273 # CXX.Flags += -fvisibility-inlines-hidden
276 ifdef ENABLE_EXPENSIVE_CHECKS
277 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
278 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
282 # IF REQUIRES_EH=1 is specified then don't disable exceptions
284 CXX.Flags += -fno-exceptions
286 # If the library requires EH, it also requires RTTI.
290 ifdef REQUIRES_FRAME_POINTER
291 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
292 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
293 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
296 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
297 ifneq ($(REQUIRES_RTTI), 1)
298 CXX.Flags += -fno-rtti
301 ifeq ($(ENABLE_COVERAGE),1)
302 BuildMode := $(BuildMode)+Coverage
303 CXX.Flags += -ftest-coverage -fprofile-arcs
304 C.Flags += -ftest-coverage -fprofile-arcs
307 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
308 # then disable assertions by defining the appropriate preprocessor symbols.
309 ifeq ($(DISABLE_ASSERTIONS),1)
310 CPP.Defines += -DNDEBUG
312 BuildMode := $(BuildMode)+Asserts
313 CPP.Defines += -D_DEBUG
316 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
317 # configured), then enable expensive checks by defining the
318 # appropriate preprocessor symbols.
319 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
320 BuildMode := $(BuildMode)+Checks
321 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
324 # LOADABLE_MODULE implies several other things so we force them to be
326 ifdef LOADABLE_MODULE
328 LINK_LIBS_IN_SHARED := 1
336 ifeq ($(ENABLE_PIC),1)
337 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
338 # Nothing. Win32 defaults to PIC and warns when given -fPIC
340 ifeq ($(HOST_OS),Darwin)
341 # Common symbols not allowed in dylib files
342 CXX.Flags += -fno-common
343 C.Flags += -fno-common
345 # Linux and others; pass -fPIC
351 ifeq ($(HOST_OS),Darwin)
352 CXX.Flags += -mdynamic-no-pic
353 C.Flags += -mdynamic-no-pic
357 # Support makefile variable to disable any kind of timestamp/non-deterministic
358 # info from being used in the build.
359 ifeq ($(ENABLE_TIMESTAMPS),1)
360 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
362 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
365 ifeq ($(HOST_OS),MingW)
367 CPP.Defines += -D__NO_CTYPE_INLINE
368 ifeq ($(LLVM_CROSS_COMPILING),1)
369 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
371 LD.Flags += -Wl,--allow-multiple-definition
376 CXX.Flags += -Woverloaded-virtual
377 CPP.BaseFlags += $(CPP.Defines)
380 # Make Floating point IEEE compliant on Alpha.
383 CPP.BaseFlags += -mieee
384 ifeq ($(ENABLE_PIC),0)
386 CPP.BaseFlags += -fPIC
389 LD.Flags += -Wl,--no-relax
392 # GNU ld/PECOFF accepts but ignores them below;
396 # FIXME: autoconf should be aware of them.
397 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
398 HAVE_LINK_VERSION_SCRIPT := 0
400 RDYNAMIC := -Wl,--export-all-symbols
403 #--------------------------------------------------------------------
404 # Directory locations
405 #--------------------------------------------------------------------
407 ifeq ($(LLVM_CROSS_COMPILING),1)
408 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
411 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
412 ObjDir := $(ObjRootDir)
413 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
414 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
415 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
416 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
417 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
418 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
420 #--------------------------------------------------------------------
421 # Locations of shared libraries
422 #--------------------------------------------------------------------
425 SharedLibDir := $(LibDir)
426 LLVMSharedLibDir := $(LLVMLibDir)
428 # Win32.DLL prefers to be located on the "PATH" of binaries.
429 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
430 SharedLibDir := $(ToolDir)
431 LLVMSharedLibDir := $(LLVMToolDir)
433 ifeq ($(HOST_OS),Cygwin)
440 #--------------------------------------------------------------------
441 # LLVM Capable Compiler
442 #--------------------------------------------------------------------
444 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
446 LLVMCXX := $(LLVMGXX)
448 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
449 ifneq ($(CLANGPATH),)
450 LLVMCC := $(CLANGPATH)
451 LLVMCXX := $(CLANGXXPATH)
453 ifeq ($(ENABLE_BUILT_CLANG),1)
454 LLVMCC := $(LLVMToolDir)/clang
455 LLVMCXX := $(LLVMToolDir)/clang++
461 #--------------------------------------------------------------------
462 # Full Paths To Compiled Tools and Utilities
463 #--------------------------------------------------------------------
464 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
467 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
470 ifeq ($(LLVM_CROSS_COMPILING),1)
471 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
473 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
476 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
478 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
481 LLI := $(LLVMToolDir)/lli$(EXEEXT)
484 LLC := $(LLVMToolDir)/llc$(EXEEXT)
487 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
490 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
493 #--------------------------------------------------------------------
494 # Adjust to user's request
495 #--------------------------------------------------------------------
497 ifeq ($(HOST_OS),Darwin)
498 DARWIN_VERSION := `sw_vers -productVersion`
499 # Strip a number like 10.4.7 to 10.4
500 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
501 # Get "4" out of 10.4 for later pieces in the makefile.
502 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
504 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
505 SharedLinkOptions := -dynamiclib
506 ifdef DEPLOYMENT_TARGET
507 SharedLinkOptions += $(DEPLOYMENT_TARGET)
510 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
514 SharedLinkOptions=-shared
517 ifeq ($(TARGET_OS),Darwin)
518 ifdef DEPLOYMENT_TARGET
519 TargetCommonOpts += $(DEPLOYMENT_TARGET)
522 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
528 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
529 ifneq ($(HOST_OS),Darwin)
530 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
542 # Adjust settings for verbose mode
545 AR.Flags += >/dev/null 2>/dev/null
546 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
548 ConfigureScriptFLAGS :=
551 # By default, strip symbol information from executable
553 Strip := $(PLATFORMSTRIPOPTS)
554 StripWarnMsg := "(without symbols)"
555 Install.StripFlag += -s
558 ifdef TOOL_NO_EXPORTS
561 DynamicFlag := $(RDYNAMIC)
564 # Adjust linker flags for building an executable
565 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
566 ifneq ($(HOST_OS), Darwin)
568 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
570 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
572 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
576 ifneq ($(DARWIN_MAJVERS),4)
577 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
583 #----------------------------------------------------------
584 # Options To Invoke Tools
585 #----------------------------------------------------------
587 ifdef EXTRA_LD_OPTIONS
588 LD.Flags += $(EXTRA_LD_OPTIONS)
592 CompileCommonOpts += -pedantic -Wno-long-long
594 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
595 $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT)
596 # Enable cast-qual for C++; the workaround is to use const_cast.
597 CXX.Flags += -Wcast-qual
599 ifeq ($(HOST_OS),HP-UX)
600 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
603 # If we are building a universal binary on Mac OS/X, pass extra options. This
604 # is useful to people that want to link the LLVM libraries into their universal
607 # The following can be optionally specified:
608 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
609 # For Mac OS/X 10.4 Intel machines, the traditional one is:
610 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
611 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
612 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
615 ifndef UNIVERSAL_ARCH
616 UNIVERSAL_ARCH := i386 ppc
618 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
619 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
620 ifdef UNIVERSAL_SDK_PATH
621 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
624 # Building universal cannot compute dependencies automatically.
625 DISABLE_AUTO_DEPENDENCIES=1
627 ifeq ($(TARGET_OS),Darwin)
628 ifeq ($(ARCH),x86_64)
629 TargetCommonOpts = -m64
632 TargetCommonOpts = -m32
638 ifeq ($(HOST_OS),SunOS)
639 CPP.BaseFlags += -include llvm/Support/Solaris.h
642 ifeq ($(HOST_OS),AuroraUX)
643 CPP.BaseFlags += -include llvm/Support/Solaris.h
644 endif # !HOST_OS - AuroraUX.
646 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
647 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
648 # All -I flags should go here, so that they don't confuse llvm-config.
649 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
650 $(patsubst %,-I%/include,\
651 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
652 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
655 # SHOW_DIAGNOSTICS support.
656 ifeq ($(SHOW_DIAGNOSTICS),1)
657 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
658 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
663 ifeq ($(BUILD_COMPONENT), 1)
664 Compile.C = $(Compile.Wrapper) \
665 $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
666 $(TargetCommonOpts) $(CompileCommonOpts) -c
667 Compile.CXX = $(Compile.Wrapper) \
668 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
670 $(TargetCommonOpts) $(CompileCommonOpts) -c
671 Preprocess.CXX= $(Compile.Wrapper) \
672 $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
673 $(CompileCommonOpts) $(CXX.Flags) -E
674 Link = $(Compile.Wrapper) \
675 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
676 $(LD.Flags) $(LDFLAGS) \
677 $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
679 Compile.C = $(Compile.Wrapper) \
680 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
681 $(TargetCommonOpts) $(CompileCommonOpts) -c
682 Compile.CXX = $(Compile.Wrapper) \
683 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
684 $(TargetCommonOpts) $(CompileCommonOpts) -c
685 Preprocess.CXX= $(Compile.Wrapper) \
686 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
687 $(CompileCommonOpts) $(CXX.Flags) -E
688 Link = $(Compile.Wrapper) \
689 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
690 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
693 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
694 $(TargetCommonOpts) $(CompileCommonOpts)
695 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
696 $(TargetCommonOpts) $(CompileCommonOpts) -E
698 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
699 $(TargetCommonOpts) $(CompileCommonOpts)
701 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
702 ScriptInstall = $(INSTALL) -m 0755
703 DataInstall = $(INSTALL) -m 0644
705 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
706 # paths. In this case, the SYSPATH function (defined in
707 # Makefile.config) transforms Unix paths into Windows paths.
708 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
709 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
710 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
711 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
712 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
714 Archive = $(AR) $(AR.Flags)
715 LArchive = $(LLVMToolDir)/llvm-ar rcsf
724 #----------------------------------------------------------
725 # Get the list of source files and compute object file
727 #----------------------------------------------------------
730 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
731 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
733 Sources := $(SOURCES)
737 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
740 BaseNameSources := $(sort $(basename $(Sources)))
742 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
743 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
745 #----------------------------------------------------------
746 # For Mingw MSYS bash and Python/w32:
748 # $(ECHOPATH) prints DOSish pathstring.
749 # ex) $(ECHOPATH) /include/sys/types.h
750 # --> C:/mingw/include/sys/types.h
751 # built-in "echo" does not transform path to DOSish path.
753 # FIXME: It would not be needed when MSYS's python
755 #----------------------------------------------------------
757 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
758 ECHOPATH := $(Verb)$(PYTHON) -u -c "import sys;print ' '.join(sys.argv[1:])"
760 ECHOPATH := $(Verb)$(ECHO)
763 ###############################################################################
764 # DIRECTORIES: Handle recursive descent of directory structure
765 ###############################################################################
767 #---------------------------------------------------------
768 # Provide rules to make install dirs. This must be early
769 # in the file so they get built before dependencies
770 #---------------------------------------------------------
772 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
775 # To create other directories, as needed, and timestamp their creation
777 $(Verb) $(MKDIR) $* > /dev/null
778 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
780 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
781 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
783 #---------------------------------------------------------
784 # Handle the DIRS options for sequential construction
785 #---------------------------------------------------------
791 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
792 $(RecursiveTargets)::
793 $(Verb) for dir in $(DIRS); do \
794 if ([ ! -f $$dir/Makefile ] || \
795 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
797 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
799 ($(MAKE) -C $$dir $@ ) || exit 1; \
802 $(RecursiveTargets)::
803 $(Verb) for dir in $(DIRS); do \
804 ($(MAKE) -C $$dir $@ ) || exit 1; \
810 #---------------------------------------------------------
811 # Handle the EXPERIMENTAL_DIRS options ensuring success
812 # after each directory is built.
813 #---------------------------------------------------------
814 ifdef EXPERIMENTAL_DIRS
815 $(RecursiveTargets)::
816 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
817 if ([ ! -f $$dir/Makefile ] || \
818 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
820 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
822 ($(MAKE) -C $$dir $@ ) || exit 0; \
826 #-----------------------------------------------------------
827 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
828 #-----------------------------------------------------------
829 ifdef OPTIONAL_PARALLEL_DIRS
830 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)"))
833 #-----------------------------------------------------------
834 # Handle the PARALLEL_DIRS options for parallel construction
835 #-----------------------------------------------------------
838 SubDirs += $(PARALLEL_DIRS)
840 # Unfortunately, this list must be maintained if new recursive targets are added
841 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
842 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
843 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
844 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
845 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
846 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
847 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
849 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
852 $(Verb) if ([ ! -f $(@D)/Makefile ] || \
853 command test $(@D)/Makefile -ot \
854 $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \
856 $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
858 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
861 #---------------------------------------------------------
862 # Handle the OPTIONAL_DIRS options for directores that may
864 #---------------------------------------------------------
867 SubDirs += $(OPTIONAL_DIRS)
869 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
870 $(RecursiveTargets)::
871 $(Verb) for dir in $(OPTIONAL_DIRS); do \
872 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
873 if ([ ! -f $$dir/Makefile ] || \
874 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
876 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
878 ($(MAKE) -C$$dir $@ ) || exit 1; \
882 $(RecursiveTargets)::
883 $(Verb) for dir in $(OPTIONAL_DIRS); do \
884 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
885 ($(MAKE) -C$$dir $@ ) || exit 1; \
891 #---------------------------------------------------------
892 # Handle the CONFIG_FILES options
893 #---------------------------------------------------------
898 $(Echo) Install circumvented with NO_INSTALL
900 $(Echo) UnInstall circumvented with NO_INSTALL
902 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
903 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
904 $(Verb)for file in $(CONFIG_FILES); do \
905 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
906 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
907 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
908 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
910 $(ECHO) Error: cannot find config file $${file}. ; \
915 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
916 $(Verb)for file in $(CONFIG_FILES); do \
917 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
923 ###############################################################################
924 # Set up variables for building libraries
925 ###############################################################################
927 #---------------------------------------------------------
928 # Define various command line options pertaining to the
929 # libraries needed when linking. There are "Proj" libs
930 # (defined by the user's project) and "LLVM" libs (defined
931 # by the LLVM project).
932 #---------------------------------------------------------
935 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
936 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
937 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
938 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
942 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
943 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
944 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
945 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
948 # Loadable module for Win32 requires all symbols resolved for linking.
949 # Then all symbols in LLVM.dll will be available.
950 ifeq ($(ENABLE_SHARED),1)
951 ifdef LOADABLE_MODULE
952 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
953 LINK_COMPONENTS += all
958 ifndef IS_CLEANING_TARGET
959 ifdef LINK_COMPONENTS
961 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
962 # clean in tools, then do a make in tools (instead of at the top level).
964 @echo "*** llvm-config doesn't exist - rebuilding it."
965 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
967 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
969 ifeq ($(ENABLE_SHARED), 1)
970 # We can take the "auto-import" feature to get rid of using dllimport.
971 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
972 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
975 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
976 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
979 ifndef NO_LLVM_CONFIG
980 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
981 ifeq ($(LLVMConfigLibs),Error)
982 $(error llvm-config --libs failed)
984 LLVMLibsOptions += $(LLVMConfigLibs)
985 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
986 ifeq ($(LLVMConfigLibfiles),Error)
987 $(error llvm-config --libfiles failed)
989 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
996 # Set up the library exports file.
997 ifdef EXPORTED_SYMBOL_FILE
999 # First, set up the native export file, which may differ from the source
1002 ifeq ($(HOST_OS),Darwin)
1003 # Darwin convention prefixes symbols with underscores.
1004 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1005 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1006 $(Verb) sed -e 's/^/_/' < $< > $@
1008 -$(Verb) $(RM) -f $(NativeExportsFile)
1010 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1011 # Gold and BFD ld require a version script rather than a plain list.
1012 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1013 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1014 $(Verb) echo "{" > $@
1015 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1016 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1017 ifneq ($(HOST_OS),OpenBSD)
1018 $(Verb) echo " local: *;" >> $@
1020 $(Verb) echo "};" >> $@
1022 -$(Verb) $(RM) -f $(NativeExportsFile)
1024 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1025 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1026 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1027 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1028 $(Echo) Generating $(notdir $@)
1029 $(Verb) $(ECHO) "EXPORTS" > $@
1030 $(Verb) $(CAT) $< >> $@
1032 -$(Verb) $(RM) -f $(NativeExportsFile)
1034 # Default behavior: just use the exports file verbatim.
1035 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1040 # Now add the linker command-line options to use the native export file.
1043 ifeq ($(HOST_OS),Darwin)
1044 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1047 # gold, bfd ld, etc.
1048 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1049 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1053 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1054 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1055 SharedLinkOptions += $(NativeExportsFile)
1060 ###############################################################################
1061 # Library Build Rules: Four ways to build a library
1062 ###############################################################################
1064 #---------------------------------------------------------
1065 # Bytecode Module Targets:
1066 # If the user set MODULE_NAME then they want to build a
1067 # bytecode module from the sources. We compile all the
1068 # sources and link it together into a single bytecode
1070 #---------------------------------------------------------
1073 ifeq ($(strip $(LLVMCC)),)
1074 $(warning Modules require LLVM capable compiler but none is available ****)
1077 Module := $(LibDir)/$(MODULE_NAME).bc
1078 LinkModule := $(LLVMLD) -r
1081 ifdef EXPORTED_SYMBOL_FILE
1082 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1085 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1086 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1087 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1089 all-local:: $(Module)
1092 ifneq ($(strip $(Module)),)
1093 -$(Verb) $(RM) -f $(Module)
1096 ifdef BYTECODE_DESTINATION
1097 ModuleDestDir := $(BYTECODE_DESTINATION)
1099 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1104 $(Echo) Install circumvented with NO_INSTALL
1106 $(Echo) Uninstall circumvented with NO_INSTALL
1108 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1110 install-module:: $(DestModule)
1111 install-local:: $(DestModule)
1113 $(DestModule): $(ModuleDestDir) $(Module)
1114 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1115 $(Verb) $(DataInstall) $(Module) $(DestModule)
1118 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1119 -$(Verb) $(RM) -f $(DestModule)
1125 # if we're building a library ...
1128 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1129 LIBRARYNAME := $(strip $(LIBRARYNAME))
1130 ifdef LOADABLE_MODULE
1131 BaseLibName.A := $(LIBRARYNAME).a
1132 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1134 BaseLibName.A := lib$(LIBRARYNAME).a
1135 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1137 LibName.A := $(LibDir)/$(BaseLibName.A)
1138 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1139 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1140 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1142 #---------------------------------------------------------
1143 # Shared Library Targets:
1144 # If the user asked for a shared library to be built
1145 # with the SHARED_LIBRARY variable, then we provide
1146 # targets for building them.
1147 #---------------------------------------------------------
1148 ifdef SHARED_LIBRARY
1150 all-local:: $(LibName.SO)
1152 ifdef EXPORTED_SYMBOL_FILE
1153 $(LibName.SO): $(NativeExportsFile)
1156 ifdef LINK_LIBS_IN_SHARED
1157 ifdef LOADABLE_MODULE
1158 SharedLibKindMessage := "Loadable Module"
1159 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1161 SharedLibKindMessage := "Shared Library"
1163 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1164 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1166 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1167 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1169 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1170 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1171 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1175 ifneq ($(strip $(LibName.SO)),)
1176 -$(Verb) $(RM) -f $(LibName.SO)
1181 $(Echo) Install circumvented with NO_INSTALL
1183 $(Echo) Uninstall circumvented with NO_INSTALL
1186 # Win32.DLL prefers to be located on the "PATH" of binaries.
1187 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1188 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1190 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1192 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1194 install-local:: $(DestSharedLib)
1196 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1197 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1198 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1201 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1202 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1206 #---------------------------------------------------------
1207 # Bytecode Library Targets:
1208 # If the user asked for a bytecode library to be built
1209 # with the BYTECODE_LIBRARY variable, then we provide
1210 # targets for building them.
1211 #---------------------------------------------------------
1212 ifdef BYTECODE_LIBRARY
1213 ifeq ($(strip $(LLVMCC)),)
1214 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1217 all-local:: $(LibName.BCA)
1219 ifdef EXPORTED_SYMBOL_FILE
1220 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1222 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1223 $(LLVMToolDir)/llvm-ar
1224 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1226 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1228 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1230 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1231 $(LLVMToolDir)/llvm-ar
1232 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1234 $(Verb) $(LArchive) $@ $(ObjectsBC)
1239 ifneq ($(strip $(LibName.BCA)),)
1240 -$(Verb) $(RM) -f $(LibName.BCA)
1243 ifdef BYTECODE_DESTINATION
1244 BytecodeDestDir := $(BYTECODE_DESTINATION)
1246 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1249 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1251 install-bytecode-local:: $(DestBytecodeLib)
1255 $(Echo) Install circumvented with NO_INSTALL
1257 $(Echo) Uninstall circumvented with NO_INSTALL
1259 install-local:: $(DestBytecodeLib)
1261 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1262 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1263 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1266 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1267 -$(Verb) $(RM) -f $(DestBytecodeLib)
1272 #---------------------------------------------------------
1274 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1275 # building an archive.
1276 #---------------------------------------------------------
1277 ifndef NO_BUILD_ARCHIVE
1278 ifndef BUILD_ARCHIVE
1279 ifndef LOADABLE_MODULE
1285 #---------------------------------------------------------
1286 # Archive Library Targets:
1287 # If the user wanted a regular archive library built,
1288 # then we provide targets for building them.
1289 #---------------------------------------------------------
1292 all-local:: $(LibName.A)
1294 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1295 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1296 -$(Verb) $(RM) -f $@
1297 $(Verb) $(Archive) $@ $(ObjectsO)
1298 $(Verb) $(Ranlib) $@
1301 ifneq ($(strip $(LibName.A)),)
1302 -$(Verb) $(RM) -f $(LibName.A)
1307 $(Echo) Install circumvented with NO_INSTALL
1309 $(Echo) Uninstall circumvented with NO_INSTALL
1311 ifdef NO_INSTALL_ARCHIVES
1313 $(Echo) Install circumvented with NO_INSTALL
1315 $(Echo) Uninstall circumvented with NO_INSTALL
1317 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1319 install-local:: $(DestArchiveLib)
1321 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1322 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1323 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1324 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1327 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1328 -$(Verb) $(RM) -f $(DestArchiveLib)
1336 ###############################################################################
1337 # Tool Build Rules: Build executable tool based on TOOLNAME option
1338 ###############################################################################
1342 #---------------------------------------------------------
1343 # Set up variables for building a tool.
1344 #---------------------------------------------------------
1345 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1347 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1349 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1352 # TOOLALIAS is a name to symlink (or copy) the tool to.
1355 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1357 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1361 #---------------------------------------------------------
1363 #---------------------------------------------------------
1365 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1366 # not exporting all of the weak symbols from the binary. This reduces dyld
1367 # startup time by 4x on darwin in some cases.
1368 ifdef TOOL_NO_EXPORTS
1369 ifeq ($(HOST_OS),Darwin)
1371 # Tiger tools don't support this.
1372 ifneq ($(DARWIN_MAJVERS),4)
1373 LD.Flags += -Wl,-exported_symbol,_main
1377 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD GNU/kFreeBSD))
1378 ifneq ($(ARCH), Mips)
1379 LD.Flags += -Wl,--version-script=$(PROJ_SRC_ROOT)/autoconf/ExportMap.map
1384 #---------------------------------------------------------
1385 # Tool Order File Support
1386 #---------------------------------------------------------
1388 ifeq ($(HOST_OS),Darwin)
1389 ifdef TOOL_ORDER_FILE
1391 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1396 #---------------------------------------------------------
1397 # Tool Version Info Support
1398 #---------------------------------------------------------
1400 ifeq ($(HOST_OS),Darwin)
1401 ifdef TOOL_INFO_PLIST
1403 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1405 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1407 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1408 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1409 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1410 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1411 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1412 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1418 #---------------------------------------------------------
1419 # Provide targets for building the tools
1420 #---------------------------------------------------------
1421 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1424 ifneq ($(strip $(ToolBuildPath)),)
1425 -$(Verb) $(RM) -f $(ToolBuildPath)
1427 ifneq ($(strip $(ToolAliasBuildPath)),)
1428 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1432 $(ToolBuildPath): $(ExmplDir)/.dir
1434 $(ToolBuildPath): $(ToolDir)/.dir
1437 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1438 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1439 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1440 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1441 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1444 ifneq ($(strip $(ToolAliasBuildPath)),)
1445 $(ToolAliasBuildPath): $(ToolBuildPath)
1446 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1447 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1448 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1449 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1455 $(Echo) Install circumvented with NO_INSTALL
1457 $(Echo) Uninstall circumvented with NO_INSTALL
1459 DestTool = $(DESTDIR)$(PROJ_bindir)/$(program_prefix)$(TOOLEXENAME)
1461 install-local:: $(DestTool)
1463 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1464 $(Echo) Installing $(BuildMode) $(DestTool)
1465 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1468 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1469 -$(Verb) $(RM) -f $(DestTool)
1471 # TOOLALIAS install.
1473 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(program_prefix)$(TOOLALIAS)$(EXEEXT)
1475 install-local:: $(DestToolAlias)
1477 $(DestToolAlias): $(DestTool)
1478 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1479 $(Verb) $(RM) -f $(DestToolAlias)
1480 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1483 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1484 -$(Verb) $(RM) -f $(DestToolAlias)
1490 ###############################################################################
1491 # Object Build Rules: Build object files based on sources
1492 ###############################################################################
1494 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1495 ifeq ($(HOST_OS),HP-UX)
1496 DISABLE_AUTO_DEPENDENCIES=1
1499 # Provide rule sets for when dependency generation is enabled
1500 ifndef DISABLE_AUTO_DEPENDENCIES
1502 #---------------------------------------------------------
1503 # Create .o files in the ObjDir directory from the .cpp and .c files...
1504 #---------------------------------------------------------
1506 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1507 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1509 # If the build succeeded, move the dependency file over, otherwise
1511 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1512 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1514 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1515 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1516 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1519 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1520 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1521 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1524 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1525 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1526 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1529 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1530 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1531 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1534 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1535 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1536 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1539 #---------------------------------------------------------
1540 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1541 #---------------------------------------------------------
1543 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1544 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1546 # If the build succeeded, move the dependency file over, otherwise
1548 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1549 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1551 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1552 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1553 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1554 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1555 $(BC_DEPEND_MOVEFILE)
1557 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1558 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1559 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1560 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1561 $(BC_DEPEND_MOVEFILE)
1563 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1564 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1565 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1566 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1567 $(BC_DEPEND_MOVEFILE)
1569 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1570 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1571 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1572 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1573 $(BC_DEPEND_MOVEFILE)
1575 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1576 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1577 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1578 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1579 $(BC_DEPEND_MOVEFILE)
1581 # Provide alternate rule sets if dependencies are disabled
1584 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1585 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1586 $(Compile.CXX) $< -o $@
1588 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1589 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1590 $(Compile.CXX) $< -o $@
1592 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1593 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1594 $(Compile.CXX) $< -o $@
1596 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1597 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1598 $(Compile.C) $< -o $@
1600 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1601 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1602 $(Compile.C) $< -o $@
1604 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1605 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1606 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1608 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1609 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1610 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1612 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1613 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1614 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1616 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1617 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1618 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1620 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1621 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1622 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1627 ## Rules for building preprocessed (.i/.ii) outputs.
1628 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1629 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1630 $(Verb) $(Preprocess.CXX) $< -o $@
1632 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1633 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1634 $(Verb) $(Preprocess.CXX) $< -o $@
1636 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1637 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1638 $(Verb) $(Preprocess.CXX) $< -o $@
1640 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1641 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1642 $(Verb) $(Preprocess.C) $< -o $@
1644 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1645 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1646 $(Verb) $(Preprocess.C) $< -o $@
1649 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1650 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1651 $(Compile.CXX) $< -o $@ -S
1653 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1654 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1655 $(Compile.CXX) $< -o $@ -S
1657 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1658 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1659 $(Compile.CXX) $< -o $@ -S
1661 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1662 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1663 $(Compile.C) $< -o $@ -S
1665 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1666 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1667 $(Compile.C) $< -o $@ -S
1670 # make the C and C++ compilers strip debug info out of bytecode libraries.
1672 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1673 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1674 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1676 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1677 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1678 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1682 #---------------------------------------------------------
1683 # Provide rule to build .bc files from .ll sources,
1684 # regardless of dependencies
1685 #---------------------------------------------------------
1686 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1687 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1688 $(Verb) $(LLVMAS) $< -f -o $@
1690 ###############################################################################
1691 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1692 ###############################################################################
1695 TABLEGEN_INC_FILES_COMMON = 1
1698 ifdef TABLEGEN_INC_FILES_COMMON
1700 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1701 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1702 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1704 # INCFiles rule: All of the tblgen generated files are emitted to
1705 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1706 # us to only "touch" the real file if the contents of it change. IOW, if
1707 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1708 # dependencies of the .inc files are, unless the contents of the .inc file
1710 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1711 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1713 endif # TABLEGEN_INC_FILES_COMMON
1717 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1718 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1719 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1720 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1721 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1722 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1723 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1725 # All .inc.tmp files depend on the .td files.
1726 $(INCTMPFiles) : $(TDFiles)
1728 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1729 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1730 $(Echo) "Building $(<F) register info implementation with tblgen"
1731 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1733 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1734 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1735 $(Echo) "Building $(<F) instruction information with tblgen"
1736 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1738 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1739 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1740 $(Echo) "Building $(<F) assembly writer with tblgen"
1741 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1743 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1744 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1745 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1746 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1748 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1749 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1750 $(Echo) "Building $(<F) assembly matcher with tblgen"
1751 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1753 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1754 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1755 $(Echo) "Building $(<F) MC code emitter with tblgen"
1756 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1758 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1759 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1760 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1761 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1763 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1764 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1765 $(Echo) "Building $(<F) code emitter with tblgen"
1766 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1768 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1769 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1770 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1771 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1773 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1774 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1775 $(Echo) "Building $(<F) disassembly tables with tblgen"
1776 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1778 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1779 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1780 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1781 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1783 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1784 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1785 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1786 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1788 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1789 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1790 $(Echo) "Building $(<F) subtarget information with tblgen"
1791 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1793 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1794 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1795 $(Echo) "Building $(<F) calling convention information with tblgen"
1796 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1798 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1799 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1800 $(Echo) "Building $(<F) intrinsics information with tblgen"
1801 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1803 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1804 $(Echo) "Building $(<F) decoder tables with tblgen"
1805 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1809 -$(Verb) $(RM) -f $(INCFiles)
1813 ###############################################################################
1814 # OTHER RULES: Other rules needed
1815 ###############################################################################
1817 # To create postscript files from dot files...
1818 ifneq ($(DOT),false)
1820 $(DOT) -Tps < $< > $@
1823 $(Echo) "Cannot build $@: The program dot is not installed"
1826 # This rules ensures that header files that are removed still have a rule for
1827 # which they can be "generated." This allows make to ignore them and
1828 # reproduce the dependency lists.
1832 # Define clean-local to clean the current directory. Note that this uses a
1833 # very conservative approach ensuring that empty variables do not cause
1834 # errors or disastrous removal.
1836 ifneq ($(strip $(ObjRootDir)),)
1837 -$(Verb) $(RM) -rf $(ObjRootDir)
1839 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
1840 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1841 -$(Verb) $(RM) -f *$(SHLIBEXT)
1845 -$(Verb) $(RM) -rf Debug Release Profile
1848 ###############################################################################
1849 # DEPENDENCIES: Include the dependency files if we should
1850 ###############################################################################
1851 ifndef DISABLE_AUTO_DEPENDENCIES
1853 # If its not one of the cleaning targets
1854 ifndef IS_CLEANING_TARGET
1856 # Get the list of dependency files
1857 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1858 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1860 # Include bitcode dependency files if using bitcode libraries
1861 ifdef BYTECODE_LIBRARY
1862 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1865 -include $(DependFiles) ""
1871 ###############################################################################
1872 # CHECK: Running the test suite
1873 ###############################################################################
1876 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1877 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1878 $(EchoCmd) Running test suite ; \
1879 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1880 TESTSUITE=$(TESTSUITE) ; \
1882 $(EchoCmd) No Makefile in test directory ; \
1885 $(EchoCmd) No test directory ; \
1888 # An alias dating from when both lit and DejaGNU test runners were used.
1892 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1893 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1894 $(EchoCmd) Running test suite ; \
1895 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1897 $(EchoCmd) No Makefile in test directory ; \
1900 $(EchoCmd) No test directory ; \
1903 ###############################################################################
1904 # UNITTESTS: Running the unittests test suite
1905 ###############################################################################
1908 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1909 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1910 $(EchoCmd) Running unittests test suite ; \
1911 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1913 $(EchoCmd) No Makefile in unittests directory ; \
1916 $(EchoCmd) No unittests directory ; \
1919 ###############################################################################
1920 # DISTRIBUTION: Handle construction of a distribution tarball
1921 ###############################################################################
1923 #------------------------------------------------------------------------
1924 # Define distribution related variables
1925 #------------------------------------------------------------------------
1926 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1927 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1928 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1929 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1930 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1931 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1932 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1933 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1934 Makefile.config.in configure autoconf
1935 DistOther := $(notdir $(wildcard \
1936 $(PROJ_SRC_DIR)/*.h \
1937 $(PROJ_SRC_DIR)/*.td \
1938 $(PROJ_SRC_DIR)/*.def \
1939 $(PROJ_SRC_DIR)/*.ll \
1940 $(PROJ_SRC_DIR)/*.in))
1941 DistSubDirs := $(SubDirs)
1942 DistSources = $(Sources) $(EXTRA_DIST)
1943 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1945 #------------------------------------------------------------------------
1946 # We MUST build distribution with OBJ_DIR != SRC_DIR
1947 #------------------------------------------------------------------------
1948 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
1949 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1950 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
1954 #------------------------------------------------------------------------
1955 # Prevent attempt to run dist targets from anywhere but the top level
1956 #------------------------------------------------------------------------
1958 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1959 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
1962 #------------------------------------------------------------------------
1963 # Provide the top level targets
1964 #------------------------------------------------------------------------
1966 dist-gzip:: $(DistTarGZip)
1968 $(DistTarGZip) : $(TopDistDir)/.makedistdir
1969 $(Echo) Packing gzipped distribution tar file.
1970 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1971 $(GZIP) -c > "$(DistTarGZip)"
1973 dist-bzip2:: $(DistTarBZ2)
1975 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
1976 $(Echo) Packing bzipped distribution tar file.
1977 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1978 $(BZIP2) -c >$(DistTarBZ2)
1980 dist-zip:: $(DistZip)
1982 $(DistZip) : $(TopDistDir)/.makedistdir
1983 $(Echo) Packing zipped distribution file.
1984 $(Verb) rm -f $(DistZip)
1985 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
1987 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
1988 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
1990 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
1992 dist-check:: $(DistTarGZip)
1993 $(Echo) Checking distribution tar file.
1994 $(Verb) if test -d $(DistCheckDir) ; then \
1995 $(RM) -rf $(DistCheckDir) ; \
1997 $(Verb) $(MKDIR) $(DistCheckDir)
1998 $(Verb) cd $(DistCheckDir) && \
1999 $(MKDIR) $(DistCheckDir)/build && \
2000 $(MKDIR) $(DistCheckDir)/install && \
2001 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2003 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2004 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2007 $(MAKE) unittests && \
2008 $(MAKE) install && \
2009 $(MAKE) uninstall && \
2010 $(MAKE) dist-clean && \
2011 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2014 $(Echo) Cleaning distribution files
2015 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2020 #------------------------------------------------------------------------
2021 # Provide the recursive distdir target for building the distribution directory
2022 #------------------------------------------------------------------------
2023 distdir: $(DistDir)/.makedistdir
2024 $(DistDir)/.makedistdir: $(DistSources)
2025 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2026 if test -d "$(DistDir)" ; then \
2027 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2030 $(EchoCmd) Removing old $(DistDir) ; \
2031 $(RM) -rf $(DistDir); \
2032 $(EchoCmd) Making 'all' to verify build ; \
2033 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2035 $(Echo) Building Distribution Directory $(DistDir)
2036 $(Verb) $(MKDIR) $(DistDir)
2037 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2038 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2039 for file in $(DistFiles) ; do \
2041 $(PROJ_SRC_DIR)/*) \
2042 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2044 $(PROJ_SRC_ROOT)/*) \
2045 file=`echo "$$file" | \
2046 sed "s#^$$srcrootstrip/##"` \
2049 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2050 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2051 from_dir="$(PROJ_SRC_DIR)" ; \
2052 elif test -f "$$file" || test -d "$$file" ; then \
2055 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2056 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2057 to_dir="$(DistDir)/$$dir"; \
2058 $(MKDIR) "$$to_dir" ; \
2060 to_dir="$(DistDir)"; \
2062 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2063 if test -n "$$mid_dir" ; then \
2064 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2066 if test -d "$$from_dir/$$file"; then \
2067 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2068 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2069 cd $(PROJ_SRC_DIR) ; \
2070 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2071 ( cd $$to_dir ; $(TAR) xf - ) ; \
2072 cd $(PROJ_OBJ_DIR) ; \
2075 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2076 ( cd $$to_dir ; $(TAR) xf - ) ; \
2077 cd $(PROJ_OBJ_DIR) ; \
2079 elif test -f "$$from_dir/$$file" ; then \
2080 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2081 elif test -L "$$from_dir/$$file" ; then \
2082 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2083 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2084 $(EchoCmd) "===== WARNING: Distribution Source " \
2085 "$$from_dir/$$file Not Found!" ; \
2086 elif test "$(Verb)" != '@' ; then \
2087 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2090 $(Verb) for subdir in $(DistSubDirs) ; do \
2091 if test "$$subdir" \!= "." ; then \
2092 new_distdir="$(DistDir)/$$subdir" ; \
2093 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2094 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2095 DistDir="$$new_distdir" distdir ) || exit 1; \
2098 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2099 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2100 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2101 -name .svn \) -print` ;\
2102 $(MAKE) dist-hook ; \
2103 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2104 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2105 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2106 -o ! -type d ! -perm -444 -exec \
2107 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2108 || chmod -R a+r $(DistDir) ; \
2111 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2117 ###############################################################################
2118 # TOP LEVEL - targets only to apply at the top level directory
2119 ###############################################################################
2123 #------------------------------------------------------------------------
2124 # Install support for the project's include files:
2125 #------------------------------------------------------------------------
2128 $(Echo) Install circumvented with NO_INSTALL
2130 $(Echo) Uninstall circumvented with NO_INSTALL
2133 $(Echo) Installing include files
2134 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2135 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2136 cd $(PROJ_SRC_ROOT)/include && \
2137 for hdr in `find . -type f \
2138 '(' -name LICENSE.TXT \
2143 ')' -print | grep -v CVS | \
2144 grep -v .svn` ; do \
2145 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2146 if test \! -d "$$instdir" ; then \
2147 $(EchoCmd) Making install directory $$instdir ; \
2148 $(MKDIR) $$instdir ;\
2150 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2153 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2154 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2155 cd $(PROJ_OBJ_ROOT)/include && \
2156 for hdr in `find . -type f \
2157 '(' -name LICENSE.TXT \
2162 ')' -print | grep -v CVS | \
2163 grep -v .svn` ; do \
2164 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2165 if test \! -d "$$instdir" ; then \
2166 $(EchoCmd) Making install directory $$instdir ; \
2167 $(MKDIR) $$instdir ;\
2169 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2175 $(Echo) Uninstalling include files
2176 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2177 cd $(PROJ_SRC_ROOT)/include && \
2178 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2179 '!' '(' -name '*~' -o -name '.#*' \
2180 -o -name '*.in' ')' -print ')' | \
2181 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2182 cd $(PROJ_SRC_ROOT)/include && \
2183 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2184 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2190 @echo searching for overlength lines in files: $(Sources)
2193 egrep -n '.{81}' $(Sources) /dev/null
2196 @echo searching for tabs in files: $(Sources)
2199 egrep -n ' ' $(Sources) /dev/null
2202 @ls -l $(LibDir) | awk '\
2203 BEGIN { sum = 0; } \
2205 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2206 @ls -l $(ToolDir) | awk '\
2207 BEGIN { sum = 0; } \
2209 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2210 #------------------------------------------------------------------------
2211 # Print out the directories used for building
2212 #------------------------------------------------------------------------
2214 $(Echo) "BuildMode : " '$(BuildMode)'
2215 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2216 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2217 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2218 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2219 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2220 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2221 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2222 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2223 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2224 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2225 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2226 $(Echo) "UserTargets : " '$(UserTargets)'
2227 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2228 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2229 $(Echo) "ObjDir : " '$(ObjDir)'
2230 $(Echo) "LibDir : " '$(LibDir)'
2231 $(Echo) "ToolDir : " '$(ToolDir)'
2232 $(Echo) "ExmplDir : " '$(ExmplDir)'
2233 $(Echo) "Sources : " '$(Sources)'
2234 $(Echo) "TDFiles : " '$(TDFiles)'
2235 $(Echo) "INCFiles : " '$(INCFiles)'
2236 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2237 $(Echo) "PreConditions: " '$(PreConditions)'
2238 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2239 $(Echo) "Compile.C : " '$(Compile.C)'
2240 $(Echo) "Archive : " '$(Archive)'
2241 $(Echo) "YaccFiles : " '$(YaccFiles)'
2242 $(Echo) "LexFiles : " '$(LexFiles)'
2243 $(Echo) "Module : " '$(Module)'
2244 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2245 $(Echo) "SubDirs : " '$(SubDirs)'
2246 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2247 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2252 # General debugging rule, use 'make dbg-print-XXX' to print the
2253 # definition, value and origin of XXX.
2255 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))