1 #===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 # This file is included by all of the LLVM makefiles. For details on how to use
11 # it properly, please see the document MakefileGuide.html in the docs directory.
13 #===-----------------------------------------------------------------------====#
15 ################################################################################
16 # TARGETS: Define standard targets that can be invoked
17 ################################################################################
19 #--------------------------------------------------------------------
20 # Define the various target sets
21 #--------------------------------------------------------------------
22 RecursiveTargets := all clean clean-all install uninstall install-bytecode \
24 LocalTargets := all-local clean-local clean-all-local check-local \
25 install-local printvars uninstall-local \
26 install-bytecode-local
27 TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \
29 UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
30 InternalTargets := preconditions distdir dist-hook
32 ################################################################################
33 # INITIALIZATION: Basic things the makefile needs
34 ################################################################################
36 #--------------------------------------------------------------------
37 # Set the VPATH so that we can find source files.
38 #--------------------------------------------------------------------
41 #--------------------------------------------------------------------
42 # Reset the list of suffixes we know how to build.
43 #--------------------------------------------------------------------
45 .SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm
46 .SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
48 #--------------------------------------------------------------------
49 # Mark all of these targets as phony to avoid implicit rule search
50 #--------------------------------------------------------------------
51 .PHONY: $(UserTargets) $(InternalTargets)
53 #--------------------------------------------------------------------
54 # Make sure all the user-target rules are double colon rules and
55 # they are defined first.
56 #--------------------------------------------------------------------
60 #------------------------------------------------------------------------
61 # LLVMBuild Integration
62 #------------------------------------------------------------------------
64 # We use llvm-build to generate all the data required by the Makefile based
65 # build system in one swoop:
67 # - We generate a file (a Makefile fragment) in the object root which contains
68 # all the definitions that are required by Makefiles across the entire
71 # - We generate the library table used by llvm-config.
73 # - We generate the dependencies for the Makefile fragment, so that we will
74 # automatically reconfigure outselves.
76 # The path to the llvm-build tool itself.
77 LLVMBuildTool := $(PROJ_SRC_ROOT)/utils/llvm-build/llvm-build
79 # The files we are going to generate using llvm-build.
80 LLVMBuildMakeFrag := $(PROJ_OBJ_ROOT)/Makefile.llvmbuild
81 LLVMConfigLibraryDependenciesInc := \
82 $(PROJ_OBJ_ROOT)/tools/llvm-config-2/LibraryDependencies.inc
84 # This is for temporary backwards compatibility.
85 ifndef TARGET_NATIVE_ARCH
86 TARGET_NATIVE_ARCH := $(ARCH)
89 # The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
92 # Note that this target gets its real dependencies generated for us by
95 # We include a dependency on this Makefile to ensure that changes to the
96 # generation command get picked up.
97 $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules
98 $(Echo) Constructing LLVMBuild project information.
99 $(Verb) $(LLVMBuildTool) \
100 --native-target "$(TARGET_NATIVE_ARCH)" \
101 --enable-targets "$(TARGETS_TO_BUILD)" \
102 --write-library-table $(LLVMConfigLibraryDependenciesInc) \
103 --write-make-fragment $(LLVMBuildMakeFrag)
105 # For completeness, let Make know how the extra files are generated.
106 $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag)
108 # Include the generated Makefile fragment.
110 # We currently only include the dependencies for the fragment itself if we are
111 # at the top-level. Otherwise, recursive invocations would ends up doing
112 # substantially more redundant stat'ing.
114 # This means that we won't properly regenerate things for developers used to
115 # building from a subdirectory, but that is always somewhat unreliable.
117 LLVMBUILD_INCLUDE_DEPENDENCIES := 1
119 -include $(LLVMBuildMakeFrag)
121 ################################################################################
122 # PRECONDITIONS: that which must be built/checked first
123 ################################################################################
125 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
126 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
127 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
128 ConfigureScript := $(PROJ_SRC_ROOT)/configure
129 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
130 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
131 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
132 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
133 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
134 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
135 ifneq ($(MakefileCommonIn),)
136 PreConditions += $(MakefileCommon)
139 ifneq ($(MakefileConfigIn),)
140 PreConditions += $(MakefileConfig)
143 preconditions: $(PreConditions)
145 #------------------------------------------------------------------------
146 # Make sure the BUILT_SOURCES are built first
147 #------------------------------------------------------------------------
148 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
151 ifneq ($(strip $(BUILT_SOURCES)),)
152 -$(Verb) $(RM) -f $(BUILT_SOURCES)
155 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
157 $(Verb) if test -x config.status ; then \
158 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
159 $(MKDIR) .spotless.save ; \
160 $(MV) config.status .spotless.save ; \
161 $(MV) mklib .spotless.save ; \
162 $(MV) projects .spotless.save ; \
164 $(MV) .spotless.save/config.status . ; \
165 $(MV) .spotless.save/mklib . ; \
166 $(MV) .spotless.save/projects . ; \
167 $(RM) -rf .spotless.save ; \
168 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
169 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
170 $(ConfigStatusScript) ; \
172 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
176 $(EchoCmd) "spotless target not supported for objdir == srcdir"
179 $(BUILT_SOURCES) : $(ObjMakefiles)
181 #------------------------------------------------------------------------
182 # Make sure we're not using a stale configuration
183 #------------------------------------------------------------------------
185 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
186 $(Verb) cd $(PROJ_OBJ_ROOT) && \
187 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
188 $(ConfigStatusScript)
190 .PRECIOUS: $(ConfigStatusScript)
191 $(ConfigStatusScript): $(ConfigureScript)
192 $(Echo) Reconfiguring with $<
193 $(Verb) cd $(PROJ_OBJ_ROOT) && \
194 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
195 $(ConfigStatusScript)
197 #------------------------------------------------------------------------
198 # Make sure the configuration makefile is up to date
199 #------------------------------------------------------------------------
200 ifneq ($(MakefileConfigIn),)
201 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
202 $(Echo) Regenerating $@
203 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
206 ifneq ($(MakefileCommonIn),)
207 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
208 $(Echo) Regenerating $@
209 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
212 #------------------------------------------------------------------------
213 # If the Makefile in the source tree has been updated, copy it over into the
214 # build tree. But, only do this if the source and object makefiles differ
215 #------------------------------------------------------------------------
217 PROJ_MAKEFILE := $(PROJ_SRC_DIR)/Makefile
220 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
222 Makefile: $(PROJ_MAKEFILE) $(ExtraMakefiles)
223 $(Echo) "Updating Makefile"
224 $(Verb) $(MKDIR) $(@D)
225 $(Verb) $(CP) -f $< $@
227 # Copy the Makefile.* files unless we're in the root directory which avoids
228 # the copying of Makefile.config.in or other things that should be explicitly
230 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_MAKEFILE)%
232 *Makefile.rules) ;; \
234 *) $(EchoCmd) "Updating $(@F)" ; \
241 #------------------------------------------------------------------------
242 # Set up the basic dependencies
243 #------------------------------------------------------------------------
244 $(UserTargets):: $(PreConditions)
248 clean-all:: clean-local clean-all-local
249 install:: install-local
250 uninstall:: uninstall-local
251 install-local:: all-local
252 install-bytecode:: install-bytecode-local
254 ###############################################################################
255 # VARIABLES: Set up various variables based on configuration data
256 ###############################################################################
258 # Variable for if this make is for a "cleaning" target
259 ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
263 #--------------------------------------------------------------------
264 # Variables derived from configuration we are building
265 #--------------------------------------------------------------------
268 ifeq ($(ENABLE_OPTIMIZED),1)
270 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
271 ifneq ($(HOST_OS),FreeBSD)
272 ifneq ($(HOST_OS),Darwin)
273 OmitFramePointer := -fomit-frame-pointer
277 # Darwin requires -fstrict-aliasing to be explicitly enabled.
278 # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues
279 # with -fstrict-aliasing and ipa-type-escape radr://6756684
280 #ifeq ($(HOST_OS),Darwin)
281 # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
283 CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
284 C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
285 LD.Flags += $(OPTIMIZE_OPTION)
287 BuildMode := $(BuildMode)+Debug
294 ifdef NO_DEBUG_SYMBOLS
295 BuildMode := Unoptimized
309 ifeq ($(ENABLE_LIBCPP),1)
310 CXX.Flags += -stdlib=libc++
311 LD.Flags += -stdlib=libc++
314 ifeq ($(ENABLE_PROFILING),1)
315 BuildMode := $(BuildMode)+Profile
316 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
317 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
318 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
322 #ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
323 # CXX.Flags += -fvisibility-inlines-hidden
326 ifdef ENABLE_EXPENSIVE_CHECKS
327 # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
328 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
332 # IF REQUIRES_EH=1 is specified then don't disable exceptions
334 CXX.Flags += -fno-exceptions
336 # If the library requires EH, it also requires RTTI.
340 ifdef REQUIRES_FRAME_POINTER
341 CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags))
342 C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags))
343 LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags))
346 # If REQUIRES_RTTI=1 is specified then don't disable run-time type id.
347 ifneq ($(REQUIRES_RTTI), 1)
348 CXX.Flags += -fno-rtti
351 ifeq ($(ENABLE_COVERAGE),1)
352 BuildMode := $(BuildMode)+Coverage
353 CXX.Flags += -ftest-coverage -fprofile-arcs
354 C.Flags += -ftest-coverage -fprofile-arcs
357 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
358 # then disable assertions by defining the appropriate preprocessor symbols.
359 ifeq ($(DISABLE_ASSERTIONS),1)
360 CPP.Defines += -DNDEBUG
362 BuildMode := $(BuildMode)+Asserts
363 CPP.Defines += -D_DEBUG
366 # If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or
367 # configured), then enable expensive checks by defining the
368 # appropriate preprocessor symbols.
369 ifeq ($(ENABLE_EXPENSIVE_CHECKS),1)
370 BuildMode := $(BuildMode)+Checks
371 CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG
374 # LOADABLE_MODULE implies several other things so we force them to be
376 ifdef LOADABLE_MODULE
378 LINK_LIBS_IN_SHARED := 1
386 ifeq ($(ENABLE_PIC),1)
387 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
388 # Nothing. Win32 defaults to PIC and warns when given -fPIC
390 ifeq ($(HOST_OS),Darwin)
391 # Common symbols not allowed in dylib files
392 CXX.Flags += -fno-common
393 C.Flags += -fno-common
395 # Linux and others; pass -fPIC
401 ifeq ($(HOST_OS),Darwin)
402 CXX.Flags += -mdynamic-no-pic
403 C.Flags += -mdynamic-no-pic
407 # Support makefile variable to disable any kind of timestamp/non-deterministic
408 # info from being used in the build.
409 ifeq ($(ENABLE_TIMESTAMPS),1)
410 DOTDIR_TIMESTAMP_COMMAND := $(DATE)
412 DOTDIR_TIMESTAMP_COMMAND := echo 'Created.'
415 ifeq ($(HOST_OS),MingW)
417 CPP.Defines += -D__NO_CTYPE_INLINE
418 ifeq ($(LLVM_CROSS_COMPILING),1)
419 # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016
421 LD.Flags += -Wl,--allow-multiple-definition
426 CXX.Flags += -Woverloaded-virtual
427 CPP.BaseFlags += $(CPP.Defines)
430 # Make Floating point IEEE compliant on Alpha.
433 CPP.BaseFlags += -mieee
434 ifeq ($(ENABLE_PIC),0)
436 CPP.BaseFlags += -fPIC
439 LD.Flags += -Wl,--no-relax
442 # GNU ld/PECOFF accepts but ignores them below;
446 # FIXME: autoconf should be aware of them.
447 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
448 HAVE_LINK_VERSION_SCRIPT := 0
450 RDYNAMIC := -Wl,--export-all-symbols
453 #--------------------------------------------------------------------
454 # Directory locations
455 #--------------------------------------------------------------------
457 ifeq ($(LLVM_CROSS_COMPILING),1)
458 BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin
461 ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode)
462 ObjDir := $(ObjRootDir)
463 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
464 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
465 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
466 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
467 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
468 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
470 #--------------------------------------------------------------------
471 # Locations of shared libraries
472 #--------------------------------------------------------------------
475 SharedLibDir := $(LibDir)
476 LLVMSharedLibDir := $(LLVMLibDir)
478 # Win32.DLL prefers to be located on the "PATH" of binaries.
479 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
480 SharedLibDir := $(ToolDir)
481 LLVMSharedLibDir := $(LLVMToolDir)
483 ifeq ($(HOST_OS),Cygwin)
490 #--------------------------------------------------------------------
491 # LLVM Capable Compiler
492 #--------------------------------------------------------------------
494 ifneq ($(findstring llvm-gcc,$(LLVMCC_OPTION)),)
496 LLVMCXX := $(LLVMGXX)
498 ifneq ($(findstring clang,$(LLVMCC_OPTION)),)
499 ifneq ($(CLANGPATH),)
500 LLVMCC := $(CLANGPATH)
501 LLVMCXX := $(CLANGXXPATH)
503 ifeq ($(ENABLE_BUILT_CLANG),1)
504 LLVMCC := $(LLVMToolDir)/clang
505 LLVMCXX := $(LLVMToolDir)/clang++
511 #--------------------------------------------------------------------
512 # Full Paths To Compiled Tools and Utilities
513 #--------------------------------------------------------------------
514 EchoCmd := $(ECHO) llvm[$(MAKELEVEL)]:
515 ifdef BUILD_DIRS_ONLY
516 EchoCmd := $(EchoCmd) "(build tools)":
521 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
524 ifeq ($(LLVM_CROSS_COMPILING),1)
525 LLVM_TBLGEN := $(BuildLLVMToolDir)/llvm-tblgen$(BUILD_EXEEXT)
527 LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT)
530 ifeq ($(LLVM_CROSS_COMPILING),1)
531 LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config-2$(BUILD_EXEEXT)
533 LLVM_CONFIG := $(LLVMToolDir)/llvm-config-2$(EXEEXT)
536 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
539 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
542 LLI := $(LLVMToolDir)/lli$(EXEEXT)
545 LLC := $(LLVMToolDir)/llc$(EXEEXT)
548 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
551 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
554 #--------------------------------------------------------------------
555 # Adjust to user's request
556 #--------------------------------------------------------------------
558 ifeq ($(HOST_OS),Darwin)
559 DARWIN_VERSION := `sw_vers -productVersion`
560 # Strip a number like 10.4.7 to 10.4
561 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
562 # Get "4" out of 10.4 for later pieces in the makefile.
563 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
565 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
566 SharedLinkOptions := -dynamiclib
568 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
571 SharedLinkOptions=-shared
574 ifeq ($(TARGET_OS),Darwin)
576 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
581 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
582 ifneq ($(HOST_OS),Darwin)
583 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
595 # Adjust settings for verbose mode
598 AR.Flags += >/dev/null 2>/dev/null
599 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
601 ConfigureScriptFLAGS :=
604 # By default, strip symbol information from executable
606 Strip := $(PLATFORMSTRIPOPTS)
607 StripWarnMsg := "(without symbols)"
608 Install.StripFlag += -s
611 ifdef TOOL_NO_EXPORTS
614 DynamicFlag := $(RDYNAMIC)
617 # Adjust linker flags for building an executable
618 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
619 ifneq ($(HOST_OS), Darwin)
621 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
623 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
625 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
629 ifneq ($(DARWIN_MAJVERS),4)
630 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
636 #----------------------------------------------------------
637 # Options To Invoke Tools
638 #----------------------------------------------------------
640 ifdef EXTRA_LD_OPTIONS
641 LD.Flags += $(EXTRA_LD_OPTIONS)
645 CompileCommonOpts += -pedantic -Wno-long-long
647 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
649 # Enable cast-qual for C++; the workaround is to use const_cast.
650 CXX.Flags += -Wcast-qual
652 ifeq ($(HOST_OS),HP-UX)
653 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
656 # If we are building a universal binary on Mac OS/X, pass extra options. This
657 # is useful to people that want to link the LLVM libraries into their universal
660 # The following can be optionally specified:
661 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
662 # For Mac OS/X 10.4 Intel machines, the traditional one is:
663 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
664 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
665 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
668 ifndef UNIVERSAL_ARCH
669 UNIVERSAL_ARCH := i386 ppc
671 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
672 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
673 ifdef UNIVERSAL_SDK_PATH
674 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
677 # Building universal cannot compute dependencies automatically.
678 DISABLE_AUTO_DEPENDENCIES=1
680 ifeq ($(TARGET_OS),Darwin)
681 ifeq ($(ARCH),x86_64)
682 TargetCommonOpts = -m64
685 TargetCommonOpts = -m32
691 ifeq ($(HOST_OS),SunOS)
692 CPP.BaseFlags += -include llvm/Support/Solaris.h
695 ifeq ($(HOST_OS),AuroraUX)
696 CPP.BaseFlags += -include llvm/Support/Solaris.h
697 endif # !HOST_OS - AuroraUX.
699 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
700 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
701 # All -I flags should go here, so that they don't confuse llvm-config.
702 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
703 $(patsubst %,-I%/include,\
704 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
705 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
708 ifeq ($(INCLUDE_BUILD_DIR),1)
709 CPP.Flags += -I$(ObjDir)
712 # SHOW_DIAGNOSTICS support.
713 ifeq ($(SHOW_DIAGNOSTICS),1)
714 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
715 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
720 Compile.C = $(Compile.Wrapper) \
721 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
722 $(TargetCommonOpts) $(CompileCommonOpts) -c
723 Compile.CXX = $(Compile.Wrapper) \
724 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
725 $(TargetCommonOpts) $(CompileCommonOpts) -c
726 Preprocess.CXX= $(Compile.Wrapper) \
727 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
728 $(CompileCommonOpts) $(CXX.Flags) -E
729 Link = $(Compile.Wrapper) \
730 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
731 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
733 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
734 $(TargetCommonOpts) $(CompileCommonOpts)
735 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
736 $(TargetCommonOpts) $(CompileCommonOpts) -E
738 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
739 $(TargetCommonOpts) $(CompileCommonOpts)
741 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
742 ScriptInstall = $(INSTALL) -m 0755
743 DataInstall = $(INSTALL) -m 0644
745 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
746 # paths. In this case, the SYSPATH function (defined in
747 # Makefile.config) transforms Unix paths into Windows paths.
748 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
749 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
750 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
751 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
752 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
754 Archive = $(AR) $(AR.Flags)
755 LArchive = $(LLVMToolDir)/llvm-ar rcsf
764 #----------------------------------------------------------
765 # Get the list of source files and compute object file
767 #----------------------------------------------------------
770 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
771 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
773 Sources := $(SOURCES)
777 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
780 BaseNameSources := $(sort $(basename $(Sources)))
782 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
783 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
785 #----------------------------------------------------------
786 # For Mingw MSYS bash and Python/w32:
788 # $(ECHOPATH) prints DOSish pathstring.
789 # ex) $(ECHOPATH) /include/sys/types.h
790 # --> C:/mingw/include/sys/types.h
791 # built-in "echo" does not transform path to DOSish path.
793 # FIXME: It would not be needed when MSYS's python
795 #----------------------------------------------------------
797 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
798 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
800 ECHOPATH := $(Verb)$(ECHO)
803 ###############################################################################
804 # DIRECTORIES: Handle recursive descent of directory structure
805 ###############################################################################
807 #---------------------------------------------------------
808 # Provide rules to make install dirs. This must be early
809 # in the file so they get built before dependencies
810 #---------------------------------------------------------
812 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
815 # To create other directories, as needed, and timestamp their creation
817 $(Verb) $(MKDIR) $* > /dev/null
818 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
820 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
821 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
823 #---------------------------------------------------------
824 # Handle the DIRS options for sequential construction
825 #---------------------------------------------------------
831 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
832 $(RecursiveTargets)::
833 $(Verb) for dir in $(DIRS); do \
834 if ([ ! -f $$dir/Makefile ] || \
835 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
837 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
839 ($(MAKE) -C $$dir $@ ) || exit 1; \
842 $(RecursiveTargets)::
843 $(Verb) for dir in $(DIRS); do \
844 ($(MAKE) -C $$dir $@ ) || exit 1; \
850 #---------------------------------------------------------
851 # Handle the EXPERIMENTAL_DIRS options ensuring success
852 # after each directory is built.
853 #---------------------------------------------------------
854 ifdef EXPERIMENTAL_DIRS
855 $(RecursiveTargets)::
856 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
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 0; \
866 #-----------------------------------------------------------
867 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
868 #-----------------------------------------------------------
869 ifdef OPTIONAL_PARALLEL_DIRS
870 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
873 #-----------------------------------------------------------
874 # Handle the PARALLEL_DIRS options for parallel construction
875 #-----------------------------------------------------------
878 SubDirs += $(PARALLEL_DIRS)
880 # Unfortunately, this list must be maintained if new recursive targets are added
881 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
882 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
883 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
884 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
885 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
886 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
887 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
889 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
893 SD=$(PROJ_SRC_DIR)/$(@D); \
895 if [ ! -f $$SD/Makefile ]; then \
897 DD=$(notdir $(@D)); \
899 if ([ ! -f $$DD/Makefile ] || \
900 command test $$DD/Makefile -ot \
901 $$SD/Makefile ); then \
903 $(CP) $$SD/Makefile $$DD/Makefile; \
905 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
908 #---------------------------------------------------------
909 # Handle the OPTIONAL_DIRS options for directores that may
911 #---------------------------------------------------------
914 SubDirs += $(OPTIONAL_DIRS)
916 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
917 $(RecursiveTargets)::
918 $(Verb) for dir in $(OPTIONAL_DIRS); do \
919 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
920 if ([ ! -f $$dir/Makefile ] || \
921 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
923 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
925 ($(MAKE) -C$$dir $@ ) || exit 1; \
929 $(RecursiveTargets)::
930 $(Verb) for dir in $(OPTIONAL_DIRS); do \
931 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
932 ($(MAKE) -C$$dir $@ ) || exit 1; \
938 #---------------------------------------------------------
939 # Handle the CONFIG_FILES options
940 #---------------------------------------------------------
945 $(Echo) Install circumvented with NO_INSTALL
947 $(Echo) UnInstall circumvented with NO_INSTALL
949 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
950 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
951 $(Verb)for file in $(CONFIG_FILES); do \
952 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
953 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
954 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
955 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
957 $(ECHO) Error: cannot find config file $${file}. ; \
962 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
963 $(Verb)for file in $(CONFIG_FILES); do \
964 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
970 ###############################################################################
971 # Set up variables for building libraries
972 ###############################################################################
974 #---------------------------------------------------------
975 # Define various command line options pertaining to the
976 # libraries needed when linking. There are "Proj" libs
977 # (defined by the user's project) and "LLVM" libs (defined
978 # by the LLVM project).
979 #---------------------------------------------------------
982 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
983 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
984 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
985 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
989 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
990 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
991 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
992 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
995 # Loadable module for Win32 requires all symbols resolved for linking.
996 # Then all symbols in LLVM.dll will be available.
997 ifeq ($(ENABLE_SHARED),1)
998 ifdef LOADABLE_MODULE
999 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
1000 LINK_COMPONENTS += all
1005 ifndef IS_CLEANING_TARGET
1006 ifdef LINK_COMPONENTS
1008 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1009 # clean in tools, then do a make in tools (instead of at the top level).
1011 @echo "*** llvm-config doesn't exist - rebuilding it."
1012 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1014 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1016 ifeq ($(ENABLE_SHARED), 1)
1017 # We can take the "auto-import" feature to get rid of using dllimport.
1018 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1019 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1022 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1023 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1026 ifndef NO_LLVM_CONFIG
1027 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1028 ifeq ($(LLVMConfigLibs),Error)
1029 $(error llvm-config --libs failed)
1031 LLVMLibsOptions += $(LLVMConfigLibs)
1032 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1033 ifeq ($(LLVMConfigLibfiles),Error)
1034 $(error llvm-config --libfiles failed)
1036 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1043 # Set up the library exports file.
1044 ifdef EXPORTED_SYMBOL_FILE
1046 # First, set up the native export file, which may differ from the source
1049 ifeq ($(HOST_OS),Darwin)
1050 # Darwin convention prefixes symbols with underscores.
1051 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1052 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1053 $(Verb) sed -e 's/^/_/' < $< > $@
1055 -$(Verb) $(RM) -f $(NativeExportsFile)
1057 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1058 # Gold and BFD ld require a version script rather than a plain list.
1059 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1060 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1061 $(Verb) echo "{" > $@
1062 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1063 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1064 ifneq ($(HOST_OS),OpenBSD)
1065 $(Verb) echo " local: *;" >> $@
1067 $(Verb) echo "};" >> $@
1069 -$(Verb) $(RM) -f $(NativeExportsFile)
1071 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1072 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1073 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1074 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1075 $(Echo) Generating $(notdir $@)
1076 $(Verb) $(ECHO) "EXPORTS" > $@
1077 $(Verb) $(CAT) $< >> $@
1079 -$(Verb) $(RM) -f $(NativeExportsFile)
1081 # Default behavior: just use the exports file verbatim.
1082 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1087 # Now add the linker command-line options to use the native export file.
1090 ifeq ($(HOST_OS),Darwin)
1091 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1094 # gold, bfd ld, etc.
1095 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1096 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1100 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1101 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1102 SharedLinkOptions += $(NativeExportsFile)
1107 ###############################################################################
1108 # Library Build Rules: Four ways to build a library
1109 ###############################################################################
1111 #---------------------------------------------------------
1112 # Bytecode Module Targets:
1113 # If the user set MODULE_NAME then they want to build a
1114 # bytecode module from the sources. We compile all the
1115 # sources and link it together into a single bytecode
1117 #---------------------------------------------------------
1120 ifeq ($(strip $(LLVMCC)),)
1121 $(warning Modules require LLVM capable compiler but none is available ****)
1124 Module := $(LibDir)/$(MODULE_NAME).bc
1125 LinkModule := $(LLVMLD) -r
1128 ifdef EXPORTED_SYMBOL_FILE
1129 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1132 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1133 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1134 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1136 all-local:: $(Module)
1139 ifneq ($(strip $(Module)),)
1140 -$(Verb) $(RM) -f $(Module)
1143 ifdef BYTECODE_DESTINATION
1144 ModuleDestDir := $(BYTECODE_DESTINATION)
1146 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1151 $(Echo) Install circumvented with NO_INSTALL
1153 $(Echo) Uninstall circumvented with NO_INSTALL
1155 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1157 install-module:: $(DestModule)
1158 install-local:: $(DestModule)
1160 $(DestModule): $(ModuleDestDir) $(Module)
1161 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1162 $(Verb) $(DataInstall) $(Module) $(DestModule)
1165 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1166 -$(Verb) $(RM) -f $(DestModule)
1172 # if we're building a library ...
1175 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1176 LIBRARYNAME := $(strip $(LIBRARYNAME))
1177 ifdef LOADABLE_MODULE
1178 BaseLibName.A := $(LIBRARYNAME).a
1179 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1181 BaseLibName.A := lib$(LIBRARYNAME).a
1182 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1184 LibName.A := $(LibDir)/$(BaseLibName.A)
1185 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1186 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1187 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1189 #---------------------------------------------------------
1190 # Shared Library Targets:
1191 # If the user asked for a shared library to be built
1192 # with the SHARED_LIBRARY variable, then we provide
1193 # targets for building them.
1194 #---------------------------------------------------------
1195 ifdef SHARED_LIBRARY
1197 all-local:: $(LibName.SO)
1199 ifdef EXPORTED_SYMBOL_FILE
1200 $(LibName.SO): $(NativeExportsFile)
1203 ifdef LINK_LIBS_IN_SHARED
1204 ifdef LOADABLE_MODULE
1205 SharedLibKindMessage := "Loadable Module"
1206 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1208 SharedLibKindMessage := "Shared Library"
1210 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1211 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1213 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1214 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1216 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1217 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1218 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1222 ifneq ($(strip $(LibName.SO)),)
1223 -$(Verb) $(RM) -f $(LibName.SO)
1228 $(Echo) Install circumvented with NO_INSTALL
1230 $(Echo) Uninstall circumvented with NO_INSTALL
1233 # Win32.DLL prefers to be located on the "PATH" of binaries.
1234 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1235 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1237 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1239 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1241 install-local:: $(DestSharedLib)
1243 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1244 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1245 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1248 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1249 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1253 #---------------------------------------------------------
1254 # Bytecode Library Targets:
1255 # If the user asked for a bytecode library to be built
1256 # with the BYTECODE_LIBRARY variable, then we provide
1257 # targets for building them.
1258 #---------------------------------------------------------
1259 ifdef BYTECODE_LIBRARY
1260 ifeq ($(strip $(LLVMCC)),)
1261 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1264 all-local:: $(LibName.BCA)
1266 ifdef EXPORTED_SYMBOL_FILE
1267 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1269 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1270 $(LLVMToolDir)/llvm-ar
1271 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1273 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1275 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1277 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1278 $(LLVMToolDir)/llvm-ar
1279 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1281 $(Verb) $(LArchive) $@ $(ObjectsBC)
1286 ifneq ($(strip $(LibName.BCA)),)
1287 -$(Verb) $(RM) -f $(LibName.BCA)
1290 ifdef BYTECODE_DESTINATION
1291 BytecodeDestDir := $(BYTECODE_DESTINATION)
1293 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1296 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1298 install-bytecode-local:: $(DestBytecodeLib)
1302 $(Echo) Install circumvented with NO_INSTALL
1304 $(Echo) Uninstall circumvented with NO_INSTALL
1306 install-local:: $(DestBytecodeLib)
1308 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1309 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1310 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1313 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1314 -$(Verb) $(RM) -f $(DestBytecodeLib)
1319 #---------------------------------------------------------
1321 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1322 # building an archive.
1323 #---------------------------------------------------------
1324 ifndef NO_BUILD_ARCHIVE
1325 ifndef BUILD_ARCHIVE
1326 ifndef LOADABLE_MODULE
1332 #---------------------------------------------------------
1333 # Archive Library Targets:
1334 # If the user wanted a regular archive library built,
1335 # then we provide targets for building them.
1336 #---------------------------------------------------------
1339 all-local:: $(LibName.A)
1341 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1342 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1343 -$(Verb) $(RM) -f $@
1344 $(Verb) $(Archive) $@ $(ObjectsO)
1345 $(Verb) $(Ranlib) $@
1348 ifneq ($(strip $(LibName.A)),)
1349 -$(Verb) $(RM) -f $(LibName.A)
1354 $(Echo) Install circumvented with NO_INSTALL
1356 $(Echo) Uninstall circumvented with NO_INSTALL
1358 ifdef NO_INSTALL_ARCHIVES
1360 $(Echo) Install circumvented with NO_INSTALL
1362 $(Echo) Uninstall circumvented with NO_INSTALL
1364 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1366 install-local:: $(DestArchiveLib)
1368 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1369 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1370 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1371 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1374 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1375 -$(Verb) $(RM) -f $(DestArchiveLib)
1383 ###############################################################################
1384 # Tool Build Rules: Build executable tool based on TOOLNAME option
1385 ###############################################################################
1389 #---------------------------------------------------------
1390 # Set up variables for building a tool.
1391 #---------------------------------------------------------
1392 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1394 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1396 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1399 # TOOLALIAS is a name to symlink (or copy) the tool to.
1402 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1404 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1408 #---------------------------------------------------------
1410 #---------------------------------------------------------
1412 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1413 # not exporting all of the weak symbols from the binary. This reduces dyld
1414 # startup time by 4x on darwin in some cases.
1415 ifdef TOOL_NO_EXPORTS
1416 ifeq ($(HOST_OS),Darwin)
1418 # Tiger tools don't support this.
1419 ifneq ($(DARWIN_MAJVERS),4)
1420 LD.Flags += -Wl,-exported_symbol,_main
1424 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1425 ifneq ($(ARCH), Mips)
1426 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1431 #---------------------------------------------------------
1432 # Tool Order File Support
1433 #---------------------------------------------------------
1435 ifeq ($(HOST_OS),Darwin)
1436 ifdef TOOL_ORDER_FILE
1438 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1443 #---------------------------------------------------------
1444 # Tool Version Info Support
1445 #---------------------------------------------------------
1447 ifeq ($(HOST_OS),Darwin)
1448 ifdef TOOL_INFO_PLIST
1450 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1452 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1454 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1455 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1456 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1457 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1458 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1459 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1465 #---------------------------------------------------------
1466 # Provide targets for building the tools
1467 #---------------------------------------------------------
1468 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1471 ifneq ($(strip $(ToolBuildPath)),)
1472 -$(Verb) $(RM) -f $(ToolBuildPath)
1474 ifneq ($(strip $(ToolAliasBuildPath)),)
1475 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1479 $(ToolBuildPath): $(ExmplDir)/.dir
1481 $(ToolBuildPath): $(ToolDir)/.dir
1484 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1485 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1486 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1487 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1488 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1491 ifneq ($(strip $(ToolAliasBuildPath)),)
1492 $(ToolAliasBuildPath): $(ToolBuildPath)
1493 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1494 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1495 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1496 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1502 $(Echo) Install circumvented with NO_INSTALL
1504 $(Echo) Uninstall circumvented with NO_INSTALL
1506 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1508 install-local:: $(DestTool)
1510 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1511 $(Echo) Installing $(BuildMode) $(DestTool)
1512 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1515 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1516 -$(Verb) $(RM) -f $(DestTool)
1518 # TOOLALIAS install.
1520 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1522 install-local:: $(DestToolAlias)
1524 $(DestToolAlias): $(DestTool)
1525 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1526 $(Verb) $(RM) -f $(DestToolAlias)
1527 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1530 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1531 -$(Verb) $(RM) -f $(DestToolAlias)
1537 ###############################################################################
1538 # Object Build Rules: Build object files based on sources
1539 ###############################################################################
1541 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1542 ifeq ($(HOST_OS),HP-UX)
1543 DISABLE_AUTO_DEPENDENCIES=1
1546 # Provide rule sets for when dependency generation is enabled
1547 ifndef DISABLE_AUTO_DEPENDENCIES
1549 #---------------------------------------------------------
1550 # Create .o files in the ObjDir directory from the .cpp and .c files...
1551 #---------------------------------------------------------
1553 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1554 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1556 # If the build succeeded, move the dependency file over, otherwise
1558 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1559 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1561 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1562 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1563 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1566 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1567 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1568 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1571 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1572 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1573 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1576 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1577 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1578 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1581 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1582 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1583 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1586 #---------------------------------------------------------
1587 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1588 #---------------------------------------------------------
1590 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1591 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1593 # If the build succeeded, move the dependency file over, otherwise
1595 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1596 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1598 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1599 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1600 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1601 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1602 $(BC_DEPEND_MOVEFILE)
1604 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1605 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1606 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1607 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1608 $(BC_DEPEND_MOVEFILE)
1610 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1611 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1612 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1613 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1614 $(BC_DEPEND_MOVEFILE)
1616 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1617 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1618 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1619 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1620 $(BC_DEPEND_MOVEFILE)
1622 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1623 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1624 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1625 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1626 $(BC_DEPEND_MOVEFILE)
1628 # Provide alternate rule sets if dependencies are disabled
1631 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1632 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1633 $(Compile.CXX) $< -o $@
1635 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1636 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1637 $(Compile.CXX) $< -o $@
1639 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1640 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1641 $(Compile.CXX) $< -o $@
1643 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1644 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1645 $(Compile.C) $< -o $@
1647 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1648 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1649 $(Compile.C) $< -o $@
1651 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1652 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1653 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1655 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1656 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1657 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1659 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1660 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1661 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1663 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1664 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1665 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1667 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1668 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1669 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1674 ## Rules for building preprocessed (.i/.ii) outputs.
1675 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1676 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1677 $(Verb) $(Preprocess.CXX) $< -o $@
1679 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1680 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1681 $(Verb) $(Preprocess.CXX) $< -o $@
1683 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1684 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1685 $(Verb) $(Preprocess.CXX) $< -o $@
1687 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1688 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1689 $(Verb) $(Preprocess.C) $< -o $@
1691 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1692 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1693 $(Verb) $(Preprocess.C) $< -o $@
1696 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1697 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1698 $(Compile.CXX) $< -o $@ -S
1700 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1701 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1702 $(Compile.CXX) $< -o $@ -S
1704 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1705 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1706 $(Compile.CXX) $< -o $@ -S
1708 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1709 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1710 $(Compile.C) $< -o $@ -S
1712 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1713 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1714 $(Compile.C) $< -o $@ -S
1717 # make the C and C++ compilers strip debug info out of bytecode libraries.
1719 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1720 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1721 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1723 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1724 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1725 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1729 #---------------------------------------------------------
1730 # Provide rule to build .bc files from .ll sources,
1731 # regardless of dependencies
1732 #---------------------------------------------------------
1733 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1734 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1735 $(Verb) $(LLVMAS) $< -f -o $@
1737 ###############################################################################
1738 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1739 ###############################################################################
1742 TABLEGEN_INC_FILES_COMMON = 1
1745 ifdef TABLEGEN_INC_FILES_COMMON
1747 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1748 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1749 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1751 # INCFiles rule: All of the tblgen generated files are emitted to
1752 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1753 # us to only "touch" the real file if the contents of it change. IOW, if
1754 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1755 # dependencies of the .inc files are, unless the contents of the .inc file
1757 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1758 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1760 endif # TABLEGEN_INC_FILES_COMMON
1764 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1765 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1766 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1767 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1768 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1769 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1770 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1772 # All .inc.tmp files depend on the .td files.
1773 $(INCTMPFiles) : $(TDFiles)
1775 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1776 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1777 $(Echo) "Building $(<F) register info implementation with tblgen"
1778 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1780 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1781 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1782 $(Echo) "Building $(<F) instruction information with tblgen"
1783 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1785 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1786 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1787 $(Echo) "Building $(<F) assembly writer with tblgen"
1788 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1790 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1791 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1792 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1793 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1795 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1796 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1797 $(Echo) "Building $(<F) assembly matcher with tblgen"
1798 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1800 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1801 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1802 $(Echo) "Building $(<F) MC code emitter with tblgen"
1803 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1805 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1806 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1807 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1808 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1810 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1811 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1812 $(Echo) "Building $(<F) code emitter with tblgen"
1813 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1815 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1816 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1817 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1818 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1820 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1821 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1822 $(Echo) "Building $(<F) disassembly tables with tblgen"
1823 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1825 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1826 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1827 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1828 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1830 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1831 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1832 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1833 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1835 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1836 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1837 $(Echo) "Building $(<F) subtarget information with tblgen"
1838 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1840 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1841 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1842 $(Echo) "Building $(<F) calling convention information with tblgen"
1843 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1845 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1846 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1847 $(Echo) "Building $(<F) intrinsics information with tblgen"
1848 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1850 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1851 $(Echo) "Building $(<F) decoder tables with tblgen"
1852 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1856 -$(Verb) $(RM) -f $(INCFiles)
1860 ###############################################################################
1861 # OTHER RULES: Other rules needed
1862 ###############################################################################
1864 # To create postscript files from dot files...
1865 ifneq ($(DOT),false)
1867 $(DOT) -Tps < $< > $@
1870 $(Echo) "Cannot build $@: The program dot is not installed"
1873 # This rules ensures that header files that are removed still have a rule for
1874 # which they can be "generated." This allows make to ignore them and
1875 # reproduce the dependency lists.
1879 # Define clean-local to clean the current directory. Note that this uses a
1880 # very conservative approach ensuring that empty variables do not cause
1881 # errors or disastrous removal.
1883 ifneq ($(strip $(ObjRootDir)),)
1884 -$(Verb) $(RM) -rf $(ObjRootDir)
1886 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1887 -$(Verb) $(RM) -f *$(SHLIBEXT)
1891 -$(Verb) $(RM) -rf Debug Release Profile
1894 ###############################################################################
1895 # DEPENDENCIES: Include the dependency files if we should
1896 ###############################################################################
1897 ifndef DISABLE_AUTO_DEPENDENCIES
1899 # If its not one of the cleaning targets
1900 ifndef IS_CLEANING_TARGET
1902 # Get the list of dependency files
1903 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1904 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1906 # Include bitcode dependency files if using bitcode libraries
1907 ifdef BYTECODE_LIBRARY
1908 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1911 -include $(DependFiles) ""
1917 ###############################################################################
1918 # CHECK: Running the test suite
1919 ###############################################################################
1922 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1923 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1924 $(EchoCmd) Running test suite ; \
1925 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1926 TESTSUITE=$(TESTSUITE) ; \
1928 $(EchoCmd) No Makefile in test directory ; \
1931 $(EchoCmd) No test directory ; \
1937 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1938 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1939 $(EchoCmd) Running test suite ; \
1940 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1942 $(EchoCmd) No Makefile in test directory ; \
1945 $(EchoCmd) No test directory ; \
1949 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1950 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1951 $(EchoCmd) Running test suite ; \
1952 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1954 $(EchoCmd) No Makefile in test directory ; \
1957 $(EchoCmd) No test directory ; \
1960 ###############################################################################
1961 # UNITTESTS: Running the unittests test suite
1962 ###############################################################################
1965 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1966 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1967 $(EchoCmd) Running unittests test suite ; \
1968 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1970 $(EchoCmd) No Makefile in unittests directory ; \
1973 $(EchoCmd) No unittests directory ; \
1976 ###############################################################################
1977 # DISTRIBUTION: Handle construction of a distribution tarball
1978 ###############################################################################
1980 #------------------------------------------------------------------------
1981 # Define distribution related variables
1982 #------------------------------------------------------------------------
1983 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1984 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1985 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1986 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1987 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1988 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1989 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1990 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1991 Makefile.config.in configure autoconf
1992 DistOther := $(notdir $(wildcard \
1993 $(PROJ_SRC_DIR)/*.h \
1994 $(PROJ_SRC_DIR)/*.td \
1995 $(PROJ_SRC_DIR)/*.def \
1996 $(PROJ_SRC_DIR)/*.ll \
1997 $(PROJ_SRC_DIR)/*.in))
1998 DistSubDirs := $(SubDirs)
1999 DistSources = $(Sources) $(EXTRA_DIST)
2000 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
2002 #------------------------------------------------------------------------
2003 # We MUST build distribution with OBJ_DIR != SRC_DIR
2004 #------------------------------------------------------------------------
2005 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2006 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2007 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2011 #------------------------------------------------------------------------
2012 # Prevent attempt to run dist targets from anywhere but the top level
2013 #------------------------------------------------------------------------
2015 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2016 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2019 #------------------------------------------------------------------------
2020 # Provide the top level targets
2021 #------------------------------------------------------------------------
2023 dist-gzip:: $(DistTarGZip)
2025 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2026 $(Echo) Packing gzipped distribution tar file.
2027 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2028 $(GZIP) -c > "$(DistTarGZip)"
2030 dist-bzip2:: $(DistTarBZ2)
2032 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2033 $(Echo) Packing bzipped distribution tar file.
2034 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2035 $(BZIP2) -c >$(DistTarBZ2)
2037 dist-zip:: $(DistZip)
2039 $(DistZip) : $(TopDistDir)/.makedistdir
2040 $(Echo) Packing zipped distribution file.
2041 $(Verb) rm -f $(DistZip)
2042 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2044 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2045 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2047 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2049 dist-check:: $(DistTarGZip)
2050 $(Echo) Checking distribution tar file.
2051 $(Verb) if test -d $(DistCheckDir) ; then \
2052 $(RM) -rf $(DistCheckDir) ; \
2054 $(Verb) $(MKDIR) $(DistCheckDir)
2055 $(Verb) cd $(DistCheckDir) && \
2056 $(MKDIR) $(DistCheckDir)/build && \
2057 $(MKDIR) $(DistCheckDir)/install && \
2058 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2060 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2061 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2064 $(MAKE) unittests && \
2065 $(MAKE) install && \
2066 $(MAKE) uninstall && \
2067 $(MAKE) dist-clean && \
2068 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2071 $(Echo) Cleaning distribution files
2072 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2077 #------------------------------------------------------------------------
2078 # Provide the recursive distdir target for building the distribution directory
2079 #------------------------------------------------------------------------
2080 distdir: $(DistDir)/.makedistdir
2081 $(DistDir)/.makedistdir: $(DistSources)
2082 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2083 if test -d "$(DistDir)" ; then \
2084 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2087 $(EchoCmd) Removing old $(DistDir) ; \
2088 $(RM) -rf $(DistDir); \
2089 $(EchoCmd) Making 'all' to verify build ; \
2090 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2092 $(Echo) Building Distribution Directory $(DistDir)
2093 $(Verb) $(MKDIR) $(DistDir)
2094 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2095 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2096 for file in $(DistFiles) ; do \
2098 $(PROJ_SRC_DIR)/*) \
2099 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2101 $(PROJ_SRC_ROOT)/*) \
2102 file=`echo "$$file" | \
2103 sed "s#^$$srcrootstrip/##"` \
2106 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2107 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2108 from_dir="$(PROJ_SRC_DIR)" ; \
2109 elif test -f "$$file" || test -d "$$file" ; then \
2112 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2113 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2114 to_dir="$(DistDir)/$$dir"; \
2115 $(MKDIR) "$$to_dir" ; \
2117 to_dir="$(DistDir)"; \
2119 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2120 if test -n "$$mid_dir" ; then \
2121 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2123 if test -d "$$from_dir/$$file"; then \
2124 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2125 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2126 cd $(PROJ_SRC_DIR) ; \
2127 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2128 ( cd $$to_dir ; $(TAR) xf - ) ; \
2129 cd $(PROJ_OBJ_DIR) ; \
2132 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2133 ( cd $$to_dir ; $(TAR) xf - ) ; \
2134 cd $(PROJ_OBJ_DIR) ; \
2136 elif test -f "$$from_dir/$$file" ; then \
2137 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2138 elif test -L "$$from_dir/$$file" ; then \
2139 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2140 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2141 $(EchoCmd) "===== WARNING: Distribution Source " \
2142 "$$from_dir/$$file Not Found!" ; \
2143 elif test "$(Verb)" != '@' ; then \
2144 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2147 $(Verb) for subdir in $(DistSubDirs) ; do \
2148 if test "$$subdir" \!= "." ; then \
2149 new_distdir="$(DistDir)/$$subdir" ; \
2150 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2151 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2152 DistDir="$$new_distdir" distdir ) || exit 1; \
2155 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2156 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2157 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2158 -name .svn \) -print` ;\
2159 $(MAKE) dist-hook ; \
2160 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2161 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2162 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2163 -o ! -type d ! -perm -444 -exec \
2164 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2165 || chmod -R a+r $(DistDir) ; \
2168 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2174 ###############################################################################
2175 # TOP LEVEL - targets only to apply at the top level directory
2176 ###############################################################################
2180 #------------------------------------------------------------------------
2181 # Install support for the project's include files:
2182 #------------------------------------------------------------------------
2185 $(Echo) Install circumvented with NO_INSTALL
2187 $(Echo) Uninstall circumvented with NO_INSTALL
2190 $(Echo) Installing include files
2191 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2192 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2193 cd $(PROJ_SRC_ROOT)/include && \
2194 for hdr in `find . -type f \
2195 '(' -name LICENSE.TXT \
2200 ')' -print | grep -v CVS | \
2201 grep -v .svn` ; do \
2202 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2203 if test \! -d "$$instdir" ; then \
2204 $(EchoCmd) Making install directory $$instdir ; \
2205 $(MKDIR) $$instdir ;\
2207 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2210 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2211 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2212 cd $(PROJ_OBJ_ROOT)/include && \
2213 for hdr in `find . -type f \
2214 '(' -name LICENSE.TXT \
2219 ')' -print | grep -v CVS | \
2220 grep -v .svn` ; do \
2221 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2222 if test \! -d "$$instdir" ; then \
2223 $(EchoCmd) Making install directory $$instdir ; \
2224 $(MKDIR) $$instdir ;\
2226 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2232 $(Echo) Uninstalling include files
2233 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2234 cd $(PROJ_SRC_ROOT)/include && \
2235 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2236 '!' '(' -name '*~' -o -name '.#*' \
2237 -o -name '*.in' ')' -print ')' | \
2238 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2239 cd $(PROJ_SRC_ROOT)/include && \
2240 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2241 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2247 @echo searching for overlength lines in files: $(Sources)
2250 egrep -n '.{81}' $(Sources) /dev/null
2253 @echo searching for tabs in files: $(Sources)
2256 egrep -n ' ' $(Sources) /dev/null
2259 @ls -l $(LibDir) | awk '\
2260 BEGIN { sum = 0; } \
2262 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2263 @ls -l $(ToolDir) | awk '\
2264 BEGIN { sum = 0; } \
2266 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2267 #------------------------------------------------------------------------
2268 # Print out the directories used for building
2269 #------------------------------------------------------------------------
2271 $(Echo) "BuildMode : " '$(BuildMode)'
2272 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2273 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2274 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2275 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2276 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2277 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2278 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2279 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2280 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2281 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2282 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2283 $(Echo) "UserTargets : " '$(UserTargets)'
2284 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2285 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2286 $(Echo) "ObjDir : " '$(ObjDir)'
2287 $(Echo) "LibDir : " '$(LibDir)'
2288 $(Echo) "ToolDir : " '$(ToolDir)'
2289 $(Echo) "ExmplDir : " '$(ExmplDir)'
2290 $(Echo) "Sources : " '$(Sources)'
2291 $(Echo) "TDFiles : " '$(TDFiles)'
2292 $(Echo) "INCFiles : " '$(INCFiles)'
2293 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2294 $(Echo) "PreConditions: " '$(PreConditions)'
2295 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2296 $(Echo) "Compile.C : " '$(Compile.C)'
2297 $(Echo) "Archive : " '$(Archive)'
2298 $(Echo) "YaccFiles : " '$(YaccFiles)'
2299 $(Echo) "LexFiles : " '$(LexFiles)'
2300 $(Echo) "Module : " '$(Module)'
2301 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2302 $(Echo) "SubDirs : " '$(SubDirs)'
2303 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2304 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2309 # General debugging rule, use 'make dbg-print-XXX' to print the
2310 # definition, value and origin of XXX.
2312 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))