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 # LLVMC: Provide rules for compiling llvmc-based driver
195 ###############################################################################
197 ifdef LLVMC_BASED_DRIVER
199 TOOLNAME = $(LLVMC_BASED_DRIVER)
201 LLVMLIBS = CompilerDriver.a
202 LINK_COMPONENTS = support
204 endif # LLVMC_BASED_DRIVER
206 ###############################################################################
207 # VARIABLES: Set up various variables based on configuration data
208 ###############################################################################
210 # Variable for if this make is for a "cleaning" target
211 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
215 #--------------------------------------------------------------------
216 # Variables derived from configuration we are building
217 #--------------------------------------------------------------------
220 ifeq ($(ENABLE_OPTIMIZED),1)
222 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
223 ifneq ($(HOST_OS),FreeBSD)
224 ifneq ($(HOST_OS),Darwin)
225 OmitFramePointer := -fomit-frame-pointer
229 # Darwin requires -fstrict-aliasing to be explicitly enabled.
230 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
231 # with -fstrict-aliasing and ipa-type-escape radr://6756684
232 #ifeq ($(HOST_OS),Darwin)
233 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
235 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
236 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
237 LD.Flags += $(OPTIMIZE_OPTION)
239 BuildMode := $(BuildMode)+Debug
246 ifdef NO_DEBUG_SYMBOLS
247 BuildMode := Unoptimized
261 ifeq ($(ENABLE_PROFILING),1)
262 BuildMode := $(BuildMode)+Profile
263 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
264 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
265 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
269 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
270 # CXX.Flags += -fvisibility-inlines-hidden
273 ifdef ENABLE_EXPENSIVE_CHECKS
274 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
275 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
279 # IF REQUIRES_EH=1 is specified then don't disable exceptions
281 CXX.Flags += -fno-exceptions
283 # If the library requires EH, it also requires RTTI.
287 ifdef REQUIRES_FRAME_POINTER
288 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
289 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
290 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
293 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
294 ifneq ($(REQUIRES_RTTI), 1)
295 CXX.Flags += -fno-rtti
298 ifeq ($(ENABLE_COVERAGE),1)
299 BuildMode := $(BuildMode)+Coverage
300 CXX.Flags += -ftest-coverage -fprofile-arcs
301 C.Flags += -ftest-coverage -fprofile-arcs
304 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
305 # then disable assertions by defining the appropriate preprocessor symbols.
306 ifeq ($(DISABLE_ASSERTIONS),1)
307 CPP.Defines += -DNDEBUG
309 BuildMode := $(BuildMode)+Asserts
310 CPP.Defines += -D_DEBUG
313 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
314 # configured), then enable expensive checks by defining the
315 # appropriate preprocessor symbols.
316 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
317 BuildMode := $(BuildMode)+Checks
318 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
321 # LOADABLE_MODULE implies several other things so we force them to be
323 ifdef LOADABLE_MODULE
325 LINK_LIBS_IN_SHARED := 1
333 ifeq ($(ENABLE_PIC),1)
334 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
335 # Nothing. Win32 defaults to PIC and warns when given -fPIC
337 ifeq ($(HOST_OS),Darwin)
338 # Common symbols not allowed in dylib files
339 CXX.Flags += -fno-common
340 C.Flags += -fno-common
342 # Linux and others; pass -fPIC
348 ifeq ($(HOST_OS),Darwin)
349 CXX.Flags += -mdynamic-no-pic
350 C.Flags += -mdynamic-no-pic
354 # Support makefile variable to disable any kind of timestamp/non-deterministic
355 # info from being used in the build.
356 ifeq ($(ENABLE_TIMESTAMPS),1)
357 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
359 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
362 ifeq ($(HOST_OS),MingW)
364 CPP.Defines += -D__NO_CTYPE_INLINE
365 ifeq ($(LLVM_CROSS_COMPILING),1)
366 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
368 LD.Flags += -Wl,--allow-multiple-definition
373 CXX.Flags += -Woverloaded-virtual
374 CPP.BaseFlags += $(CPP.Defines)
377 # Make Floating point IEEE compliant on Alpha.
380 CPP.BaseFlags += -mieee
381 ifeq ($(ENABLE_PIC),0)
383 CPP.BaseFlags += -fPIC
386 LD.Flags += -Wl,--no-relax
389 # GNU ld/PECOFF accepts but ignores them below;
393 # FIXME: autoconf should be aware of them.
394 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
395 HAVE_LINK_VERSION_SCRIPT := 0
397 RDYNAMIC := -Wl,--export-all-symbols
400 #--------------------------------------------------------------------
401 # Directory locations
402 #--------------------------------------------------------------------
404 ifeq ($(LLVM_CROSS_COMPILING),1)
405 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
408 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
409 ObjDir := $(ObjRootDir)
410 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
411 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
412 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
413 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
414 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
415 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
417 #--------------------------------------------------------------------
418 # Locations of shared libraries
419 #--------------------------------------------------------------------
422 SharedLibDir := $(LibDir)
423 LLVMSharedLibDir := $(LLVMLibDir)
425 # Win32.DLL prefers to be located on the "PATH" of binaries.
426 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
427 SharedLibDir := $(ToolDir)
428 LLVMSharedLibDir := $(LLVMToolDir)
430 ifeq ($(HOST_OS),Cygwin)
437 #--------------------------------------------------------------------
438 # LLVM Capable Compiler
439 #--------------------------------------------------------------------
441 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
443 LLVMCXX := $(LLVMGXX)
445 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
446 ifneq ($(CLANGPATH),)
447 LLVMCC := $(CLANGPATH)
448 LLVMCXX := $(CLANGXXPATH)
450 ifeq ($(ENABLE_BUILT_CLANG),1)
451 LLVMCC := $(LLVMToolDir)/clang
452 LLVMCXX := $(LLVMToolDir)/clang++
458 #--------------------------------------------------------------------
459 # Full Paths To Compiled Tools and Utilities
460 #--------------------------------------------------------------------
461 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
464 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
467 ifeq ($(LLVM_CROSS_COMPILING),1)
468 TBLGEN := $(BuildLLVMToolDir)/tblgen$(BUILD_EXEEXT)
470 TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
473 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
475 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
478 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
481 LLI := $(LLVMToolDir)/lli$(EXEEXT)
484 LLC := $(LLVMToolDir)/llc$(EXEEXT)
487 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
490 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
493 #--------------------------------------------------------------------
494 # Adjust to user's request
495 #--------------------------------------------------------------------
497 ifeq ($(HOST_OS),Darwin)
498 DARWIN_VERSION := `sw_vers -productVersion`
499 # Strip a number like 10.4.7 to 10.4
500 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
501 # Get "4" out of 10.4 for later pieces in the makefile.
502 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
504 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
505 SharedLinkOptions := -dynamiclib
507 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
510 SharedLinkOptions=-shared
513 ifeq ($(TARGET_OS),Darwin)
515 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
520 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
521 ifneq ($(HOST_OS),Darwin)
522 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
534 # Adjust settings for verbose mode
537 AR.Flags += >/dev/null 2>/dev/null
538 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
540 ConfigureScriptFLAGS :=
543 # By default, strip symbol information from executable
545 Strip := $(PLATFORMSTRIPOPTS)
546 StripWarnMsg := "(without symbols)"
547 Install.StripFlag += -s
550 ifdef TOOL_NO_EXPORTS
553 DynamicFlag := $(RDYNAMIC)
556 # Adjust linker flags for building an executable
557 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
558 ifneq ($(HOST_OS), Darwin)
560 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
562 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
564 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
568 ifneq ($(DARWIN_MAJVERS),4)
569 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
575 #----------------------------------------------------------
576 # Options To Invoke Tools
577 #----------------------------------------------------------
579 ifdef EXTRA_LD_OPTIONS
580 LD.Flags += $(EXTRA_LD_OPTIONS)
584 CompileCommonOpts += -pedantic -Wno-long-long
586 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
588 # Enable cast-qual for C++; the workaround is to use const_cast.
589 CXX.Flags += -Wcast-qual
591 ifeq ($(HOST_OS),HP-UX)
592 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
595 # If we are building a universal binary on Mac OS/X, pass extra options. This
596 # is useful to people that want to link the LLVM libraries into their universal
599 # The following can be optionally specified:
600 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
601 # For Mac OS/X 10.4 Intel machines, the traditional one is:
602 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
603 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
604 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
607 ifndef UNIVERSAL_ARCH
608 UNIVERSAL_ARCH := i386 ppc
610 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
611 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
612 ifdef UNIVERSAL_SDK_PATH
613 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
616 # Building universal cannot compute dependencies automatically.
617 DISABLE_AUTO_DEPENDENCIES=1
619 ifeq ($(TARGET_OS),Darwin)
620 ifeq ($(ARCH),x86_64)
621 TargetCommonOpts = -m64
624 TargetCommonOpts = -m32
630 ifeq ($(HOST_OS),SunOS)
631 CPP.BaseFlags += -include llvm/Support/Solaris.h
634 ifeq ($(HOST_OS),AuroraUX)
635 CPP.BaseFlags += -include llvm/Support/Solaris.h
636 endif # !HOST_OS - AuroraUX.
638 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
639 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
640 # All -I flags should go here, so that they don't confuse llvm-config.
641 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
642 $(patsubst %,-I%/include,\
643 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
644 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
647 # SHOW_DIAGNOSTICS support.
648 ifeq ($(SHOW_DIAGNOSTICS),1)
649 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
650 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
655 ifeq ($(BUILD_COMPONENT), 1)
656 Compile.C = $(Compile.Wrapper) \
657 $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
658 $(TargetCommonOpts) $(CompileCommonOpts) -c
659 Compile.CXX = $(Compile.Wrapper) \
660 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
662 $(TargetCommonOpts) $(CompileCommonOpts) -c
663 Preprocess.CXX= $(Compile.Wrapper) \
664 $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \
665 $(CompileCommonOpts) $(CXX.Flags) -E
666 Link = $(Compile.Wrapper) \
667 $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \
668 $(LD.Flags) $(LDFLAGS) \
669 $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
671 Compile.C = $(Compile.Wrapper) \
672 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
673 $(TargetCommonOpts) $(CompileCommonOpts) -c
674 Compile.CXX = $(Compile.Wrapper) \
675 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
676 $(TargetCommonOpts) $(CompileCommonOpts) -c
677 Preprocess.CXX= $(Compile.Wrapper) \
678 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
679 $(CompileCommonOpts) $(CXX.Flags) -E
680 Link = $(Compile.Wrapper) \
681 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
682 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
685 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
686 $(TargetCommonOpts) $(CompileCommonOpts)
687 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
688 $(TargetCommonOpts) $(CompileCommonOpts) -E
690 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
691 $(TargetCommonOpts) $(CompileCommonOpts)
693 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
694 ScriptInstall = $(INSTALL) -m 0755
695 DataInstall = $(INSTALL) -m 0644
697 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
698 # paths. In this case, the SYSPATH function (defined in
699 # Makefile.config) transforms Unix paths into Windows paths.
700 TableGen = $(TBLGEN) -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
701 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
702 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
703 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
705 Archive = $(AR) $(AR.Flags)
706 LArchive = $(LLVMToolDir)/llvm-ar rcsf
715 #----------------------------------------------------------
716 # Get the list of source files and compute object file
718 #----------------------------------------------------------
721 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
722 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
724 Sources := $(SOURCES)
728 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
731 BaseNameSources := $(sort $(basename $(Sources)))
733 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
734 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
736 #----------------------------------------------------------
737 # For Mingw MSYS bash and Python/w32:
739 # $(ECHOPATH) prints DOSish pathstring.
740 # ex) $(ECHOPATH) /include/sys/types.h
741 # --> C:/mingw/include/sys/types.h
742 # built-in "echo" does not transform path to DOSish path.
744 # FIXME: It would not be needed when MSYS's python
746 #----------------------------------------------------------
748 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
749 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
751 ECHOPATH := $(Verb)$(ECHO)
754 ###############################################################################
755 # DIRECTORIES: Handle recursive descent of directory structure
756 ###############################################################################
758 #---------------------------------------------------------
759 # Provide rules to make install dirs. This must be early
760 # in the file so they get built before dependencies
761 #---------------------------------------------------------
763 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
766 # To create other directories, as needed, and timestamp their creation
768 $(Verb) $(MKDIR) $* > /dev/null
769 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
771 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
772 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
774 #---------------------------------------------------------
775 # Handle the DIRS options for sequential construction
776 #---------------------------------------------------------
782 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
783 $(RecursiveTargets)::
784 $(Verb) for dir in $(DIRS); do \
785 if ([ ! -f $$dir/Makefile ] || \
786 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
788 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
790 ($(MAKE) -C $$dir $@ ) || exit 1; \
793 $(RecursiveTargets)::
794 $(Verb) for dir in $(DIRS); do \
795 ($(MAKE) -C $$dir $@ ) || exit 1; \
801 #---------------------------------------------------------
802 # Handle the EXPERIMENTAL_DIRS options ensuring success
803 # after each directory is built.
804 #---------------------------------------------------------
805 ifdef EXPERIMENTAL_DIRS
806 $(RecursiveTargets)::
807 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
808 if ([ ! -f $$dir/Makefile ] || \
809 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
811 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
813 ($(MAKE) -C $$dir $@ ) || exit 0; \
817 #-----------------------------------------------------------
818 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
819 #-----------------------------------------------------------
820 ifdef OPTIONAL_PARALLEL_DIRS
821 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)"))
824 #-----------------------------------------------------------
825 # Handle the PARALLEL_DIRS options for parallel construction
826 #-----------------------------------------------------------
829 SubDirs += $(PARALLEL_DIRS)
831 # Unfortunately, this list must be maintained if new recursive targets are added
832 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
833 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
834 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
835 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
836 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
837 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
838 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
840 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
843 $(Verb) if ([ ! -f $(@D)/Makefile ] || \
844 command test $(@D)/Makefile -ot \
845 $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \
847 $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
849 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@)
852 #---------------------------------------------------------
853 # Handle the OPTIONAL_DIRS options for directores that may
855 #---------------------------------------------------------
858 SubDirs += $(OPTIONAL_DIRS)
860 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
861 $(RecursiveTargets)::
862 $(Verb) for dir in $(OPTIONAL_DIRS); do \
863 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
864 if ([ ! -f $$dir/Makefile ] || \
865 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
867 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
869 ($(MAKE) -C$$dir $@ ) || exit 1; \
873 $(RecursiveTargets)::
874 $(Verb) for dir in $(OPTIONAL_DIRS); do \
875 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
876 ($(MAKE) -C$$dir $@ ) || exit 1; \
882 #---------------------------------------------------------
883 # Handle the CONFIG_FILES options
884 #---------------------------------------------------------
889 $(Echo) Install circumvented with NO_INSTALL
891 $(Echo) UnInstall circumvented with NO_INSTALL
893 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
894 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
895 $(Verb)for file in $(CONFIG_FILES); do \
896 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
897 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
898 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
899 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
901 $(ECHO) Error: cannot find config file $${file}. ; \
906 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
907 $(Verb)for file in $(CONFIG_FILES); do \
908 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
914 ###############################################################################
915 # Set up variables for building libraries
916 ###############################################################################
918 #---------------------------------------------------------
919 # Define various command line options pertaining to the
920 # libraries needed when linking. There are "Proj" libs
921 # (defined by the user's project) and "LLVM" libs (defined
922 # by the LLVM project).
923 #---------------------------------------------------------
926 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
927 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
928 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
929 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
933 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
934 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
935 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
936 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
939 # Loadable module for Win32 requires all symbols resolved for linking.
940 # Then all symbols in LLVM.dll will be available.
941 ifeq ($(ENABLE_SHARED),1)
942 ifdef LOADABLE_MODULE
943 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
944 LINK_COMPONENTS += all
949 ifndef IS_CLEANING_TARGET
950 ifdef LINK_COMPONENTS
952 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
953 # clean in tools, then do a make in tools (instead of at the top level).
955 @echo "*** llvm-config doesn't exist - rebuilding it."
956 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
958 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
960 ifeq ($(ENABLE_SHARED), 1)
961 # We can take the "auto-import" feature to get rid of using dllimport.
962 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
963 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
966 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
967 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
970 ifndef NO_LLVM_CONFIG
971 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
972 ifeq ($(LLVMConfigLibs),Error)
973 $(error llvm-config --libs failed)
975 LLVMLibsOptions += $(LLVMConfigLibs)
976 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
977 ifeq ($(LLVMConfigLibfiles),Error)
978 $(error llvm-config --libfiles failed)
980 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
987 # Set up the library exports file.
988 ifdef EXPORTED_SYMBOL_FILE
990 # First, set up the native export file, which may differ from the source
993 ifeq ($(HOST_OS),Darwin)
994 # Darwin convention prefixes symbols with underscores.
995 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
996 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
997 $(Verb) sed -e 's/^/_/' < $< > $@
999 -$(Verb) $(RM) -f $(NativeExportsFile)
1001 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1002 # Gold and BFD ld require a version script rather than a plain list.
1003 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1004 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1005 $(Verb) echo "{" > $@
1006 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1007 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1008 ifneq ($(HOST_OS),OpenBSD)
1009 $(Verb) echo " local: *;" >> $@
1011 $(Verb) echo "};" >> $@
1013 -$(Verb) $(RM) -f $(NativeExportsFile)
1015 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1016 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1017 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1018 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1019 $(Echo) Generating $(notdir $@)
1020 $(Verb) $(ECHO) "EXPORTS" > $@
1021 $(Verb) $(CAT) $< >> $@
1023 -$(Verb) $(RM) -f $(NativeExportsFile)
1025 # Default behavior: just use the exports file verbatim.
1026 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1031 # Now add the linker command-line options to use the native export file.
1034 ifeq ($(HOST_OS),Darwin)
1035 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1038 # gold, bfd ld, etc.
1039 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1040 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1044 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1045 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1046 SharedLinkOptions += $(NativeExportsFile)
1051 ###############################################################################
1052 # Library Build Rules: Four ways to build a library
1053 ###############################################################################
1055 #---------------------------------------------------------
1056 # Bytecode Module Targets:
1057 # If the user set MODULE_NAME then they want to build a
1058 # bytecode module from the sources. We compile all the
1059 # sources and link it together into a single bytecode
1061 #---------------------------------------------------------
1064 ifeq ($(strip $(LLVMCC)),)
1065 $(warning Modules require LLVM capable compiler but none is available ****)
1068 Module := $(LibDir)/$(MODULE_NAME).bc
1069 LinkModule := $(LLVMLD) -r
1072 ifdef EXPORTED_SYMBOL_FILE
1073 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1076 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1077 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1078 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1080 all-local:: $(Module)
1083 ifneq ($(strip $(Module)),)
1084 -$(Verb) $(RM) -f $(Module)
1087 ifdef BYTECODE_DESTINATION
1088 ModuleDestDir := $(BYTECODE_DESTINATION)
1090 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1095 $(Echo) Install circumvented with NO_INSTALL
1097 $(Echo) Uninstall circumvented with NO_INSTALL
1099 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1101 install-module:: $(DestModule)
1102 install-local:: $(DestModule)
1104 $(DestModule): $(ModuleDestDir) $(Module)
1105 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1106 $(Verb) $(DataInstall) $(Module) $(DestModule)
1109 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1110 -$(Verb) $(RM) -f $(DestModule)
1116 # if we're building a library ...
1119 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1120 LIBRARYNAME := $(strip $(LIBRARYNAME))
1121 ifdef LOADABLE_MODULE
1122 BaseLibName.A := $(LIBRARYNAME).a
1123 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1125 BaseLibName.A := lib$(LIBRARYNAME).a
1126 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1128 LibName.A := $(LibDir)/$(BaseLibName.A)
1129 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1130 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1131 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1133 #---------------------------------------------------------
1134 # Shared Library Targets:
1135 # If the user asked for a shared library to be built
1136 # with the SHARED_LIBRARY variable, then we provide
1137 # targets for building them.
1138 #---------------------------------------------------------
1139 ifdef SHARED_LIBRARY
1141 all-local:: $(LibName.SO)
1143 ifdef EXPORTED_SYMBOL_FILE
1144 $(LibName.SO): $(NativeExportsFile)
1147 ifdef LINK_LIBS_IN_SHARED
1148 ifdef LOADABLE_MODULE
1149 SharedLibKindMessage := "Loadable Module"
1150 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1152 SharedLibKindMessage := "Shared Library"
1154 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1155 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1157 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1158 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1160 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1161 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1162 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1166 ifneq ($(strip $(LibName.SO)),)
1167 -$(Verb) $(RM) -f $(LibName.SO)
1172 $(Echo) Install circumvented with NO_INSTALL
1174 $(Echo) Uninstall circumvented with NO_INSTALL
1177 # Win32.DLL prefers to be located on the "PATH" of binaries.
1178 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1179 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1181 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1183 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1185 install-local:: $(DestSharedLib)
1187 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1188 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1189 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1192 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1193 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1197 #---------------------------------------------------------
1198 # Bytecode Library Targets:
1199 # If the user asked for a bytecode library to be built
1200 # with the BYTECODE_LIBRARY variable, then we provide
1201 # targets for building them.
1202 #---------------------------------------------------------
1203 ifdef BYTECODE_LIBRARY
1204 ifeq ($(strip $(LLVMCC)),)
1205 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1208 all-local:: $(LibName.BCA)
1210 ifdef EXPORTED_SYMBOL_FILE
1211 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1213 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1214 $(LLVMToolDir)/llvm-ar
1215 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1217 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1219 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1221 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1222 $(LLVMToolDir)/llvm-ar
1223 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1225 $(Verb) $(LArchive) $@ $(ObjectsBC)
1230 ifneq ($(strip $(LibName.BCA)),)
1231 -$(Verb) $(RM) -f $(LibName.BCA)
1234 ifdef BYTECODE_DESTINATION
1235 BytecodeDestDir := $(BYTECODE_DESTINATION)
1237 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1240 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1242 install-bytecode-local:: $(DestBytecodeLib)
1246 $(Echo) Install circumvented with NO_INSTALL
1248 $(Echo) Uninstall circumvented with NO_INSTALL
1250 install-local:: $(DestBytecodeLib)
1252 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1253 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1254 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1257 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1258 -$(Verb) $(RM) -f $(DestBytecodeLib)
1263 #---------------------------------------------------------
1265 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1266 # building an archive.
1267 #---------------------------------------------------------
1268 ifndef NO_BUILD_ARCHIVE
1269 ifndef BUILD_ARCHIVE
1270 ifndef LOADABLE_MODULE
1276 #---------------------------------------------------------
1277 # Archive Library Targets:
1278 # If the user wanted a regular archive library built,
1279 # then we provide targets for building them.
1280 #---------------------------------------------------------
1283 all-local:: $(LibName.A)
1285 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1286 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1287 -$(Verb) $(RM) -f $@
1288 $(Verb) $(Archive) $@ $(ObjectsO)
1289 $(Verb) $(Ranlib) $@
1292 ifneq ($(strip $(LibName.A)),)
1293 -$(Verb) $(RM) -f $(LibName.A)
1298 $(Echo) Install circumvented with NO_INSTALL
1300 $(Echo) Uninstall circumvented with NO_INSTALL
1302 ifdef NO_INSTALL_ARCHIVES
1304 $(Echo) Install circumvented with NO_INSTALL
1306 $(Echo) Uninstall circumvented with NO_INSTALL
1308 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1310 install-local:: $(DestArchiveLib)
1312 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1313 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1314 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1315 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1318 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1319 -$(Verb) $(RM) -f $(DestArchiveLib)
1327 ###############################################################################
1328 # Tool Build Rules: Build executable tool based on TOOLNAME option
1329 ###############################################################################
1333 #---------------------------------------------------------
1334 # Set up variables for building a tool.
1335 #---------------------------------------------------------
1336 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1338 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1340 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1343 # TOOLALIAS is a name to symlink (or copy) the tool to.
1346 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1348 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1352 #---------------------------------------------------------
1354 #---------------------------------------------------------
1356 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1357 # not exporting all of the weak symbols from the binary. This reduces dyld
1358 # startup time by 4x on darwin in some cases.
1359 ifdef TOOL_NO_EXPORTS
1360 ifeq ($(HOST_OS),Darwin)
1362 # Tiger tools don't support this.
1363 ifneq ($(DARWIN_MAJVERS),4)
1364 LD.Flags += -Wl,-exported_symbol,_main
1368 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1369 ifneq ($(ARCH), Mips)
1370 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1375 #---------------------------------------------------------
1376 # Tool Order File Support
1377 #---------------------------------------------------------
1379 ifeq ($(HOST_OS),Darwin)
1380 ifdef TOOL_ORDER_FILE
1382 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1387 #---------------------------------------------------------
1388 # Tool Version Info Support
1389 #---------------------------------------------------------
1391 ifeq ($(HOST_OS),Darwin)
1392 ifdef TOOL_INFO_PLIST
1394 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1396 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1398 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1399 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1400 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1401 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1402 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1403 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1409 #---------------------------------------------------------
1410 # Provide targets for building the tools
1411 #---------------------------------------------------------
1412 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1415 ifneq ($(strip $(ToolBuildPath)),)
1416 -$(Verb) $(RM) -f $(ToolBuildPath)
1418 ifneq ($(strip $(ToolAliasBuildPath)),)
1419 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1423 $(ToolBuildPath): $(ExmplDir)/.dir
1425 $(ToolBuildPath): $(ToolDir)/.dir
1428 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1429 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1430 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1431 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1432 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1435 ifneq ($(strip $(ToolAliasBuildPath)),)
1436 $(ToolAliasBuildPath): $(ToolBuildPath)
1437 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1438 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1439 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1440 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1446 $(Echo) Install circumvented with NO_INSTALL
1448 $(Echo) Uninstall circumvented with NO_INSTALL
1450 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1452 install-local:: $(DestTool)
1454 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1455 $(Echo) Installing $(BuildMode) $(DestTool)
1456 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1459 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1460 -$(Verb) $(RM) -f $(DestTool)
1462 # TOOLALIAS install.
1464 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1466 install-local:: $(DestToolAlias)
1468 $(DestToolAlias): $(DestTool)
1469 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1470 $(Verb) $(RM) -f $(DestToolAlias)
1471 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1474 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1475 -$(Verb) $(RM) -f $(DestToolAlias)
1481 ###############################################################################
1482 # Object Build Rules: Build object files based on sources
1483 ###############################################################################
1485 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1486 ifeq ($(HOST_OS),HP-UX)
1487 DISABLE_AUTO_DEPENDENCIES=1
1490 # Provide rule sets for when dependency generation is enabled
1491 ifndef DISABLE_AUTO_DEPENDENCIES
1493 #---------------------------------------------------------
1494 # Create .o files in the ObjDir directory from the .cpp and .c files...
1495 #---------------------------------------------------------
1497 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1498 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1500 # If the build succeeded, move the dependency file over, otherwise
1502 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1503 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1505 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1506 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1507 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1510 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1511 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1512 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1515 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1516 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1517 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1520 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1521 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1522 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1525 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1526 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1527 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1530 #---------------------------------------------------------
1531 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1532 #---------------------------------------------------------
1534 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1535 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1537 # If the build succeeded, move the dependency file over, otherwise
1539 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1540 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1542 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1543 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1544 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1545 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1546 $(BC_DEPEND_MOVEFILE)
1548 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1549 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1550 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1551 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1552 $(BC_DEPEND_MOVEFILE)
1554 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1555 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1556 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1557 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1558 $(BC_DEPEND_MOVEFILE)
1560 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1561 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1562 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1563 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1564 $(BC_DEPEND_MOVEFILE)
1566 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1567 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1568 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1569 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1570 $(BC_DEPEND_MOVEFILE)
1572 # Provide alternate rule sets if dependencies are disabled
1575 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1576 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1577 $(Compile.CXX) $< -o $@
1579 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1580 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1581 $(Compile.CXX) $< -o $@
1583 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1584 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1585 $(Compile.CXX) $< -o $@
1587 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1588 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1589 $(Compile.C) $< -o $@
1591 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1592 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1593 $(Compile.C) $< -o $@
1595 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1596 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1597 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1599 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1600 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1601 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1603 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1604 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1605 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1607 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1608 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1609 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1611 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1612 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1613 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1618 ## Rules for building preprocessed (.i/.ii) outputs.
1619 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1620 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1621 $(Verb) $(Preprocess.CXX) $< -o $@
1623 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1624 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1625 $(Verb) $(Preprocess.CXX) $< -o $@
1627 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1628 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1629 $(Verb) $(Preprocess.CXX) $< -o $@
1631 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1632 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1633 $(Verb) $(Preprocess.C) $< -o $@
1635 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1636 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1637 $(Verb) $(Preprocess.C) $< -o $@
1640 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1641 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1642 $(Compile.CXX) $< -o $@ -S
1644 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1645 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1646 $(Compile.CXX) $< -o $@ -S
1648 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1649 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1650 $(Compile.CXX) $< -o $@ -S
1652 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1653 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1654 $(Compile.C) $< -o $@ -S
1656 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1657 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1658 $(Compile.C) $< -o $@ -S
1661 # make the C and C++ compilers strip debug info out of bytecode libraries.
1663 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1664 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1665 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1667 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1668 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1669 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1673 #---------------------------------------------------------
1674 # Provide rule to build .bc files from .ll sources,
1675 # regardless of dependencies
1676 #---------------------------------------------------------
1677 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1678 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1679 $(Verb) $(LLVMAS) $< -f -o $@
1681 ###############################################################################
1682 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1683 ###############################################################################
1686 TABLEGEN_INC_FILES_COMMON = 1
1689 ifdef LLVMC_BASED_DRIVER
1690 TABLEGEN_INC_FILES_COMMON = 1
1693 ifdef TABLEGEN_INC_FILES_COMMON
1695 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1696 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1697 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1699 # INCFiles rule: All of the tblgen generated files are emitted to
1700 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1701 # us to only "touch" the real file if the contents of it change. IOW, if
1702 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1703 # dependencies of the .inc files are, unless the contents of the .inc file
1705 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1706 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1708 endif # TABLEGEN_INC_FILES_COMMON
1712 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1713 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1714 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1715 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1716 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1717 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1718 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1720 # All of these files depend on tblgen and the .td files.
1721 $(INCTMPFiles) : $(TBLGEN) $(TDFiles)
1723 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1724 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir
1725 $(Echo) "Building $(<F) register info implementation with tblgen"
1726 $(Verb) $(TableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1728 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1729 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir
1730 $(Echo) "Building $(<F) instruction information with tblgen"
1731 $(Verb) $(TableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1733 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1734 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir
1735 $(Echo) "Building $(<F) assembly writer with tblgen"
1736 $(Verb) $(TableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1738 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1739 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir
1740 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1741 $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1743 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1744 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir
1745 $(Echo) "Building $(<F) assembly matcher with tblgen"
1746 $(Verb) $(TableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1748 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1749 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir
1750 $(Echo) "Building $(<F) MC code emitter with tblgen"
1751 $(Verb) $(TableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1753 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1754 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir
1755 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1756 $(Verb) $(TableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1758 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1759 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir
1760 $(Echo) "Building $(<F) code emitter with tblgen"
1761 $(Verb) $(TableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1763 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1764 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
1765 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1766 $(Verb) $(TableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1768 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1769 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir
1770 $(Echo) "Building $(<F) disassembly tables with tblgen"
1771 $(Verb) $(TableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1773 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1774 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir
1775 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1776 $(Verb) $(TableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1778 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1779 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir
1780 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1781 $(Verb) $(TableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1783 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1784 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir
1785 $(Echo) "Building $(<F) subtarget information with tblgen"
1786 $(Verb) $(TableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1788 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1789 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir
1790 $(Echo) "Building $(<F) calling convention information with tblgen"
1791 $(Verb) $(TableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1793 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1794 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir
1795 $(Echo) "Building $(<F) intrinsics information with tblgen"
1796 $(Verb) $(TableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1798 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir
1799 $(Echo) "Building $(<F) decoder tables with tblgen"
1800 $(Verb) $(TableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1804 -$(Verb) $(RM) -f $(INCFiles)
1808 ifdef LLVMC_BASED_DRIVER
1810 TDSrc := $(sort $(strip $(wildcard $(PROJ_SRC_DIR)/*.td)) \
1811 $(strip $(wildcard $(PROJ_OBJ_DIR)/*.td)))
1813 TDCommon := $(strip $(wildcard \
1814 $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
1816 TDFiles := $(TDSrc) $(TDCommon)
1818 $(INCTMPFiles) : $(TBLGEN) $(TDFiles)
1820 $(ObjDir)/%.inc.tmp: %.td $(ObjDir)/.dir
1821 $(Echo) "Building LLVMC compilation graph description with tblgen"
1822 $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
1825 -$(Verb) $(RM) -f $(INCFiles)
1827 endif # LLVMC_BASED_DRIVER
1829 ###############################################################################
1830 # OTHER RULES: Other rules needed
1831 ###############################################################################
1833 # To create postscript files from dot files...
1834 ifneq ($(DOT),false)
1836 $(DOT) -Tps < $< > $@
1839 $(Echo) "Cannot build $@: The program dot is not installed"
1842 # This rules ensures that header files that are removed still have a rule for
1843 # which they can be "generated." This allows make to ignore them and
1844 # reproduce the dependency lists.
1848 # Define clean-local to clean the current directory. Note that this uses a
1849 # very conservative approach ensuring that empty variables do not cause
1850 # errors or disastrous removal.
1852 ifneq ($(strip $(ObjRootDir)),)
1853 -$(Verb) $(RM) -rf $(ObjRootDir)
1855 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
1856 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1857 -$(Verb) $(RM) -f *$(SHLIBEXT)
1861 -$(Verb) $(RM) -rf Debug Release Profile
1864 ###############################################################################
1865 # DEPENDENCIES: Include the dependency files if we should
1866 ###############################################################################
1867 ifndef DISABLE_AUTO_DEPENDENCIES
1869 # If its not one of the cleaning targets
1870 ifndef IS_CLEANING_TARGET
1872 # Get the list of dependency files
1873 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1874 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1876 # Include bitcode dependency files if using bitcode libraries
1877 ifdef BYTECODE_LIBRARY
1878 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1881 -include $(DependFiles) ""
1887 ###############################################################################
1888 # CHECK: Running the test suite
1889 ###############################################################################
1892 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1893 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1894 $(EchoCmd) Running test suite ; \
1895 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1896 TESTSUITE=$(TESTSUITE) ; \
1898 $(EchoCmd) No Makefile in test directory ; \
1901 $(EchoCmd) No test directory ; \
1907 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1908 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1909 $(EchoCmd) Running test suite ; \
1910 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1912 $(EchoCmd) No Makefile in test directory ; \
1915 $(EchoCmd) No test directory ; \
1919 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1920 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1921 $(EchoCmd) Running test suite ; \
1922 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1924 $(EchoCmd) No Makefile in test directory ; \
1927 $(EchoCmd) No test directory ; \
1930 ###############################################################################
1931 # UNITTESTS: Running the unittests test suite
1932 ###############################################################################
1935 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1936 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1937 $(EchoCmd) Running unittests test suite ; \
1938 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1940 $(EchoCmd) No Makefile in unittests directory ; \
1943 $(EchoCmd) No unittests directory ; \
1946 ###############################################################################
1947 # DISTRIBUTION: Handle construction of a distribution tarball
1948 ###############################################################################
1950 #------------------------------------------------------------------------
1951 # Define distribution related variables
1952 #------------------------------------------------------------------------
1953 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1954 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1955 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1956 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1957 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1958 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1959 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1960 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1961 Makefile.config.in configure autoconf
1962 DistOther := $(notdir $(wildcard \
1963 $(PROJ_SRC_DIR)/*.h \
1964 $(PROJ_SRC_DIR)/*.td \
1965 $(PROJ_SRC_DIR)/*.def \
1966 $(PROJ_SRC_DIR)/*.ll \
1967 $(PROJ_SRC_DIR)/*.in))
1968 DistSubDirs := $(SubDirs)
1969 DistSources = $(Sources) $(EXTRA_DIST)
1970 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1972 #------------------------------------------------------------------------
1973 # We MUST build distribution with OBJ_DIR != SRC_DIR
1974 #------------------------------------------------------------------------
1975 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
1976 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1977 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
1981 #------------------------------------------------------------------------
1982 # Prevent attempt to run dist targets from anywhere but the top level
1983 #------------------------------------------------------------------------
1985 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1986 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
1989 #------------------------------------------------------------------------
1990 # Provide the top level targets
1991 #------------------------------------------------------------------------
1993 dist-gzip:: $(DistTarGZip)
1995 $(DistTarGZip) : $(TopDistDir)/.makedistdir
1996 $(Echo) Packing gzipped distribution tar file.
1997 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1998 $(GZIP) -c > "$(DistTarGZip)"
2000 dist-bzip2:: $(DistTarBZ2)
2002 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2003 $(Echo) Packing bzipped distribution tar file.
2004 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2005 $(BZIP2) -c >$(DistTarBZ2)
2007 dist-zip:: $(DistZip)
2009 $(DistZip) : $(TopDistDir)/.makedistdir
2010 $(Echo) Packing zipped distribution file.
2011 $(Verb) rm -f $(DistZip)
2012 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2014 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2015 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2017 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2019 dist-check:: $(DistTarGZip)
2020 $(Echo) Checking distribution tar file.
2021 $(Verb) if test -d $(DistCheckDir) ; then \
2022 $(RM) -rf $(DistCheckDir) ; \
2024 $(Verb) $(MKDIR) $(DistCheckDir)
2025 $(Verb) cd $(DistCheckDir) && \
2026 $(MKDIR) $(DistCheckDir)/build && \
2027 $(MKDIR) $(DistCheckDir)/install && \
2028 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2030 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2031 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2034 $(MAKE) unittests && \
2035 $(MAKE) install && \
2036 $(MAKE) uninstall && \
2037 $(MAKE) dist-clean && \
2038 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2041 $(Echo) Cleaning distribution files
2042 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2047 #------------------------------------------------------------------------
2048 # Provide the recursive distdir target for building the distribution directory
2049 #------------------------------------------------------------------------
2050 distdir: $(DistDir)/.makedistdir
2051 $(DistDir)/.makedistdir: $(DistSources)
2052 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2053 if test -d "$(DistDir)" ; then \
2054 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2057 $(EchoCmd) Removing old $(DistDir) ; \
2058 $(RM) -rf $(DistDir); \
2059 $(EchoCmd) Making 'all' to verify build ; \
2060 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2062 $(Echo) Building Distribution Directory $(DistDir)
2063 $(Verb) $(MKDIR) $(DistDir)
2064 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2065 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2066 for file in $(DistFiles) ; do \
2068 $(PROJ_SRC_DIR)/*) \
2069 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2071 $(PROJ_SRC_ROOT)/*) \
2072 file=`echo "$$file" | \
2073 sed "s#^$$srcrootstrip/##"` \
2076 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2077 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2078 from_dir="$(PROJ_SRC_DIR)" ; \
2079 elif test -f "$$file" || test -d "$$file" ; then \
2082 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2083 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2084 to_dir="$(DistDir)/$$dir"; \
2085 $(MKDIR) "$$to_dir" ; \
2087 to_dir="$(DistDir)"; \
2089 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2090 if test -n "$$mid_dir" ; then \
2091 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2093 if test -d "$$from_dir/$$file"; then \
2094 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2095 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2096 cd $(PROJ_SRC_DIR) ; \
2097 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2098 ( cd $$to_dir ; $(TAR) xf - ) ; \
2099 cd $(PROJ_OBJ_DIR) ; \
2102 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2103 ( cd $$to_dir ; $(TAR) xf - ) ; \
2104 cd $(PROJ_OBJ_DIR) ; \
2106 elif test -f "$$from_dir/$$file" ; then \
2107 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2108 elif test -L "$$from_dir/$$file" ; then \
2109 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2110 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2111 $(EchoCmd) "===== WARNING: Distribution Source " \
2112 "$$from_dir/$$file Not Found!" ; \
2113 elif test "$(Verb)" != '@' ; then \
2114 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2117 $(Verb) for subdir in $(DistSubDirs) ; do \
2118 if test "$$subdir" \!= "." ; then \
2119 new_distdir="$(DistDir)/$$subdir" ; \
2120 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2121 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2122 DistDir="$$new_distdir" distdir ) || exit 1; \
2125 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2126 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2127 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2128 -name .svn \) -print` ;\
2129 $(MAKE) dist-hook ; \
2130 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2131 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2132 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2133 -o ! -type d ! -perm -444 -exec \
2134 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2135 || chmod -R a+r $(DistDir) ; \
2138 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2144 ###############################################################################
2145 # TOP LEVEL - targets only to apply at the top level directory
2146 ###############################################################################
2150 #------------------------------------------------------------------------
2151 # Install support for the project's include files:
2152 #------------------------------------------------------------------------
2155 $(Echo) Install circumvented with NO_INSTALL
2157 $(Echo) Uninstall circumvented with NO_INSTALL
2160 $(Echo) Installing include files
2161 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2162 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2163 cd $(PROJ_SRC_ROOT)/include && \
2164 for hdr in `find . -type f \
2165 '(' -name LICENSE.TXT \
2170 ')' -print | grep -v CVS | \
2171 grep -v .svn` ; do \
2172 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2173 if test \! -d "$$instdir" ; then \
2174 $(EchoCmd) Making install directory $$instdir ; \
2175 $(MKDIR) $$instdir ;\
2177 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2180 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2181 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2182 cd $(PROJ_OBJ_ROOT)/include && \
2183 for hdr in `find . -type f \
2184 '(' -name LICENSE.TXT \
2189 ')' -print | grep -v CVS | \
2190 grep -v .svn` ; do \
2191 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2192 if test \! -d "$$instdir" ; then \
2193 $(EchoCmd) Making install directory $$instdir ; \
2194 $(MKDIR) $$instdir ;\
2196 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2202 $(Echo) Uninstalling include files
2203 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2204 cd $(PROJ_SRC_ROOT)/include && \
2205 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2206 '!' '(' -name '*~' -o -name '.#*' \
2207 -o -name '*.in' ')' -print ')' | \
2208 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2209 cd $(PROJ_SRC_ROOT)/include && \
2210 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2211 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2217 @echo searching for overlength lines in files: $(Sources)
2220 egrep -n '.{81}' $(Sources) /dev/null
2223 @echo searching for tabs in files: $(Sources)
2226 egrep -n ' ' $(Sources) /dev/null
2229 @ls -l $(LibDir) | awk '\
2230 BEGIN { sum = 0; } \
2232 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2233 @ls -l $(ToolDir) | awk '\
2234 BEGIN { sum = 0; } \
2236 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2237 #------------------------------------------------------------------------
2238 # Print out the directories used for building
2239 #------------------------------------------------------------------------
2241 $(Echo) "BuildMode : " '$(BuildMode)'
2242 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2243 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2244 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2245 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2246 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2247 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2248 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2249 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2250 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2251 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2252 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2253 $(Echo) "UserTargets : " '$(UserTargets)'
2254 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2255 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2256 $(Echo) "ObjDir : " '$(ObjDir)'
2257 $(Echo) "LibDir : " '$(LibDir)'
2258 $(Echo) "ToolDir : " '$(ToolDir)'
2259 $(Echo) "ExmplDir : " '$(ExmplDir)'
2260 $(Echo) "Sources : " '$(Sources)'
2261 $(Echo) "TDFiles : " '$(TDFiles)'
2262 $(Echo) "INCFiles : " '$(INCFiles)'
2263 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2264 $(Echo) "PreConditions: " '$(PreConditions)'
2265 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2266 $(Echo) "Compile.C : " '$(Compile.C)'
2267 $(Echo) "Archive : " '$(Archive)'
2268 $(Echo) "YaccFiles : " '$(YaccFiles)'
2269 $(Echo) "LexFiles : " '$(LexFiles)'
2270 $(Echo) "Module : " '$(Module)'
2271 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2272 $(Echo) "SubDirs : " '$(SubDirs)'
2273 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2274 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2279 # General debugging rule, use 'make dbg-print-XXX' to print the
2280 # definition, value and origin of XXX.
2282 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))