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_LIBCPP),1)
249 CXX.Flags += -stdlib=libc++
250 LD.Flags += -stdlib=libc++
253 ifeq ($(ENABLE_PROFILING),1)
254 BuildMode := $(BuildMode)+Profile
255 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
256 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
257 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
261 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
262 # CXX.Flags += -fvisibility-inlines-hidden
265 ifdef ENABLE_EXPENSIVE_CHECKS
266 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
267 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
271 # IF REQUIRES_EH=1 is specified then don't disable exceptions
273 CXX.Flags += -fno-exceptions
275 # If the library requires EH, it also requires RTTI.
279 ifdef REQUIRES_FRAME_POINTER
280 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
281 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
282 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
285 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
286 ifneq ($(REQUIRES_RTTI), 1)
287 CXX.Flags += -fno-rtti
290 ifeq ($(ENABLE_COVERAGE),1)
291 BuildMode := $(BuildMode)+Coverage
292 CXX.Flags += -ftest-coverage -fprofile-arcs
293 C.Flags += -ftest-coverage -fprofile-arcs
296 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
297 # then disable assertions by defining the appropriate preprocessor symbols.
298 ifeq ($(DISABLE_ASSERTIONS),1)
299 CPP.Defines += -DNDEBUG
301 BuildMode := $(BuildMode)+Asserts
302 CPP.Defines += -D_DEBUG
305 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
306 # configured), then enable expensive checks by defining the
307 # appropriate preprocessor symbols.
308 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
309 BuildMode := $(BuildMode)+Checks
310 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
313 # LOADABLE_MODULE implies several other things so we force them to be
315 ifdef LOADABLE_MODULE
317 LINK_LIBS_IN_SHARED := 1
325 ifeq ($(ENABLE_PIC),1)
326 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
327 # Nothing. Win32 defaults to PIC and warns when given -fPIC
329 ifeq ($(HOST_OS),Darwin)
330 # Common symbols not allowed in dylib files
331 CXX.Flags += -fno-common
332 C.Flags += -fno-common
334 # Linux and others; pass -fPIC
340 ifeq ($(HOST_OS),Darwin)
341 CXX.Flags += -mdynamic-no-pic
342 C.Flags += -mdynamic-no-pic
346 # Support makefile variable to disable any kind of timestamp/non-deterministic
347 # info from being used in the build.
348 ifeq ($(ENABLE_TIMESTAMPS),1)
349 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
351 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
354 ifeq ($(HOST_OS),MingW)
356 CPP.Defines += -D__NO_CTYPE_INLINE
357 ifeq ($(LLVM_CROSS_COMPILING),1)
358 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
360 LD.Flags += -Wl,--allow-multiple-definition
365 CXX.Flags += -Woverloaded-virtual
366 CPP.BaseFlags += $(CPP.Defines)
369 # Make Floating point IEEE compliant on Alpha.
372 CPP.BaseFlags += -mieee
373 ifeq ($(ENABLE_PIC),0)
375 CPP.BaseFlags += -fPIC
378 LD.Flags += -Wl,--no-relax
381 # GNU ld/PECOFF accepts but ignores them below;
385 # FIXME: autoconf should be aware of them.
386 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
387 HAVE_LINK_VERSION_SCRIPT := 0
389 RDYNAMIC := -Wl,--export-all-symbols
392 #--------------------------------------------------------------------
393 # Directory locations
394 #--------------------------------------------------------------------
396 ifeq ($(LLVM_CROSS_COMPILING),1)
397 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
400 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
401 ObjDir := $(ObjRootDir)
402 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
403 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
404 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
405 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
406 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
407 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
409 #--------------------------------------------------------------------
410 # Locations of shared libraries
411 #--------------------------------------------------------------------
414 SharedLibDir := $(LibDir)
415 LLVMSharedLibDir := $(LLVMLibDir)
417 # Win32.DLL prefers to be located on the "PATH" of binaries.
418 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
419 SharedLibDir := $(ToolDir)
420 LLVMSharedLibDir := $(LLVMToolDir)
422 ifeq ($(HOST_OS),Cygwin)
429 #--------------------------------------------------------------------
430 # LLVM Capable Compiler
431 #--------------------------------------------------------------------
433 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
435 LLVMCXX := $(LLVMGXX)
437 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
438 ifneq ($(CLANGPATH),)
439 LLVMCC := $(CLANGPATH)
440 LLVMCXX := $(CLANGXXPATH)
442 ifeq ($(ENABLE_BUILT_CLANG),1)
443 LLVMCC := $(LLVMToolDir)/clang
444 LLVMCXX := $(LLVMToolDir)/clang++
450 #--------------------------------------------------------------------
451 # Full Paths To Compiled Tools and Utilities
452 #--------------------------------------------------------------------
453 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
456 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
459 ifeq ($(LLVM_CROSS_COMPILING),1)
460 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
462 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
465 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
467 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
470 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
473 LLI := $(LLVMToolDir)/lli$(EXEEXT)
476 LLC := $(LLVMToolDir)/llc$(EXEEXT)
479 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
482 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
485 #--------------------------------------------------------------------
486 # Adjust to user's request
487 #--------------------------------------------------------------------
489 ifeq ($(HOST_OS),Darwin)
490 DARWIN_VERSION := `sw_vers -productVersion`
491 # Strip a number like 10.4.7 to 10.4
492 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
493 # Get "4" out of 10.4 for later pieces in the makefile.
494 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
496 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
497 SharedLinkOptions := -dynamiclib
499 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
502 SharedLinkOptions=-shared
505 ifeq ($(TARGET_OS),Darwin)
507 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
512 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
513 ifneq ($(HOST_OS),Darwin)
514 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
526 # Adjust settings for verbose mode
529 AR.Flags += >/dev/null 2>/dev/null
530 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
532 ConfigureScriptFLAGS :=
535 # By default, strip symbol information from executable
537 Strip := $(PLATFORMSTRIPOPTS)
538 StripWarnMsg := "(without symbols)"
539 Install.StripFlag += -s
542 ifdef TOOL_NO_EXPORTS
545 DynamicFlag := $(RDYNAMIC)
548 # Adjust linker flags for building an executable
549 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
550 ifneq ($(HOST_OS), Darwin)
552 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
554 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
556 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
560 ifneq ($(DARWIN_MAJVERS),4)
561 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
567 #----------------------------------------------------------
568 # Options To Invoke Tools
569 #----------------------------------------------------------
571 ifdef EXTRA_LD_OPTIONS
572 LD.Flags += $(EXTRA_LD_OPTIONS)
576 CompileCommonOpts += -pedantic -Wno-long-long
578 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
579 $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT)
580 # Enable cast-qual for C++; the workaround is to use const_cast.
581 CXX.Flags += -Wcast-qual
583 ifeq ($(HOST_OS),HP-UX)
584 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
587 # If we are building a universal binary on Mac OS/X, pass extra options. This
588 # is useful to people that want to link the LLVM libraries into their universal
591 # The following can be optionally specified:
592 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
593 # For Mac OS/X 10.4 Intel machines, the traditional one is:
594 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
595 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
596 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
599 ifndef UNIVERSAL_ARCH
600 UNIVERSAL_ARCH := i386 ppc
602 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
603 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
604 ifdef UNIVERSAL_SDK_PATH
605 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
608 # Building universal cannot compute dependencies automatically.
609 DISABLE_AUTO_DEPENDENCIES=1
611 ifeq ($(TARGET_OS),Darwin)
612 ifeq ($(ARCH),x86_64)
613 TargetCommonOpts = -m64
616 TargetCommonOpts = -m32
622 ifeq ($(HOST_OS),SunOS)
623 CPP.BaseFlags += -include llvm/Support/Solaris.h
626 ifeq ($(HOST_OS),AuroraUX)
627 CPP.BaseFlags += -include llvm/Support/Solaris.h
628 endif # !HOST_OS - AuroraUX.
630 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
631 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
632 # All -I flags should go here, so that they don't confuse llvm-config.
633 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
634 $(patsubst %,-I%/include,\
635 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
636 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
639 # SHOW_DIAGNOSTICS support.
640 ifeq ($(SHOW_DIAGNOSTICS),1)
641 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
642 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
647 ifeq ($(BUILD_COMPONENT), 1)
648 Compile.C = $(Compile.Wrapper) \
649 $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
650 $(TargetCommonOpts) $(CompileCommonOpts) -c
651 Compile.CXX = $(Compile.Wrapper) \
652 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
654 $(TargetCommonOpts) $(CompileCommonOpts) -c
655 Preprocess.CXX= $(Compile.Wrapper) \
656 $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
657 $(CompileCommonOpts) $(CXX.Flags) -E
658 Link = $(Compile.Wrapper) \
659 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
660 $(LD.Flags) $(LDFLAGS) \
661 $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
663 Compile.C = $(Compile.Wrapper) \
664 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
665 $(TargetCommonOpts) $(CompileCommonOpts) -c
666 Compile.CXX = $(Compile.Wrapper) \
667 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
668 $(TargetCommonOpts) $(CompileCommonOpts) -c
669 Preprocess.CXX= $(Compile.Wrapper) \
670 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
671 $(CompileCommonOpts) $(CXX.Flags) -E
672 Link = $(Compile.Wrapper) \
673 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
674 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
677 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
678 $(TargetCommonOpts) $(CompileCommonOpts)
679 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
680 $(TargetCommonOpts) $(CompileCommonOpts) -E
682 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
683 $(TargetCommonOpts) $(CompileCommonOpts)
685 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
686 ScriptInstall = $(INSTALL) -m 0755
687 DataInstall = $(INSTALL) -m 0644
689 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
690 # paths. In this case, the SYSPATH function (defined in
691 # Makefile.config) transforms Unix paths into Windows paths.
692 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
693 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
694 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
695 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
696 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
698 Archive = $(AR) $(AR.Flags)
699 LArchive = $(LLVMToolDir)/llvm-ar rcsf
708 #----------------------------------------------------------
709 # Get the list of source files and compute object file
711 #----------------------------------------------------------
714 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
715 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
717 Sources := $(SOURCES)
721 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
724 BaseNameSources := $(sort $(basename $(Sources)))
726 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
727 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
729 #----------------------------------------------------------
730 # For Mingw MSYS bash and Python/w32:
732 # $(ECHOPATH) prints DOSish pathstring.
733 # ex) $(ECHOPATH) /include/sys/types.h
734 # --> C:/mingw/include/sys/types.h
735 # built-in "echo" does not transform path to DOSish path.
737 # FIXME: It would not be needed when MSYS's python
739 #----------------------------------------------------------
741 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
742 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
744 ECHOPATH := $(Verb)$(ECHO)
747 ###############################################################################
748 # DIRECTORIES: Handle recursive descent of directory structure
749 ###############################################################################
751 #---------------------------------------------------------
752 # Provide rules to make install dirs. This must be early
753 # in the file so they get built before dependencies
754 #---------------------------------------------------------
756 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
759 # To create other directories, as needed, and timestamp their creation
761 $(Verb) $(MKDIR) $* > /dev/null
762 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
764 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
765 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
767 #---------------------------------------------------------
768 # Handle the DIRS options for sequential construction
769 #---------------------------------------------------------
775 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
776 $(RecursiveTargets)::
777 $(Verb) for dir in $(DIRS); do \
778 if ([ ! -f $$dir/Makefile ] || \
779 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
781 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
783 ($(MAKE) -C $$dir $@ ) || exit 1; \
786 $(RecursiveTargets)::
787 $(Verb) for dir in $(DIRS); do \
788 ($(MAKE) -C $$dir $@ ) || exit 1; \
794 #---------------------------------------------------------
795 # Handle the EXPERIMENTAL_DIRS options ensuring success
796 # after each directory is built.
797 #---------------------------------------------------------
798 ifdef EXPERIMENTAL_DIRS
799 $(RecursiveTargets)::
800 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
801 if ([ ! -f $$dir/Makefile ] || \
802 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
804 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
806 ($(MAKE) -C $$dir $@ ) || exit 0; \
810 #-----------------------------------------------------------
811 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
812 #-----------------------------------------------------------
813 ifdef OPTIONAL_PARALLEL_DIRS
814 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)"))
817 #-----------------------------------------------------------
818 # Handle the PARALLEL_DIRS options for parallel construction
819 #-----------------------------------------------------------
822 SubDirs += $(PARALLEL_DIRS)
824 # Unfortunately, this list must be maintained if new recursive targets are added
825 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
826 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
827 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
828 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
829 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
830 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
831 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
833 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
836 $(Verb) if ([ ! -f $(@D)/Makefile ] || \
837 command test $(@D)/Makefile -ot \
838 $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \
840 $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
842 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
845 #---------------------------------------------------------
846 # Handle the OPTIONAL_DIRS options for directores that may
848 #---------------------------------------------------------
851 SubDirs += $(OPTIONAL_DIRS)
853 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
854 $(RecursiveTargets)::
855 $(Verb) for dir in $(OPTIONAL_DIRS); do \
856 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
857 if ([ ! -f $$dir/Makefile ] || \
858 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
860 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
862 ($(MAKE) -C$$dir $@ ) || exit 1; \
866 $(RecursiveTargets)::
867 $(Verb) for dir in $(OPTIONAL_DIRS); do \
868 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
869 ($(MAKE) -C$$dir $@ ) || exit 1; \
875 #---------------------------------------------------------
876 # Handle the CONFIG_FILES options
877 #---------------------------------------------------------
882 $(Echo) Install circumvented with NO_INSTALL
884 $(Echo) UnInstall circumvented with NO_INSTALL
886 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
887 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
888 $(Verb)for file in $(CONFIG_FILES); do \
889 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
890 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
891 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
892 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
894 $(ECHO) Error: cannot find config file $${file}. ; \
899 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
900 $(Verb)for file in $(CONFIG_FILES); do \
901 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
907 ###############################################################################
908 # Set up variables for building libraries
909 ###############################################################################
911 #---------------------------------------------------------
912 # Define various command line options pertaining to the
913 # libraries needed when linking. There are "Proj" libs
914 # (defined by the user's project) and "LLVM" libs (defined
915 # by the LLVM project).
916 #---------------------------------------------------------
919 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
920 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
921 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
922 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
926 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
927 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
928 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
929 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
932 # Loadable module for Win32 requires all symbols resolved for linking.
933 # Then all symbols in LLVM.dll will be available.
934 ifeq ($(ENABLE_SHARED),1)
935 ifdef LOADABLE_MODULE
936 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
937 LINK_COMPONENTS += all
942 ifndef IS_CLEANING_TARGET
943 ifdef LINK_COMPONENTS
945 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
946 # clean in tools, then do a make in tools (instead of at the top level).
948 @echo "*** llvm-config doesn't exist - rebuilding it."
949 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
951 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
953 ifeq ($(ENABLE_SHARED), 1)
954 # We can take the "auto-import" feature to get rid of using dllimport.
955 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
956 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
959 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
960 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
963 ifndef NO_LLVM_CONFIG
964 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
965 ifeq ($(LLVMConfigLibs),Error)
966 $(error llvm-config --libs failed)
968 LLVMLibsOptions += $(LLVMConfigLibs)
969 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
970 ifeq ($(LLVMConfigLibfiles),Error)
971 $(error llvm-config --libfiles failed)
973 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
980 # Set up the library exports file.
981 ifdef EXPORTED_SYMBOL_FILE
983 # First, set up the native export file, which may differ from the source
986 ifeq ($(HOST_OS),Darwin)
987 # Darwin convention prefixes symbols with underscores.
988 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
989 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
990 $(Verb) sed -e 's/^/_/' < $< > $@
992 -$(Verb) $(RM) -f $(NativeExportsFile)
994 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
995 # Gold and BFD ld require a version script rather than a plain list.
996 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
997 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
998 $(Verb) echo "{" > $@
999 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1000 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1001 ifneq ($(HOST_OS),OpenBSD)
1002 $(Verb) echo " local: *;" >> $@
1004 $(Verb) echo "};" >> $@
1006 -$(Verb) $(RM) -f $(NativeExportsFile)
1008 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1009 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1010 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1011 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1012 $(Echo) Generating $(notdir $@)
1013 $(Verb) $(ECHO) "EXPORTS" > $@
1014 $(Verb) $(CAT) $< >> $@
1016 -$(Verb) $(RM) -f $(NativeExportsFile)
1018 # Default behavior: just use the exports file verbatim.
1019 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1024 # Now add the linker command-line options to use the native export file.
1027 ifeq ($(HOST_OS),Darwin)
1028 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1031 # gold, bfd ld, etc.
1032 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1033 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1037 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1038 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1039 SharedLinkOptions += $(NativeExportsFile)
1044 ###############################################################################
1045 # Library Build Rules: Four ways to build a library
1046 ###############################################################################
1048 #---------------------------------------------------------
1049 # Bytecode Module Targets:
1050 # If the user set MODULE_NAME then they want to build a
1051 # bytecode module from the sources. We compile all the
1052 # sources and link it together into a single bytecode
1054 #---------------------------------------------------------
1057 ifeq ($(strip $(LLVMCC)),)
1058 $(warning Modules require LLVM capable compiler but none is available ****)
1061 Module := $(LibDir)/$(MODULE_NAME).bc
1062 LinkModule := $(LLVMLD) -r
1065 ifdef EXPORTED_SYMBOL_FILE
1066 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1069 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1070 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1071 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1073 all-local:: $(Module)
1076 ifneq ($(strip $(Module)),)
1077 -$(Verb) $(RM) -f $(Module)
1080 ifdef BYTECODE_DESTINATION
1081 ModuleDestDir := $(BYTECODE_DESTINATION)
1083 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1088 $(Echo) Install circumvented with NO_INSTALL
1090 $(Echo) Uninstall circumvented with NO_INSTALL
1092 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1094 install-module:: $(DestModule)
1095 install-local:: $(DestModule)
1097 $(DestModule): $(ModuleDestDir) $(Module)
1098 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1099 $(Verb) $(DataInstall) $(Module) $(DestModule)
1102 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1103 -$(Verb) $(RM) -f $(DestModule)
1109 # if we're building a library ...
1112 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1113 LIBRARYNAME := $(strip $(LIBRARYNAME))
1114 ifdef LOADABLE_MODULE
1115 BaseLibName.A := $(LIBRARYNAME).a
1116 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1118 BaseLibName.A := lib$(LIBRARYNAME).a
1119 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1121 LibName.A := $(LibDir)/$(BaseLibName.A)
1122 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1123 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1124 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1126 #---------------------------------------------------------
1127 # Shared Library Targets:
1128 # If the user asked for a shared library to be built
1129 # with the SHARED_LIBRARY variable, then we provide
1130 # targets for building them.
1131 #---------------------------------------------------------
1132 ifdef SHARED_LIBRARY
1134 all-local:: $(LibName.SO)
1136 ifdef EXPORTED_SYMBOL_FILE
1137 $(LibName.SO): $(NativeExportsFile)
1140 ifdef LINK_LIBS_IN_SHARED
1141 ifdef LOADABLE_MODULE
1142 SharedLibKindMessage := "Loadable Module"
1143 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1145 SharedLibKindMessage := "Shared Library"
1147 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1148 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1150 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1151 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1153 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1154 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1155 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1159 ifneq ($(strip $(LibName.SO)),)
1160 -$(Verb) $(RM) -f $(LibName.SO)
1165 $(Echo) Install circumvented with NO_INSTALL
1167 $(Echo) Uninstall circumvented with NO_INSTALL
1170 # Win32.DLL prefers to be located on the "PATH" of binaries.
1171 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1172 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1174 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1176 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1178 install-local:: $(DestSharedLib)
1180 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1181 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1182 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1185 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1186 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1190 #---------------------------------------------------------
1191 # Bytecode Library Targets:
1192 # If the user asked for a bytecode library to be built
1193 # with the BYTECODE_LIBRARY variable, then we provide
1194 # targets for building them.
1195 #---------------------------------------------------------
1196 ifdef BYTECODE_LIBRARY
1197 ifeq ($(strip $(LLVMCC)),)
1198 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1201 all-local:: $(LibName.BCA)
1203 ifdef EXPORTED_SYMBOL_FILE
1204 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1206 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1207 $(LLVMToolDir)/llvm-ar
1208 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1210 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1212 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1214 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1215 $(LLVMToolDir)/llvm-ar
1216 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1218 $(Verb) $(LArchive) $@ $(ObjectsBC)
1223 ifneq ($(strip $(LibName.BCA)),)
1224 -$(Verb) $(RM) -f $(LibName.BCA)
1227 ifdef BYTECODE_DESTINATION
1228 BytecodeDestDir := $(BYTECODE_DESTINATION)
1230 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1233 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1235 install-bytecode-local:: $(DestBytecodeLib)
1239 $(Echo) Install circumvented with NO_INSTALL
1241 $(Echo) Uninstall circumvented with NO_INSTALL
1243 install-local:: $(DestBytecodeLib)
1245 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1246 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1247 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1250 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1251 -$(Verb) $(RM) -f $(DestBytecodeLib)
1256 #---------------------------------------------------------
1258 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1259 # building an archive.
1260 #---------------------------------------------------------
1261 ifndef NO_BUILD_ARCHIVE
1262 ifndef BUILD_ARCHIVE
1263 ifndef LOADABLE_MODULE
1269 #---------------------------------------------------------
1270 # Archive Library Targets:
1271 # If the user wanted a regular archive library built,
1272 # then we provide targets for building them.
1273 #---------------------------------------------------------
1276 all-local:: $(LibName.A)
1278 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1279 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1280 -$(Verb) $(RM) -f $@
1281 $(Verb) $(Archive) $@ $(ObjectsO)
1282 $(Verb) $(Ranlib) $@
1285 ifneq ($(strip $(LibName.A)),)
1286 -$(Verb) $(RM) -f $(LibName.A)
1291 $(Echo) Install circumvented with NO_INSTALL
1293 $(Echo) Uninstall circumvented with NO_INSTALL
1295 ifdef NO_INSTALL_ARCHIVES
1297 $(Echo) Install circumvented with NO_INSTALL
1299 $(Echo) Uninstall circumvented with NO_INSTALL
1301 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1303 install-local:: $(DestArchiveLib)
1305 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1306 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1307 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1308 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1311 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1312 -$(Verb) $(RM) -f $(DestArchiveLib)
1320 ###############################################################################
1321 # Tool Build Rules: Build executable tool based on TOOLNAME option
1322 ###############################################################################
1326 #---------------------------------------------------------
1327 # Set up variables for building a tool.
1328 #---------------------------------------------------------
1329 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1331 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1333 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1336 # TOOLALIAS is a name to symlink (or copy) the tool to.
1339 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1341 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1345 #---------------------------------------------------------
1347 #---------------------------------------------------------
1349 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1350 # not exporting all of the weak symbols from the binary. This reduces dyld
1351 # startup time by 4x on darwin in some cases.
1352 ifdef TOOL_NO_EXPORTS
1353 ifeq ($(HOST_OS),Darwin)
1355 # Tiger tools don't support this.
1356 ifneq ($(DARWIN_MAJVERS),4)
1357 LD.Flags += -Wl,-exported_symbol,_main
1361 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1362 ifneq ($(ARCH), Mips)
1363 LD.Flags += -Wl,--version-script=$(PROJ_SRC_ROOT)/autoconf/ExportMap.map
1368 #---------------------------------------------------------
1369 # Tool Order File Support
1370 #---------------------------------------------------------
1372 ifeq ($(HOST_OS),Darwin)
1373 ifdef TOOL_ORDER_FILE
1375 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1380 #---------------------------------------------------------
1381 # Tool Version Info Support
1382 #---------------------------------------------------------
1384 ifeq ($(HOST_OS),Darwin)
1385 ifdef TOOL_INFO_PLIST
1387 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1389 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1391 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1392 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1393 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1394 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1395 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1396 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1402 #---------------------------------------------------------
1403 # Provide targets for building the tools
1404 #---------------------------------------------------------
1405 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1408 ifneq ($(strip $(ToolBuildPath)),)
1409 -$(Verb) $(RM) -f $(ToolBuildPath)
1411 ifneq ($(strip $(ToolAliasBuildPath)),)
1412 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1416 $(ToolBuildPath): $(ExmplDir)/.dir
1418 $(ToolBuildPath): $(ToolDir)/.dir
1421 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1422 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1423 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1424 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1425 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1428 ifneq ($(strip $(ToolAliasBuildPath)),)
1429 $(ToolAliasBuildPath): $(ToolBuildPath)
1430 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1431 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1432 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1433 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1439 $(Echo) Install circumvented with NO_INSTALL
1441 $(Echo) Uninstall circumvented with NO_INSTALL
1443 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1445 install-local:: $(DestTool)
1447 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1448 $(Echo) Installing $(BuildMode) $(DestTool)
1449 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1452 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1453 -$(Verb) $(RM) -f $(DestTool)
1455 # TOOLALIAS install.
1457 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1459 install-local:: $(DestToolAlias)
1461 $(DestToolAlias): $(DestTool)
1462 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1463 $(Verb) $(RM) -f $(DestToolAlias)
1464 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1467 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1468 -$(Verb) $(RM) -f $(DestToolAlias)
1474 ###############################################################################
1475 # Object Build Rules: Build object files based on sources
1476 ###############################################################################
1478 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1479 ifeq ($(HOST_OS),HP-UX)
1480 DISABLE_AUTO_DEPENDENCIES=1
1483 # Provide rule sets for when dependency generation is enabled
1484 ifndef DISABLE_AUTO_DEPENDENCIES
1486 #---------------------------------------------------------
1487 # Create .o files in the ObjDir directory from the .cpp and .c files...
1488 #---------------------------------------------------------
1490 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1491 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1493 # If the build succeeded, move the dependency file over, otherwise
1495 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1496 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1498 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1499 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1500 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1503 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1504 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1505 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1508 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1509 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1510 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1513 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1514 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1515 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1518 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1519 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1520 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1523 #---------------------------------------------------------
1524 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1525 #---------------------------------------------------------
1527 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1528 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1530 # If the build succeeded, move the dependency file over, otherwise
1532 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1533 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1535 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1536 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1537 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1538 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1539 $(BC_DEPEND_MOVEFILE)
1541 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1542 $(Echo) "Compiling $*.mm 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: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1548 $(Echo) "Compiling $*.cc 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: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1554 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1555 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1556 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1557 $(BC_DEPEND_MOVEFILE)
1559 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1560 $(Echo) "Compiling $*.m 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 # Provide alternate rule sets if dependencies are disabled
1568 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1569 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1570 $(Compile.CXX) $< -o $@
1572 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1573 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1574 $(Compile.CXX) $< -o $@
1576 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1577 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1578 $(Compile.CXX) $< -o $@
1580 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1581 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1582 $(Compile.C) $< -o $@
1584 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1585 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1586 $(Compile.C) $< -o $@
1588 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1589 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1590 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1592 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1593 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1594 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1596 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1597 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1598 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1600 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1601 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1602 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1604 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1605 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1606 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1611 ## Rules for building preprocessed (.i/.ii) outputs.
1612 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1613 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1614 $(Verb) $(Preprocess.CXX) $< -o $@
1616 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1617 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1618 $(Verb) $(Preprocess.CXX) $< -o $@
1620 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1621 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1622 $(Verb) $(Preprocess.CXX) $< -o $@
1624 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1625 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1626 $(Verb) $(Preprocess.C) $< -o $@
1628 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1629 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1630 $(Verb) $(Preprocess.C) $< -o $@
1633 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1634 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1635 $(Compile.CXX) $< -o $@ -S
1637 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1638 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1639 $(Compile.CXX) $< -o $@ -S
1641 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1642 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1643 $(Compile.CXX) $< -o $@ -S
1645 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1646 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1647 $(Compile.C) $< -o $@ -S
1649 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1650 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1651 $(Compile.C) $< -o $@ -S
1654 # make the C and C++ compilers strip debug info out of bytecode libraries.
1656 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1657 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1658 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1660 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1661 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1662 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1666 #---------------------------------------------------------
1667 # Provide rule to build .bc files from .ll sources,
1668 # regardless of dependencies
1669 #---------------------------------------------------------
1670 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1671 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1672 $(Verb) $(LLVMAS) $< -f -o $@
1674 ###############################################################################
1675 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1676 ###############################################################################
1679 TABLEGEN_INC_FILES_COMMON = 1
1682 ifdef TABLEGEN_INC_FILES_COMMON
1684 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1685 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1686 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1688 # INCFiles rule: All of the tblgen generated files are emitted to
1689 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1690 # us to only "touch" the real file if the contents of it change. IOW, if
1691 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1692 # dependencies of the .inc files are, unless the contents of the .inc file
1694 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1695 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1697 endif # TABLEGEN_INC_FILES_COMMON
1701 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1702 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1703 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1704 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1705 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1706 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1707 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1709 # All .inc.tmp files depend on the .td files.
1710 $(INCTMPFiles) : $(TDFiles)
1712 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1713 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1714 $(Echo) "Building $(<F) register info implementation with tblgen"
1715 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1717 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1718 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1719 $(Echo) "Building $(<F) instruction information with tblgen"
1720 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1722 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1723 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1724 $(Echo) "Building $(<F) assembly writer with tblgen"
1725 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1727 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1728 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1729 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1730 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1732 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1733 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1734 $(Echo) "Building $(<F) assembly matcher with tblgen"
1735 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1737 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1738 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1739 $(Echo) "Building $(<F) MC code emitter with tblgen"
1740 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1742 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1743 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1744 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1745 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1747 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1748 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1749 $(Echo) "Building $(<F) code emitter with tblgen"
1750 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1752 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1753 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1754 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1755 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1757 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1758 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1759 $(Echo) "Building $(<F) disassembly tables with tblgen"
1760 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1762 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1763 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1764 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1765 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1767 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1768 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1769 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1770 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1772 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1773 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1774 $(Echo) "Building $(<F) subtarget information with tblgen"
1775 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1777 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1778 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1779 $(Echo) "Building $(<F) calling convention information with tblgen"
1780 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1782 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1783 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1784 $(Echo) "Building $(<F) intrinsics information with tblgen"
1785 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1787 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1788 $(Echo) "Building $(<F) decoder tables with tblgen"
1789 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1793 -$(Verb) $(RM) -f $(INCFiles)
1797 ###############################################################################
1798 # OTHER RULES: Other rules needed
1799 ###############################################################################
1801 # To create postscript files from dot files...
1802 ifneq ($(DOT),false)
1804 $(DOT) -Tps < $< > $@
1807 $(Echo) "Cannot build $@: The program dot is not installed"
1810 # This rules ensures that header files that are removed still have a rule for
1811 # which they can be "generated." This allows make to ignore them and
1812 # reproduce the dependency lists.
1816 # Define clean-local to clean the current directory. Note that this uses a
1817 # very conservative approach ensuring that empty variables do not cause
1818 # errors or disastrous removal.
1820 ifneq ($(strip $(ObjRootDir)),)
1821 -$(Verb) $(RM) -rf $(ObjRootDir)
1823 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
1824 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1825 -$(Verb) $(RM) -f *$(SHLIBEXT)
1829 -$(Verb) $(RM) -rf Debug Release Profile
1832 ###############################################################################
1833 # DEPENDENCIES: Include the dependency files if we should
1834 ###############################################################################
1835 ifndef DISABLE_AUTO_DEPENDENCIES
1837 # If its not one of the cleaning targets
1838 ifndef IS_CLEANING_TARGET
1840 # Get the list of dependency files
1841 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1842 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1844 # Include bitcode dependency files if using bitcode libraries
1845 ifdef BYTECODE_LIBRARY
1846 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1849 -include $(DependFiles) ""
1855 ###############################################################################
1856 # CHECK: Running the test suite
1857 ###############################################################################
1860 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1861 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1862 $(EchoCmd) Running test suite ; \
1863 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1864 TESTSUITE=$(TESTSUITE) ; \
1866 $(EchoCmd) No Makefile in test directory ; \
1869 $(EchoCmd) No test directory ; \
1875 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1876 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1877 $(EchoCmd) Running test suite ; \
1878 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1880 $(EchoCmd) No Makefile in test directory ; \
1883 $(EchoCmd) No test directory ; \
1887 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1888 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1889 $(EchoCmd) Running test suite ; \
1890 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1892 $(EchoCmd) No Makefile in test directory ; \
1895 $(EchoCmd) No test directory ; \
1898 ###############################################################################
1899 # UNITTESTS: Running the unittests test suite
1900 ###############################################################################
1903 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1904 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1905 $(EchoCmd) Running unittests test suite ; \
1906 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1908 $(EchoCmd) No Makefile in unittests directory ; \
1911 $(EchoCmd) No unittests directory ; \
1914 ###############################################################################
1915 # DISTRIBUTION: Handle construction of a distribution tarball
1916 ###############################################################################
1918 #------------------------------------------------------------------------
1919 # Define distribution related variables
1920 #------------------------------------------------------------------------
1921 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1922 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1923 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1924 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1925 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1926 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1927 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1928 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1929 Makefile.config.in configure autoconf
1930 DistOther := $(notdir $(wildcard \
1931 $(PROJ_SRC_DIR)/*.h \
1932 $(PROJ_SRC_DIR)/*.td \
1933 $(PROJ_SRC_DIR)/*.def \
1934 $(PROJ_SRC_DIR)/*.ll \
1935 $(PROJ_SRC_DIR)/*.in))
1936 DistSubDirs := $(SubDirs)
1937 DistSources = $(Sources) $(EXTRA_DIST)
1938 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1940 #------------------------------------------------------------------------
1941 # We MUST build distribution with OBJ_DIR != SRC_DIR
1942 #------------------------------------------------------------------------
1943 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
1944 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1945 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
1949 #------------------------------------------------------------------------
1950 # Prevent attempt to run dist targets from anywhere but the top level
1951 #------------------------------------------------------------------------
1953 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1954 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
1957 #------------------------------------------------------------------------
1958 # Provide the top level targets
1959 #------------------------------------------------------------------------
1961 dist-gzip:: $(DistTarGZip)
1963 $(DistTarGZip) : $(TopDistDir)/.makedistdir
1964 $(Echo) Packing gzipped distribution tar file.
1965 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1966 $(GZIP) -c > "$(DistTarGZip)"
1968 dist-bzip2:: $(DistTarBZ2)
1970 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
1971 $(Echo) Packing bzipped distribution tar file.
1972 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1973 $(BZIP2) -c >$(DistTarBZ2)
1975 dist-zip:: $(DistZip)
1977 $(DistZip) : $(TopDistDir)/.makedistdir
1978 $(Echo) Packing zipped distribution file.
1979 $(Verb) rm -f $(DistZip)
1980 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
1982 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
1983 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
1985 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
1987 dist-check:: $(DistTarGZip)
1988 $(Echo) Checking distribution tar file.
1989 $(Verb) if test -d $(DistCheckDir) ; then \
1990 $(RM) -rf $(DistCheckDir) ; \
1992 $(Verb) $(MKDIR) $(DistCheckDir)
1993 $(Verb) cd $(DistCheckDir) && \
1994 $(MKDIR) $(DistCheckDir)/build && \
1995 $(MKDIR) $(DistCheckDir)/install && \
1996 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
1998 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
1999 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2002 $(MAKE) unittests && \
2003 $(MAKE) install && \
2004 $(MAKE) uninstall && \
2005 $(MAKE) dist-clean && \
2006 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2009 $(Echo) Cleaning distribution files
2010 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2015 #------------------------------------------------------------------------
2016 # Provide the recursive distdir target for building the distribution directory
2017 #------------------------------------------------------------------------
2018 distdir: $(DistDir)/.makedistdir
2019 $(DistDir)/.makedistdir: $(DistSources)
2020 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2021 if test -d "$(DistDir)" ; then \
2022 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2025 $(EchoCmd) Removing old $(DistDir) ; \
2026 $(RM) -rf $(DistDir); \
2027 $(EchoCmd) Making 'all' to verify build ; \
2028 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2030 $(Echo) Building Distribution Directory $(DistDir)
2031 $(Verb) $(MKDIR) $(DistDir)
2032 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2033 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2034 for file in $(DistFiles) ; do \
2036 $(PROJ_SRC_DIR)/*) \
2037 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2039 $(PROJ_SRC_ROOT)/*) \
2040 file=`echo "$$file" | \
2041 sed "s#^$$srcrootstrip/##"` \
2044 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2045 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2046 from_dir="$(PROJ_SRC_DIR)" ; \
2047 elif test -f "$$file" || test -d "$$file" ; then \
2050 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2051 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2052 to_dir="$(DistDir)/$$dir"; \
2053 $(MKDIR) "$$to_dir" ; \
2055 to_dir="$(DistDir)"; \
2057 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2058 if test -n "$$mid_dir" ; then \
2059 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2061 if test -d "$$from_dir/$$file"; then \
2062 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2063 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2064 cd $(PROJ_SRC_DIR) ; \
2065 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2066 ( cd $$to_dir ; $(TAR) xf - ) ; \
2067 cd $(PROJ_OBJ_DIR) ; \
2070 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2071 ( cd $$to_dir ; $(TAR) xf - ) ; \
2072 cd $(PROJ_OBJ_DIR) ; \
2074 elif test -f "$$from_dir/$$file" ; then \
2075 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2076 elif test -L "$$from_dir/$$file" ; then \
2077 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2078 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2079 $(EchoCmd) "===== WARNING: Distribution Source " \
2080 "$$from_dir/$$file Not Found!" ; \
2081 elif test "$(Verb)" != '@' ; then \
2082 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2085 $(Verb) for subdir in $(DistSubDirs) ; do \
2086 if test "$$subdir" \!= "." ; then \
2087 new_distdir="$(DistDir)/$$subdir" ; \
2088 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2089 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2090 DistDir="$$new_distdir" distdir ) || exit 1; \
2093 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2094 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2095 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2096 -name .svn \) -print` ;\
2097 $(MAKE) dist-hook ; \
2098 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2099 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2100 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2101 -o ! -type d ! -perm -444 -exec \
2102 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2103 || chmod -R a+r $(DistDir) ; \
2106 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2112 ###############################################################################
2113 # TOP LEVEL - targets only to apply at the top level directory
2114 ###############################################################################
2118 #------------------------------------------------------------------------
2119 # Install support for the project's include files:
2120 #------------------------------------------------------------------------
2123 $(Echo) Install circumvented with NO_INSTALL
2125 $(Echo) Uninstall circumvented with NO_INSTALL
2128 $(Echo) Installing include files
2129 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2130 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2131 cd $(PROJ_SRC_ROOT)/include && \
2132 for hdr in `find . -type f \
2133 '(' -name LICENSE.TXT \
2138 ')' -print | grep -v CVS | \
2139 grep -v .svn` ; do \
2140 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2141 if test \! -d "$$instdir" ; then \
2142 $(EchoCmd) Making install directory $$instdir ; \
2143 $(MKDIR) $$instdir ;\
2145 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2148 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2149 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2150 cd $(PROJ_OBJ_ROOT)/include && \
2151 for hdr in `find . -type f \
2152 '(' -name LICENSE.TXT \
2157 ')' -print | grep -v CVS | \
2158 grep -v .svn` ; do \
2159 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2160 if test \! -d "$$instdir" ; then \
2161 $(EchoCmd) Making install directory $$instdir ; \
2162 $(MKDIR) $$instdir ;\
2164 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2170 $(Echo) Uninstalling include files
2171 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2172 cd $(PROJ_SRC_ROOT)/include && \
2173 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2174 '!' '(' -name '*~' -o -name '.#*' \
2175 -o -name '*.in' ')' -print ')' | \
2176 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2177 cd $(PROJ_SRC_ROOT)/include && \
2178 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2179 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2185 @echo searching for overlength lines in files: $(Sources)
2188 egrep -n '.{81}' $(Sources) /dev/null
2191 @echo searching for tabs in files: $(Sources)
2194 egrep -n ' ' $(Sources) /dev/null
2197 @ls -l $(LibDir) | awk '\
2198 BEGIN { sum = 0; } \
2200 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2201 @ls -l $(ToolDir) | awk '\
2202 BEGIN { sum = 0; } \
2204 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2205 #------------------------------------------------------------------------
2206 # Print out the directories used for building
2207 #------------------------------------------------------------------------
2209 $(Echo) "BuildMode : " '$(BuildMode)'
2210 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2211 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2212 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2213 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2214 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2215 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2216 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2217 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2218 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2219 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2220 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2221 $(Echo) "UserTargets : " '$(UserTargets)'
2222 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2223 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2224 $(Echo) "ObjDir : " '$(ObjDir)'
2225 $(Echo) "LibDir : " '$(LibDir)'
2226 $(Echo) "ToolDir : " '$(ToolDir)'
2227 $(Echo) "ExmplDir : " '$(ExmplDir)'
2228 $(Echo) "Sources : " '$(Sources)'
2229 $(Echo) "TDFiles : " '$(TDFiles)'
2230 $(Echo) "INCFiles : " '$(INCFiles)'
2231 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2232 $(Echo) "PreConditions: " '$(PreConditions)'
2233 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2234 $(Echo) "Compile.C : " '$(Compile.C)'
2235 $(Echo) "Archive : " '$(Archive)'
2236 $(Echo) "YaccFiles : " '$(YaccFiles)'
2237 $(Echo) "LexFiles : " '$(LexFiles)'
2238 $(Echo) "Module : " '$(Module)'
2239 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2240 $(Echo) "SubDirs : " '$(SubDirs)'
2241 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2242 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2247 # General debugging rule, use 'make dbg-print-XXX' to print the
2248 # definition, value and origin of XXX.
2250 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))