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),Darwin)
212 OmitFramePointer := -fomit-frame-pointer
216 # Darwin requires -fstrict-aliasing to be explicitly enabled.
217 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
218 # with -fstrict-aliasing and ipa-type-escape radr://6756684
219 #ifeq ($(HOST_OS),Darwin)
220 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
222 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
223 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
224 LD.Flags += $(OPTIMIZE_OPTION)
226 BuildMode := $(BuildMode)+Debug
233 ifdef NO_DEBUG_SYMBOLS
234 BuildMode := Unoptimized
248 ifeq ($(ENABLE_PROFILING),1)
249 BuildMode := $(BuildMode)+Profile
250 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
251 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
252 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
256 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
257 # CXX.Flags += -fvisibility-inlines-hidden
260 ifdef ENABLE_EXPENSIVE_CHECKS
261 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
262 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
266 # IF REQUIRES_EH=1 is specified then don't disable exceptions
268 CXX.Flags += -fno-exceptions
270 # If the library requires EH, it also requires RTTI.
274 ifdef REQUIRES_FRAME_POINTER
275 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
276 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
277 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
280 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
281 ifneq ($(REQUIRES_RTTI), 1)
282 CXX.Flags += -fno-rtti
285 ifeq ($(ENABLE_COVERAGE),1)
286 BuildMode := $(BuildMode)+Coverage
287 CXX.Flags += -ftest-coverage -fprofile-arcs
288 C.Flags += -ftest-coverage -fprofile-arcs
291 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
292 # then disable assertions by defining the appropriate preprocessor symbols.
293 ifeq ($(DISABLE_ASSERTIONS),1)
294 CPP.Defines += -DNDEBUG
296 BuildMode := $(BuildMode)+Asserts
297 CPP.Defines += -D_DEBUG
300 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
301 # configured), then enable expensive checks by defining the
302 # appropriate preprocessor symbols.
303 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
304 BuildMode := $(BuildMode)+Checks
305 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
308 # LOADABLE_MODULE implies several other things so we force them to be
310 ifdef LOADABLE_MODULE
312 LINK_LIBS_IN_SHARED := 1
320 ifeq ($(ENABLE_PIC),1)
321 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
322 # Nothing. Win32 defaults to PIC and warns when given -fPIC
324 ifeq ($(HOST_OS),Darwin)
325 # Common symbols not allowed in dylib files
326 CXX.Flags += -fno-common
327 C.Flags += -fno-common
329 # Linux and others; pass -fPIC
335 ifeq ($(HOST_OS),Darwin)
336 CXX.Flags += -mdynamic-no-pic
337 C.Flags += -mdynamic-no-pic
341 # Support makefile variable to disable any kind of timestamp/non-deterministic
342 # info from being used in the build.
343 ifeq ($(ENABLE_TIMESTAMPS),1)
344 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
346 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
349 ifeq ($(HOST_OS),MingW)
351 CPP.Defines += -D__NO_CTYPE_INLINE
352 ifeq ($(LLVM_CROSS_COMPILING),1)
353 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
355 LD.Flags += -Wl,--allow-multiple-definition
360 CXX.Flags += -Woverloaded-virtual
361 CPP.BaseFlags += $(CPP.Defines)
364 # Make Floating point IEEE compliant on Alpha.
367 CPP.BaseFlags += -mieee
368 ifeq ($(ENABLE_PIC),0)
370 CPP.BaseFlags += -fPIC
373 LD.Flags += -Wl,--no-relax
376 # GNU ld/PECOFF accepts but ignores them below;
380 # FIXME: autoconf should be aware of them.
381 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
382 HAVE_LINK_VERSION_SCRIPT := 0
384 RDYNAMIC := -Wl,--export-all-symbols
387 #--------------------------------------------------------------------
388 # Directory locations
389 #--------------------------------------------------------------------
391 ifeq ($(LLVM_CROSS_COMPILING),1)
392 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
395 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
396 ObjDir := $(ObjRootDir)
397 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
398 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
399 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
400 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
401 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
402 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
404 #--------------------------------------------------------------------
405 # Locations of shared libraries
406 #--------------------------------------------------------------------
409 SharedLibDir := $(LibDir)
410 LLVMSharedLibDir := $(LLVMLibDir)
412 # Win32.DLL prefers to be located on the "PATH" of binaries.
413 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
414 SharedLibDir := $(ToolDir)
415 LLVMSharedLibDir := $(LLVMToolDir)
417 ifeq ($(HOST_OS),Cygwin)
424 #--------------------------------------------------------------------
425 # LLVM Capable Compiler
426 #--------------------------------------------------------------------
428 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
430 LLVMCXX := $(LLVMGXX)
432 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
433 ifneq ($(CLANGPATH),)
434 LLVMCC := $(CLANGPATH)
435 LLVMCXX := $(CLANGXXPATH)
437 ifeq ($(ENABLE_BUILT_CLANG),1)
438 LLVMCC := $(LLVMToolDir)/clang
439 LLVMCXX := $(LLVMToolDir)/clang++
445 #--------------------------------------------------------------------
446 # Full Paths To Compiled Tools and Utilities
447 #--------------------------------------------------------------------
448 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
451 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
454 ifeq ($(LLVM_CROSS_COMPILING),1)
455 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
457 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
460 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
462 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
465 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
468 LLI := $(LLVMToolDir)/lli$(EXEEXT)
471 LLC := $(LLVMToolDir)/llc$(EXEEXT)
474 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
477 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
480 #--------------------------------------------------------------------
481 # Adjust to user's request
482 #--------------------------------------------------------------------
484 ifeq ($(HOST_OS),Darwin)
485 DARWIN_VERSION := `sw_vers -productVersion`
486 # Strip a number like 10.4.7 to 10.4
487 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
488 # Get "4" out of 10.4 for later pieces in the makefile.
489 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
491 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
492 SharedLinkOptions := -dynamiclib
494 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
497 SharedLinkOptions=-shared
500 ifeq ($(TARGET_OS),Darwin)
502 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
507 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
508 ifneq ($(HOST_OS),Darwin)
509 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
521 # Adjust settings for verbose mode
524 AR.Flags += >/dev/null 2>/dev/null
525 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
527 ConfigureScriptFLAGS :=
530 # By default, strip symbol information from executable
532 Strip := $(PLATFORMSTRIPOPTS)
533 StripWarnMsg := "(without symbols)"
534 Install.StripFlag += -s
537 ifdef TOOL_NO_EXPORTS
540 DynamicFlag := $(RDYNAMIC)
543 # Adjust linker flags for building an executable
544 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
545 ifneq ($(HOST_OS), Darwin)
547 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
549 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
551 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
555 ifneq ($(DARWIN_MAJVERS),4)
556 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
562 #----------------------------------------------------------
563 # Options To Invoke Tools
564 #----------------------------------------------------------
566 ifdef EXTRA_LD_OPTIONS
567 LD.Flags += $(EXTRA_LD_OPTIONS)
571 CompileCommonOpts += -pedantic -Wno-long-long
573 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
575 # Enable cast-qual for C++; the workaround is to use const_cast.
576 CXX.Flags += -Wcast-qual
578 ifeq ($(HOST_OS),HP-UX)
579 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
582 # If we are building a universal binary on Mac OS/X, pass extra options. This
583 # is useful to people that want to link the LLVM libraries into their universal
586 # The following can be optionally specified:
587 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
588 # For Mac OS/X 10.4 Intel machines, the traditional one is:
589 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
590 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
591 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
594 ifndef UNIVERSAL_ARCH
595 UNIVERSAL_ARCH := i386 ppc
597 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
598 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
599 ifdef UNIVERSAL_SDK_PATH
600 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
603 # Building universal cannot compute dependencies automatically.
604 DISABLE_AUTO_DEPENDENCIES=1
606 ifeq ($(TARGET_OS),Darwin)
607 ifeq ($(ARCH),x86_64)
608 TargetCommonOpts = -m64
611 TargetCommonOpts = -m32
617 ifeq ($(HOST_OS),SunOS)
618 CPP.BaseFlags += -include llvm/Support/Solaris.h
621 ifeq ($(HOST_OS),AuroraUX)
622 CPP.BaseFlags += -include llvm/Support/Solaris.h
623 endif # !HOST_OS - AuroraUX.
625 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
626 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
627 # All -I flags should go here, so that they don't confuse llvm-config.
628 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
629 $(patsubst %,-I%/include,\
630 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
631 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
634 ifeq ($(INCLUDE_BUILD_DIR),1)
635 CPP.Flags += -I$(ObjDir)
638 # SHOW_DIAGNOSTICS support.
639 ifeq ($(SHOW_DIAGNOSTICS),1)
640 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
641 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
646 ifeq ($(BUILD_COMPONENT), 1)
647 Compile.C = $(Compile.Wrapper) \
648 $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
649 $(TargetCommonOpts) $(CompileCommonOpts) -c
650 Compile.CXX = $(Compile.Wrapper) \
651 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
653 $(TargetCommonOpts) $(CompileCommonOpts) -c
654 Preprocess.CXX= $(Compile.Wrapper) \
655 $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
656 $(CompileCommonOpts) $(CXX.Flags) -E
657 Link = $(Compile.Wrapper) \
658 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
659 $(LD.Flags) $(LDFLAGS) \
660 $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
662 Compile.C = $(Compile.Wrapper) \
663 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
664 $(TargetCommonOpts) $(CompileCommonOpts) -c
665 Compile.CXX = $(Compile.Wrapper) \
666 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
667 $(TargetCommonOpts) $(CompileCommonOpts) -c
668 Preprocess.CXX= $(Compile.Wrapper) \
669 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
670 $(CompileCommonOpts) $(CXX.Flags) -E
671 Link = $(Compile.Wrapper) \
672 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
673 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
676 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
677 $(TargetCommonOpts) $(CompileCommonOpts)
678 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
679 $(TargetCommonOpts) $(CompileCommonOpts) -E
681 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
682 $(TargetCommonOpts) $(CompileCommonOpts)
684 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
685 ScriptInstall = $(INSTALL) -m 0755
686 DataInstall = $(INSTALL) -m 0644
688 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
689 # paths. In this case, the SYSPATH function (defined in
690 # Makefile.config) transforms Unix paths into Windows paths.
691 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
692 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
693 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
694 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
695 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
697 Archive = $(AR) $(AR.Flags)
698 LArchive = $(LLVMToolDir)/llvm-ar rcsf
707 #----------------------------------------------------------
708 # Get the list of source files and compute object file
710 #----------------------------------------------------------
713 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
714 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
716 Sources := $(SOURCES)
720 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
723 BaseNameSources := $(sort $(basename $(Sources)))
725 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
726 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
728 #----------------------------------------------------------
729 # For Mingw MSYS bash and Python/w32:
731 # $(ECHOPATH) prints DOSish pathstring.
732 # ex) $(ECHOPATH) /include/sys/types.h
733 # --> C:/mingw/include/sys/types.h
734 # built-in "echo" does not transform path to DOSish path.
736 # FIXME: It would not be needed when MSYS's python
738 #----------------------------------------------------------
740 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
741 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
743 ECHOPATH := $(Verb)$(ECHO)
746 ###############################################################################
747 # DIRECTORIES: Handle recursive descent of directory structure
748 ###############################################################################
750 #---------------------------------------------------------
751 # Provide rules to make install dirs. This must be early
752 # in the file so they get built before dependencies
753 #---------------------------------------------------------
755 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
758 # To create other directories, as needed, and timestamp their creation
760 $(Verb) $(MKDIR) $* > /dev/null
761 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
763 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
764 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
766 #---------------------------------------------------------
767 # Handle the DIRS options for sequential construction
768 #---------------------------------------------------------
774 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
775 $(RecursiveTargets)::
776 $(Verb) for dir in $(DIRS); do \
777 if ([ ! -f $$dir/Makefile ] || \
778 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
780 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
782 ($(MAKE) -C $$dir $@ ) || exit 1; \
785 $(RecursiveTargets)::
786 $(Verb) for dir in $(DIRS); do \
787 ($(MAKE) -C $$dir $@ ) || exit 1; \
793 #---------------------------------------------------------
794 # Handle the EXPERIMENTAL_DIRS options ensuring success
795 # after each directory is built.
796 #---------------------------------------------------------
797 ifdef EXPERIMENTAL_DIRS
798 $(RecursiveTargets)::
799 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
800 if ([ ! -f $$dir/Makefile ] || \
801 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
803 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
805 ($(MAKE) -C $$dir $@ ) || exit 0; \
809 #-----------------------------------------------------------
810 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
811 #-----------------------------------------------------------
812 ifdef OPTIONAL_PARALLEL_DIRS
813 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
816 #-----------------------------------------------------------
817 # Handle the PARALLEL_DIRS options for parallel construction
818 #-----------------------------------------------------------
821 SubDirs += $(PARALLEL_DIRS)
823 # Unfortunately, this list must be maintained if new recursive targets are added
824 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
825 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
826 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
827 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
828 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
829 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
830 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
832 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
836 SD=$(PROJ_SRC_DIR)/$(@D); \
838 if [ ! -f $$SD/Makefile ]; then \
840 DD=$(notdir $(@D)); \
842 if ([ ! -f $$DD/Makefile ] || \
843 command test $$DD/Makefile -ot \
844 $$SD/Makefile ); then \
846 $(CP) $$SD/Makefile $$DD/Makefile; \
848 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
851 #---------------------------------------------------------
852 # Handle the OPTIONAL_DIRS options for directores that may
854 #---------------------------------------------------------
857 SubDirs += $(OPTIONAL_DIRS)
859 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
860 $(RecursiveTargets)::
861 $(Verb) for dir in $(OPTIONAL_DIRS); do \
862 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
863 if ([ ! -f $$dir/Makefile ] || \
864 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
866 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
868 ($(MAKE) -C$$dir $@ ) || exit 1; \
872 $(RecursiveTargets)::
873 $(Verb) for dir in $(OPTIONAL_DIRS); do \
874 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
875 ($(MAKE) -C$$dir $@ ) || exit 1; \
881 #---------------------------------------------------------
882 # Handle the CONFIG_FILES options
883 #---------------------------------------------------------
888 $(Echo) Install circumvented with NO_INSTALL
890 $(Echo) UnInstall circumvented with NO_INSTALL
892 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
893 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
894 $(Verb)for file in $(CONFIG_FILES); do \
895 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
896 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
897 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
898 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
900 $(ECHO) Error: cannot find config file $${file}. ; \
905 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
906 $(Verb)for file in $(CONFIG_FILES); do \
907 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
913 ###############################################################################
914 # Set up variables for building libraries
915 ###############################################################################
917 #---------------------------------------------------------
918 # Define various command line options pertaining to the
919 # libraries needed when linking. There are "Proj" libs
920 # (defined by the user's project) and "LLVM" libs (defined
921 # by the LLVM project).
922 #---------------------------------------------------------
925 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
926 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
927 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
928 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
932 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
933 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
934 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
935 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
938 # Loadable module for Win32 requires all symbols resolved for linking.
939 # Then all symbols in LLVM.dll will be available.
940 ifeq ($(ENABLE_SHARED),1)
941 ifdef LOADABLE_MODULE
942 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
943 LINK_COMPONENTS += all
948 ifndef IS_CLEANING_TARGET
949 ifdef LINK_COMPONENTS
951 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
952 # clean in tools, then do a make in tools (instead of at the top level).
954 @echo "*** llvm-config doesn't exist - rebuilding it."
955 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
957 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
959 ifeq ($(ENABLE_SHARED), 1)
960 # We can take the "auto-import" feature to get rid of using dllimport.
961 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
962 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
965 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
966 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
969 ifndef NO_LLVM_CONFIG
970 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
971 ifeq ($(LLVMConfigLibs),Error)
972 $(error llvm-config --libs failed)
974 LLVMLibsOptions += $(LLVMConfigLibs)
975 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
976 ifeq ($(LLVMConfigLibfiles),Error)
977 $(error llvm-config --libfiles failed)
979 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
986 # Set up the library exports file.
987 ifdef EXPORTED_SYMBOL_FILE
989 # First, set up the native export file, which may differ from the source
992 ifeq ($(HOST_OS),Darwin)
993 # Darwin convention prefixes symbols with underscores.
994 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
995 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
996 $(Verb) sed -e 's/^/_/' < $< > $@
998 -$(Verb) $(RM) -f $(NativeExportsFile)
1000 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1001 # Gold and BFD ld require a version script rather than a plain list.
1002 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1003 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1004 $(Verb) echo "{" > $@
1005 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1006 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1007 ifneq ($(HOST_OS),OpenBSD)
1008 $(Verb) echo " local: *;" >> $@
1010 $(Verb) echo "};" >> $@
1012 -$(Verb) $(RM) -f $(NativeExportsFile)
1014 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1015 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1016 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1017 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1018 $(Echo) Generating $(notdir $@)
1019 $(Verb) $(ECHO) "EXPORTS" > $@
1020 $(Verb) $(CAT) $< >> $@
1022 -$(Verb) $(RM) -f $(NativeExportsFile)
1024 # Default behavior: just use the exports file verbatim.
1025 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1030 # Now add the linker command-line options to use the native export file.
1033 ifeq ($(HOST_OS),Darwin)
1034 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1037 # gold, bfd ld, etc.
1038 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1039 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1043 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1044 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1045 SharedLinkOptions += $(NativeExportsFile)
1050 ###############################################################################
1051 # Library Build Rules: Four ways to build a library
1052 ###############################################################################
1054 #---------------------------------------------------------
1055 # Bytecode Module Targets:
1056 # If the user set MODULE_NAME then they want to build a
1057 # bytecode module from the sources. We compile all the
1058 # sources and link it together into a single bytecode
1060 #---------------------------------------------------------
1063 ifeq ($(strip $(LLVMCC)),)
1064 $(warning Modules require LLVM capable compiler but none is available ****)
1067 Module := $(LibDir)/$(MODULE_NAME).bc
1068 LinkModule := $(LLVMLD) -r
1071 ifdef EXPORTED_SYMBOL_FILE
1072 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1075 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1076 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1077 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1079 all-local:: $(Module)
1082 ifneq ($(strip $(Module)),)
1083 -$(Verb) $(RM) -f $(Module)
1086 ifdef BYTECODE_DESTINATION
1087 ModuleDestDir := $(BYTECODE_DESTINATION)
1089 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1094 $(Echo) Install circumvented with NO_INSTALL
1096 $(Echo) Uninstall circumvented with NO_INSTALL
1098 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1100 install-module:: $(DestModule)
1101 install-local:: $(DestModule)
1103 $(DestModule): $(ModuleDestDir) $(Module)
1104 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1105 $(Verb) $(DataInstall) $(Module) $(DestModule)
1108 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1109 -$(Verb) $(RM) -f $(DestModule)
1115 # if we're building a library ...
1118 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1119 LIBRARYNAME := $(strip $(LIBRARYNAME))
1120 ifdef LOADABLE_MODULE
1121 BaseLibName.A := $(LIBRARYNAME).a
1122 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1124 BaseLibName.A := lib$(LIBRARYNAME).a
1125 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1127 LibName.A := $(LibDir)/$(BaseLibName.A)
1128 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1129 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1130 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1132 #---------------------------------------------------------
1133 # Shared Library Targets:
1134 # If the user asked for a shared library to be built
1135 # with the SHARED_LIBRARY variable, then we provide
1136 # targets for building them.
1137 #---------------------------------------------------------
1138 ifdef SHARED_LIBRARY
1140 all-local:: $(LibName.SO)
1142 ifdef EXPORTED_SYMBOL_FILE
1143 $(LibName.SO): $(NativeExportsFile)
1146 ifdef LINK_LIBS_IN_SHARED
1147 ifdef LOADABLE_MODULE
1148 SharedLibKindMessage := "Loadable Module"
1149 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1151 SharedLibKindMessage := "Shared Library"
1153 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1154 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1156 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1157 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1159 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1160 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1161 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1165 ifneq ($(strip $(LibName.SO)),)
1166 -$(Verb) $(RM) -f $(LibName.SO)
1171 $(Echo) Install circumvented with NO_INSTALL
1173 $(Echo) Uninstall circumvented with NO_INSTALL
1176 # Win32.DLL prefers to be located on the "PATH" of binaries.
1177 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1178 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1180 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1182 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1184 install-local:: $(DestSharedLib)
1186 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1187 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1188 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1191 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1192 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1196 #---------------------------------------------------------
1197 # Bytecode Library Targets:
1198 # If the user asked for a bytecode library to be built
1199 # with the BYTECODE_LIBRARY variable, then we provide
1200 # targets for building them.
1201 #---------------------------------------------------------
1202 ifdef BYTECODE_LIBRARY
1203 ifeq ($(strip $(LLVMCC)),)
1204 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1207 all-local:: $(LibName.BCA)
1209 ifdef EXPORTED_SYMBOL_FILE
1210 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1212 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1213 $(LLVMToolDir)/llvm-ar
1214 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1216 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1218 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1220 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1221 $(LLVMToolDir)/llvm-ar
1222 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1224 $(Verb) $(LArchive) $@ $(ObjectsBC)
1229 ifneq ($(strip $(LibName.BCA)),)
1230 -$(Verb) $(RM) -f $(LibName.BCA)
1233 ifdef BYTECODE_DESTINATION
1234 BytecodeDestDir := $(BYTECODE_DESTINATION)
1236 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1239 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1241 install-bytecode-local:: $(DestBytecodeLib)
1245 $(Echo) Install circumvented with NO_INSTALL
1247 $(Echo) Uninstall circumvented with NO_INSTALL
1249 install-local:: $(DestBytecodeLib)
1251 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1252 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1253 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1256 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1257 -$(Verb) $(RM) -f $(DestBytecodeLib)
1262 #---------------------------------------------------------
1264 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1265 # building an archive.
1266 #---------------------------------------------------------
1267 ifndef NO_BUILD_ARCHIVE
1268 ifndef BUILD_ARCHIVE
1269 ifndef LOADABLE_MODULE
1275 #---------------------------------------------------------
1276 # Archive Library Targets:
1277 # If the user wanted a regular archive library built,
1278 # then we provide targets for building them.
1279 #---------------------------------------------------------
1282 all-local:: $(LibName.A)
1284 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1285 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1286 -$(Verb) $(RM) -f $@
1287 $(Verb) $(Archive) $@ $(ObjectsO)
1288 $(Verb) $(Ranlib) $@
1291 ifneq ($(strip $(LibName.A)),)
1292 -$(Verb) $(RM) -f $(LibName.A)
1297 $(Echo) Install circumvented with NO_INSTALL
1299 $(Echo) Uninstall circumvented with NO_INSTALL
1301 ifdef NO_INSTALL_ARCHIVES
1303 $(Echo) Install circumvented with NO_INSTALL
1305 $(Echo) Uninstall circumvented with NO_INSTALL
1307 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1309 install-local:: $(DestArchiveLib)
1311 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1312 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1313 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1314 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1317 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1318 -$(Verb) $(RM) -f $(DestArchiveLib)
1326 ###############################################################################
1327 # Tool Build Rules: Build executable tool based on TOOLNAME option
1328 ###############################################################################
1332 #---------------------------------------------------------
1333 # Set up variables for building a tool.
1334 #---------------------------------------------------------
1335 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1337 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1339 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1342 # TOOLALIAS is a name to symlink (or copy) the tool to.
1345 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1347 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1351 #---------------------------------------------------------
1353 #---------------------------------------------------------
1355 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1356 # not exporting all of the weak symbols from the binary. This reduces dyld
1357 # startup time by 4x on darwin in some cases.
1358 ifdef TOOL_NO_EXPORTS
1359 ifeq ($(HOST_OS),Darwin)
1361 # Tiger tools don't support this.
1362 ifneq ($(DARWIN_MAJVERS),4)
1363 LD.Flags += -Wl,-exported_symbol,_main
1367 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1368 ifneq ($(ARCH), Mips)
1369 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1374 #---------------------------------------------------------
1375 # Tool Order File Support
1376 #---------------------------------------------------------
1378 ifeq ($(HOST_OS),Darwin)
1379 ifdef TOOL_ORDER_FILE
1381 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1386 #---------------------------------------------------------
1387 # Tool Version Info Support
1388 #---------------------------------------------------------
1390 ifeq ($(HOST_OS),Darwin)
1391 ifdef TOOL_INFO_PLIST
1393 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1395 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1397 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1398 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1399 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1400 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1401 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1402 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1408 #---------------------------------------------------------
1409 # Provide targets for building the tools
1410 #---------------------------------------------------------
1411 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1414 ifneq ($(strip $(ToolBuildPath)),)
1415 -$(Verb) $(RM) -f $(ToolBuildPath)
1417 ifneq ($(strip $(ToolAliasBuildPath)),)
1418 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1422 $(ToolBuildPath): $(ExmplDir)/.dir
1424 $(ToolBuildPath): $(ToolDir)/.dir
1427 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1428 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1429 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1430 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1431 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1434 ifneq ($(strip $(ToolAliasBuildPath)),)
1435 $(ToolAliasBuildPath): $(ToolBuildPath)
1436 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1437 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1438 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1439 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1445 $(Echo) Install circumvented with NO_INSTALL
1447 $(Echo) Uninstall circumvented with NO_INSTALL
1449 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1451 install-local:: $(DestTool)
1453 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1454 $(Echo) Installing $(BuildMode) $(DestTool)
1455 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1458 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1459 -$(Verb) $(RM) -f $(DestTool)
1461 # TOOLALIAS install.
1463 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1465 install-local:: $(DestToolAlias)
1467 $(DestToolAlias): $(DestTool)
1468 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1469 $(Verb) $(RM) -f $(DestToolAlias)
1470 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1473 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1474 -$(Verb) $(RM) -f $(DestToolAlias)
1480 ###############################################################################
1481 # Object Build Rules: Build object files based on sources
1482 ###############################################################################
1484 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1485 ifeq ($(HOST_OS),HP-UX)
1486 DISABLE_AUTO_DEPENDENCIES=1
1489 # Provide rule sets for when dependency generation is enabled
1490 ifndef DISABLE_AUTO_DEPENDENCIES
1492 #---------------------------------------------------------
1493 # Create .o files in the ObjDir directory from the .cpp and .c files...
1494 #---------------------------------------------------------
1496 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1497 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1499 # If the build succeeded, move the dependency file over, otherwise
1501 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1502 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1504 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1505 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1506 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1509 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1510 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1511 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1514 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1515 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1516 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1519 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1520 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1521 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1524 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1525 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1526 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1529 #---------------------------------------------------------
1530 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1531 #---------------------------------------------------------
1533 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1534 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1536 # If the build succeeded, move the dependency file over, otherwise
1538 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1539 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1541 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1542 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1543 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1544 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1545 $(BC_DEPEND_MOVEFILE)
1547 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1548 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1549 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1550 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1551 $(BC_DEPEND_MOVEFILE)
1553 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1554 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1555 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1556 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1557 $(BC_DEPEND_MOVEFILE)
1559 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1560 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1561 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1562 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1563 $(BC_DEPEND_MOVEFILE)
1565 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1566 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1567 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1568 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1569 $(BC_DEPEND_MOVEFILE)
1571 # Provide alternate rule sets if dependencies are disabled
1574 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1575 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1576 $(Compile.CXX) $< -o $@
1578 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1579 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1580 $(Compile.CXX) $< -o $@
1582 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1583 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1584 $(Compile.CXX) $< -o $@
1586 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1587 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1588 $(Compile.C) $< -o $@
1590 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1591 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1592 $(Compile.C) $< -o $@
1594 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1595 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1596 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1598 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1599 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1600 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1602 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1603 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1604 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1606 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1607 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1608 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1610 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1611 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1612 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1617 ## Rules for building preprocessed (.i/.ii) outputs.
1618 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1619 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1620 $(Verb) $(Preprocess.CXX) $< -o $@
1622 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1623 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1624 $(Verb) $(Preprocess.CXX) $< -o $@
1626 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1627 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1628 $(Verb) $(Preprocess.CXX) $< -o $@
1630 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1631 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1632 $(Verb) $(Preprocess.C) $< -o $@
1634 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1635 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1636 $(Verb) $(Preprocess.C) $< -o $@
1639 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1640 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1641 $(Compile.CXX) $< -o $@ -S
1643 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1644 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1645 $(Compile.CXX) $< -o $@ -S
1647 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1648 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1649 $(Compile.CXX) $< -o $@ -S
1651 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1652 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1653 $(Compile.C) $< -o $@ -S
1655 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1656 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1657 $(Compile.C) $< -o $@ -S
1660 # make the C and C++ compilers strip debug info out of bytecode libraries.
1662 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1663 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1664 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1666 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1667 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1668 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1672 #---------------------------------------------------------
1673 # Provide rule to build .bc files from .ll sources,
1674 # regardless of dependencies
1675 #---------------------------------------------------------
1676 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1677 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1678 $(Verb) $(LLVMAS) $< -f -o $@
1680 ###############################################################################
1681 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1682 ###############################################################################
1685 TABLEGEN_INC_FILES_COMMON = 1
1688 ifdef TABLEGEN_INC_FILES_COMMON
1690 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1691 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1692 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1694 # INCFiles rule: All of the tblgen generated files are emitted to
1695 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1696 # us to only "touch" the real file if the contents of it change. IOW, if
1697 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1698 # dependencies of the .inc files are, unless the contents of the .inc file
1700 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1701 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1703 endif # TABLEGEN_INC_FILES_COMMON
1707 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1708 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1709 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1710 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1711 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1712 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1713 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1715 # All .inc.tmp files depend on the .td files.
1716 $(INCTMPFiles) : $(TDFiles)
1718 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1719 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1720 $(Echo) "Building $(<F) register info implementation with tblgen"
1721 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1723 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1724 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1725 $(Echo) "Building $(<F) instruction information with tblgen"
1726 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1728 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1729 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1730 $(Echo) "Building $(<F) assembly writer with tblgen"
1731 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1733 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1734 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1735 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1736 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1738 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1739 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1740 $(Echo) "Building $(<F) assembly matcher with tblgen"
1741 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1743 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1744 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1745 $(Echo) "Building $(<F) MC code emitter with tblgen"
1746 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1748 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1749 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1750 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1751 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1753 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1754 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1755 $(Echo) "Building $(<F) code emitter with tblgen"
1756 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1758 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1759 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1760 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1761 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1763 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1764 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1765 $(Echo) "Building $(<F) disassembly tables with tblgen"
1766 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1768 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1769 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1770 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1771 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1773 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1774 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1775 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1776 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1778 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1779 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1780 $(Echo) "Building $(<F) subtarget information with tblgen"
1781 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1783 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1784 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1785 $(Echo) "Building $(<F) calling convention information with tblgen"
1786 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1788 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1789 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1790 $(Echo) "Building $(<F) intrinsics information with tblgen"
1791 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1793 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1794 $(Echo) "Building $(<F) decoder tables with tblgen"
1795 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1799 -$(Verb) $(RM) -f $(INCFiles)
1803 ###############################################################################
1804 # OTHER RULES: Other rules needed
1805 ###############################################################################
1807 # To create postscript files from dot files...
1808 ifneq ($(DOT),false)
1810 $(DOT) -Tps < $< > $@
1813 $(Echo) "Cannot build $@: The program dot is not installed"
1816 # This rules ensures that header files that are removed still have a rule for
1817 # which they can be "generated." This allows make to ignore them and
1818 # reproduce the dependency lists.
1822 # Define clean-local to clean the current directory. Note that this uses a
1823 # very conservative approach ensuring that empty variables do not cause
1824 # errors or disastrous removal.
1826 ifneq ($(strip $(ObjRootDir)),)
1827 -$(Verb) $(RM) -rf $(ObjRootDir)
1829 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
1830 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1831 -$(Verb) $(RM) -f *$(SHLIBEXT)
1835 -$(Verb) $(RM) -rf Debug Release Profile
1838 ###############################################################################
1839 # DEPENDENCIES: Include the dependency files if we should
1840 ###############################################################################
1841 ifndef DISABLE_AUTO_DEPENDENCIES
1843 # If its not one of the cleaning targets
1844 ifndef IS_CLEANING_TARGET
1846 # Get the list of dependency files
1847 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1848 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1850 # Include bitcode dependency files if using bitcode libraries
1851 ifdef BYTECODE_LIBRARY
1852 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1855 -include $(DependFiles) ""
1861 ###############################################################################
1862 # CHECK: Running the test suite
1863 ###############################################################################
1866 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1867 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1868 $(EchoCmd) Running test suite ; \
1869 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1870 TESTSUITE=$(TESTSUITE) ; \
1872 $(EchoCmd) No Makefile in test directory ; \
1875 $(EchoCmd) No test directory ; \
1881 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1882 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1883 $(EchoCmd) Running test suite ; \
1884 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1886 $(EchoCmd) No Makefile in test directory ; \
1889 $(EchoCmd) No test directory ; \
1893 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1894 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1895 $(EchoCmd) Running test suite ; \
1896 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1898 $(EchoCmd) No Makefile in test directory ; \
1901 $(EchoCmd) No test directory ; \
1904 ###############################################################################
1905 # UNITTESTS: Running the unittests test suite
1906 ###############################################################################
1909 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1910 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1911 $(EchoCmd) Running unittests test suite ; \
1912 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1914 $(EchoCmd) No Makefile in unittests directory ; \
1917 $(EchoCmd) No unittests directory ; \
1920 ###############################################################################
1921 # DISTRIBUTION: Handle construction of a distribution tarball
1922 ###############################################################################
1924 #------------------------------------------------------------------------
1925 # Define distribution related variables
1926 #------------------------------------------------------------------------
1927 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1928 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1929 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1930 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1931 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1932 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1933 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1934 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1935 Makefile.config.in configure autoconf
1936 DistOther := $(notdir $(wildcard \
1937 $(PROJ_SRC_DIR)/*.h \
1938 $(PROJ_SRC_DIR)/*.td \
1939 $(PROJ_SRC_DIR)/*.def \
1940 $(PROJ_SRC_DIR)/*.ll \
1941 $(PROJ_SRC_DIR)/*.in))
1942 DistSubDirs := $(SubDirs)
1943 DistSources = $(Sources) $(EXTRA_DIST)
1944 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1946 #------------------------------------------------------------------------
1947 # We MUST build distribution with OBJ_DIR != SRC_DIR
1948 #------------------------------------------------------------------------
1949 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
1950 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1951 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
1955 #------------------------------------------------------------------------
1956 # Prevent attempt to run dist targets from anywhere but the top level
1957 #------------------------------------------------------------------------
1959 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1960 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
1963 #------------------------------------------------------------------------
1964 # Provide the top level targets
1965 #------------------------------------------------------------------------
1967 dist-gzip:: $(DistTarGZip)
1969 $(DistTarGZip) : $(TopDistDir)/.makedistdir
1970 $(Echo) Packing gzipped distribution tar file.
1971 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1972 $(GZIP) -c > "$(DistTarGZip)"
1974 dist-bzip2:: $(DistTarBZ2)
1976 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
1977 $(Echo) Packing bzipped distribution tar file.
1978 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1979 $(BZIP2) -c >$(DistTarBZ2)
1981 dist-zip:: $(DistZip)
1983 $(DistZip) : $(TopDistDir)/.makedistdir
1984 $(Echo) Packing zipped distribution file.
1985 $(Verb) rm -f $(DistZip)
1986 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
1988 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
1989 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
1991 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
1993 dist-check:: $(DistTarGZip)
1994 $(Echo) Checking distribution tar file.
1995 $(Verb) if test -d $(DistCheckDir) ; then \
1996 $(RM) -rf $(DistCheckDir) ; \
1998 $(Verb) $(MKDIR) $(DistCheckDir)
1999 $(Verb) cd $(DistCheckDir) && \
2000 $(MKDIR) $(DistCheckDir)/build && \
2001 $(MKDIR) $(DistCheckDir)/install && \
2002 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2004 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2005 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2008 $(MAKE) unittests && \
2009 $(MAKE) install && \
2010 $(MAKE) uninstall && \
2011 $(MAKE) dist-clean && \
2012 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2015 $(Echo) Cleaning distribution files
2016 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2021 #------------------------------------------------------------------------
2022 # Provide the recursive distdir target for building the distribution directory
2023 #------------------------------------------------------------------------
2024 distdir: $(DistDir)/.makedistdir
2025 $(DistDir)/.makedistdir: $(DistSources)
2026 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2027 if test -d "$(DistDir)" ; then \
2028 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2031 $(EchoCmd) Removing old $(DistDir) ; \
2032 $(RM) -rf $(DistDir); \
2033 $(EchoCmd) Making 'all' to verify build ; \
2034 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2036 $(Echo) Building Distribution Directory $(DistDir)
2037 $(Verb) $(MKDIR) $(DistDir)
2038 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2039 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2040 for file in $(DistFiles) ; do \
2042 $(PROJ_SRC_DIR)/*) \
2043 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2045 $(PROJ_SRC_ROOT)/*) \
2046 file=`echo "$$file" | \
2047 sed "s#^$$srcrootstrip/##"` \
2050 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2051 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2052 from_dir="$(PROJ_SRC_DIR)" ; \
2053 elif test -f "$$file" || test -d "$$file" ; then \
2056 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2057 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2058 to_dir="$(DistDir)/$$dir"; \
2059 $(MKDIR) "$$to_dir" ; \
2061 to_dir="$(DistDir)"; \
2063 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2064 if test -n "$$mid_dir" ; then \
2065 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2067 if test -d "$$from_dir/$$file"; then \
2068 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2069 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2070 cd $(PROJ_SRC_DIR) ; \
2071 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2072 ( cd $$to_dir ; $(TAR) xf - ) ; \
2073 cd $(PROJ_OBJ_DIR) ; \
2076 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2077 ( cd $$to_dir ; $(TAR) xf - ) ; \
2078 cd $(PROJ_OBJ_DIR) ; \
2080 elif test -f "$$from_dir/$$file" ; then \
2081 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2082 elif test -L "$$from_dir/$$file" ; then \
2083 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2084 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2085 $(EchoCmd) "===== WARNING: Distribution Source " \
2086 "$$from_dir/$$file Not Found!" ; \
2087 elif test "$(Verb)" != '@' ; then \
2088 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2091 $(Verb) for subdir in $(DistSubDirs) ; do \
2092 if test "$$subdir" \!= "." ; then \
2093 new_distdir="$(DistDir)/$$subdir" ; \
2094 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2095 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2096 DistDir="$$new_distdir" distdir ) || exit 1; \
2099 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2100 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2101 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2102 -name .svn \) -print` ;\
2103 $(MAKE) dist-hook ; \
2104 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2105 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2106 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2107 -o ! -type d ! -perm -444 -exec \
2108 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2109 || chmod -R a+r $(DistDir) ; \
2112 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2118 ###############################################################################
2119 # TOP LEVEL - targets only to apply at the top level directory
2120 ###############################################################################
2124 #------------------------------------------------------------------------
2125 # Install support for the project's include files:
2126 #------------------------------------------------------------------------
2129 $(Echo) Install circumvented with NO_INSTALL
2131 $(Echo) Uninstall circumvented with NO_INSTALL
2134 $(Echo) Installing include files
2135 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2136 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2137 cd $(PROJ_SRC_ROOT)/include && \
2138 for hdr in `find . -type f \
2139 '(' -name LICENSE.TXT \
2144 ')' -print | grep -v CVS | \
2145 grep -v .svn` ; do \
2146 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2147 if test \! -d "$$instdir" ; then \
2148 $(EchoCmd) Making install directory $$instdir ; \
2149 $(MKDIR) $$instdir ;\
2151 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2154 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2155 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2156 cd $(PROJ_OBJ_ROOT)/include && \
2157 for hdr in `find . -type f \
2158 '(' -name LICENSE.TXT \
2163 ')' -print | grep -v CVS | \
2164 grep -v .svn` ; do \
2165 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2166 if test \! -d "$$instdir" ; then \
2167 $(EchoCmd) Making install directory $$instdir ; \
2168 $(MKDIR) $$instdir ;\
2170 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2176 $(Echo) Uninstalling include files
2177 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2178 cd $(PROJ_SRC_ROOT)/include && \
2179 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2180 '!' '(' -name '*~' -o -name '.#*' \
2181 -o -name '*.in' ')' -print ')' | \
2182 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2183 cd $(PROJ_SRC_ROOT)/include && \
2184 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2185 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2191 @echo searching for overlength lines in files: $(Sources)
2194 egrep -n '.{81}' $(Sources) /dev/null
2197 @echo searching for tabs in files: $(Sources)
2200 egrep -n ' ' $(Sources) /dev/null
2203 @ls -l $(LibDir) | awk '\
2204 BEGIN { sum = 0; } \
2206 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2207 @ls -l $(ToolDir) | awk '\
2208 BEGIN { sum = 0; } \
2210 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2211 #------------------------------------------------------------------------
2212 # Print out the directories used for building
2213 #------------------------------------------------------------------------
2215 $(Echo) "BuildMode : " '$(BuildMode)'
2216 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2217 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2218 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2219 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2220 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2221 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2222 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2223 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2224 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2225 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2226 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2227 $(Echo) "UserTargets : " '$(UserTargets)'
2228 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2229 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2230 $(Echo) "ObjDir : " '$(ObjDir)'
2231 $(Echo) "LibDir : " '$(LibDir)'
2232 $(Echo) "ToolDir : " '$(ToolDir)'
2233 $(Echo) "ExmplDir : " '$(ExmplDir)'
2234 $(Echo) "Sources : " '$(Sources)'
2235 $(Echo) "TDFiles : " '$(TDFiles)'
2236 $(Echo) "INCFiles : " '$(INCFiles)'
2237 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2238 $(Echo) "PreConditions: " '$(PreConditions)'
2239 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2240 $(Echo) "Compile.C : " '$(Compile.C)'
2241 $(Echo) "Archive : " '$(Archive)'
2242 $(Echo) "YaccFiles : " '$(YaccFiles)'
2243 $(Echo) "LexFiles : " '$(LexFiles)'
2244 $(Echo) "Module : " '$(Module)'
2245 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2246 $(Echo) "SubDirs : " '$(SubDirs)'
2247 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2248 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2253 # General debugging rule, use 'make dbg-print-XXX' to print the
2254 # definition, value and origin of XXX.
2256 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))