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 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
532 LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
535 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
538 LLI := $(LLVMToolDir)/lli$(EXEEXT)
541 LLC := $(LLVMToolDir)/llc$(EXEEXT)
544 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
547 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
550 #--------------------------------------------------------------------
551 # Adjust to user's request
552 #--------------------------------------------------------------------
554 ifeq ($(HOST_OS),Darwin)
555 DARWIN_VERSION := `sw_vers -productVersion`
556 # Strip a number like 10.4.7 to 10.4
557 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/')
558 # Get "4" out of 10.4 for later pieces in the makefile.
559 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
561 LoadableModuleOptions := -Wl,-flat_namespace -Wl,-undefined,suppress
562 SharedLinkOptions := -dynamiclib
564 SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
567 SharedLinkOptions=-shared
570 ifeq ($(TARGET_OS),Darwin)
572 TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
577 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
578 ifneq ($(HOST_OS),Darwin)
579 LD.Flags += $(RPATH) -Wl,'$$ORIGIN'
591 # Adjust settings for verbose mode
594 AR.Flags += >/dev/null 2>/dev/null
595 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
597 ConfigureScriptFLAGS :=
600 # By default, strip symbol information from executable
602 Strip := $(PLATFORMSTRIPOPTS)
603 StripWarnMsg := "(without symbols)"
604 Install.StripFlag += -s
607 ifdef TOOL_NO_EXPORTS
610 DynamicFlag := $(RDYNAMIC)
613 # Adjust linker flags for building an executable
614 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
615 ifneq ($(HOST_OS), Darwin)
617 LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
619 LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(DynamicFlag)
621 LD.Flags += $(RPATH) -Wl,$(ToolDir) $(DynamicFlag)
625 ifneq ($(DARWIN_MAJVERS),4)
626 LD.Flags += $(RPATH) -Wl,@executable_path/../lib
632 #----------------------------------------------------------
633 # Options To Invoke Tools
634 #----------------------------------------------------------
636 ifdef EXTRA_LD_OPTIONS
637 LD.Flags += $(EXTRA_LD_OPTIONS)
641 CompileCommonOpts += -pedantic -Wno-long-long
643 CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \
645 # Enable cast-qual for C++; the workaround is to use const_cast.
646 CXX.Flags += -Wcast-qual
648 ifeq ($(HOST_OS),HP-UX)
649 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
652 # If we are building a universal binary on Mac OS/X, pass extra options. This
653 # is useful to people that want to link the LLVM libraries into their universal
656 # The following can be optionally specified:
657 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
658 # For Mac OS/X 10.4 Intel machines, the traditional one is:
659 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
660 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
661 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
664 ifndef UNIVERSAL_ARCH
665 UNIVERSAL_ARCH := i386 ppc
667 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
668 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
669 ifdef UNIVERSAL_SDK_PATH
670 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
673 # Building universal cannot compute dependencies automatically.
674 DISABLE_AUTO_DEPENDENCIES=1
676 ifeq ($(TARGET_OS),Darwin)
677 ifeq ($(ARCH),x86_64)
678 TargetCommonOpts = -m64
681 TargetCommonOpts = -m32
687 ifeq ($(HOST_OS),SunOS)
688 CPP.BaseFlags += -include llvm/Support/Solaris.h
691 ifeq ($(HOST_OS),AuroraUX)
692 CPP.BaseFlags += -include llvm/Support/Solaris.h
693 endif # !HOST_OS - AuroraUX.
695 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
696 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
697 # All -I flags should go here, so that they don't confuse llvm-config.
698 CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
699 $(patsubst %,-I%/include,\
700 $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
701 $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
704 ifeq ($(INCLUDE_BUILD_DIR),1)
705 CPP.Flags += -I$(ObjDir)
708 # SHOW_DIAGNOSTICS support.
709 ifeq ($(SHOW_DIAGNOSTICS),1)
710 Compile.Wrapper := env CC_LOG_DIAGNOSTICS=1 \
711 CC_LOG_DIAGNOSTICS_FILE="$(LLVM_OBJ_ROOT)/$(BuildMode)/diags"
716 Compile.C = $(Compile.Wrapper) \
717 $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
718 $(TargetCommonOpts) $(CompileCommonOpts) -c
719 Compile.CXX = $(Compile.Wrapper) \
720 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
721 $(TargetCommonOpts) $(CompileCommonOpts) -c
722 Preprocess.CXX= $(Compile.Wrapper) \
723 $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \
724 $(CompileCommonOpts) $(CXX.Flags) -E
725 Link = $(Compile.Wrapper) \
726 $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LD.Flags) \
727 $(LDFLAGS) $(TargetCommonOpts) $(CompileCommonOpts) $(Strip)
729 BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \
730 $(TargetCommonOpts) $(CompileCommonOpts)
731 Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \
732 $(TargetCommonOpts) $(CompileCommonOpts) -E
734 BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \
735 $(TargetCommonOpts) $(CompileCommonOpts)
737 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
738 ScriptInstall = $(INSTALL) -m 0755
739 DataInstall = $(INSTALL) -m 0644
741 # When compiling under Mingw/Cygwin, the tblgen tool expects Windows
742 # paths. In this case, the SYSPATH function (defined in
743 # Makefile.config) transforms Unix paths into Windows paths.
744 TableGen.Flags= -I $(call SYSPATH, $(PROJ_SRC_DIR)) \
745 -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \
746 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \
747 -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target)
748 LLVMTableGen = $(LLVM_TBLGEN) $(TableGen.Flags)
750 Archive = $(AR) $(AR.Flags)
751 LArchive = $(LLVMToolDir)/llvm-ar rcsf
760 #----------------------------------------------------------
761 # Get the list of source files and compute object file
763 #----------------------------------------------------------
766 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
767 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c))
769 Sources := $(SOURCES)
773 Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES))
776 BaseNameSources := $(sort $(basename $(Sources)))
778 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
779 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
781 #----------------------------------------------------------
782 # For Mingw MSYS bash and Python/w32:
784 # $(ECHOPATH) prints DOSish pathstring.
785 # ex) $(ECHOPATH) /include/sys/types.h
786 # --> C:/mingw/include/sys/types.h
787 # built-in "echo" does not transform path to DOSish path.
789 # FIXME: It would not be needed when MSYS's python
791 #----------------------------------------------------------
793 ifeq (-mingw32,$(findstring -mingw32,$(BUILD_TRIPLE)))
794 ECHOPATH := $(Verb)python -u -c "import sys;print ' '.join(sys.argv[1:])"
796 ECHOPATH := $(Verb)$(ECHO)
799 ###############################################################################
800 # DIRECTORIES: Handle recursive descent of directory structure
801 ###############################################################################
803 #---------------------------------------------------------
804 # Provide rules to make install dirs. This must be early
805 # in the file so they get built before dependencies
806 #---------------------------------------------------------
808 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
811 # To create other directories, as needed, and timestamp their creation
813 $(Verb) $(MKDIR) $* > /dev/null
814 $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@
816 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
817 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
819 #---------------------------------------------------------
820 # Handle the DIRS options for sequential construction
821 #---------------------------------------------------------
827 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
828 $(RecursiveTargets)::
829 $(Verb) for dir in $(DIRS); do \
830 if ([ ! -f $$dir/Makefile ] || \
831 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
833 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
835 ($(MAKE) -C $$dir $@ ) || exit 1; \
838 $(RecursiveTargets)::
839 $(Verb) for dir in $(DIRS); do \
840 ($(MAKE) -C $$dir $@ ) || exit 1; \
846 #---------------------------------------------------------
847 # Handle the EXPERIMENTAL_DIRS options ensuring success
848 # after each directory is built.
849 #---------------------------------------------------------
850 ifdef EXPERIMENTAL_DIRS
851 $(RecursiveTargets)::
852 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
853 if ([ ! -f $$dir/Makefile ] || \
854 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
856 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
858 ($(MAKE) -C $$dir $@ ) || exit 0; \
862 #-----------------------------------------------------------
863 # Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction
864 #-----------------------------------------------------------
865 ifdef OPTIONAL_PARALLEL_DIRS
866 PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) -o -f $(T)/Makefile && echo "$(T)"))
869 #-----------------------------------------------------------
870 # Handle the PARALLEL_DIRS options for parallel construction
871 #-----------------------------------------------------------
874 SubDirs += $(PARALLEL_DIRS)
876 # Unfortunately, this list must be maintained if new recursive targets are added
877 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
878 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
879 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
880 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
881 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
882 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
883 unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS))
885 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
889 SD=$(PROJ_SRC_DIR)/$(@D); \
891 if [ ! -f $$SD/Makefile ]; then \
893 DD=$(notdir $(@D)); \
895 if ([ ! -f $$DD/Makefile ] || \
896 command test $$DD/Makefile -ot \
897 $$SD/Makefile ); then \
899 $(CP) $$SD/Makefile $$DD/Makefile; \
901 $(MAKE) -C $$DD $(subst $(@D)/.make,,$@)
904 #---------------------------------------------------------
905 # Handle the OPTIONAL_DIRS options for directores that may
907 #---------------------------------------------------------
910 SubDirs += $(OPTIONAL_DIRS)
912 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
913 $(RecursiveTargets)::
914 $(Verb) for dir in $(OPTIONAL_DIRS); do \
915 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
916 if ([ ! -f $$dir/Makefile ] || \
917 command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \
919 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
921 ($(MAKE) -C$$dir $@ ) || exit 1; \
925 $(RecursiveTargets)::
926 $(Verb) for dir in $(OPTIONAL_DIRS); do \
927 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
928 ($(MAKE) -C$$dir $@ ) || exit 1; \
934 #---------------------------------------------------------
935 # Handle the CONFIG_FILES options
936 #---------------------------------------------------------
941 $(Echo) Install circumvented with NO_INSTALL
943 $(Echo) UnInstall circumvented with NO_INSTALL
945 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
946 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
947 $(Verb)for file in $(CONFIG_FILES); do \
948 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
949 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
950 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
951 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
953 $(ECHO) Error: cannot find config file $${file}. ; \
958 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
959 $(Verb)for file in $(CONFIG_FILES); do \
960 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
966 ###############################################################################
967 # Set up variables for building libraries
968 ###############################################################################
970 #---------------------------------------------------------
971 # Define various command line options pertaining to the
972 # libraries needed when linking. There are "Proj" libs
973 # (defined by the user's project) and "LLVM" libs (defined
974 # by the LLVM project).
975 #---------------------------------------------------------
978 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
979 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
980 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
981 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
985 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
986 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
987 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
988 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
991 # Loadable module for Win32 requires all symbols resolved for linking.
992 # Then all symbols in LLVM.dll will be available.
993 ifeq ($(ENABLE_SHARED),1)
994 ifdef LOADABLE_MODULE
995 ifneq (,$(filter $(HOST_OS),Cygwin MingW))
996 LINK_COMPONENTS += all
1001 ifndef IS_CLEANING_TARGET
1002 ifdef LINK_COMPONENTS
1004 # If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make
1005 # clean in tools, then do a make in tools (instead of at the top level).
1007 @echo "*** llvm-config doesn't exist - rebuilding it."
1008 @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
1010 $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
1012 ifeq ($(ENABLE_SHARED), 1)
1013 # We can take the "auto-import" feature to get rid of using dllimport.
1014 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1015 LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \
1018 LLVMLibsOptions += -lLLVM-$(LLVMVersion)
1019 LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT)
1022 ifndef NO_LLVM_CONFIG
1023 LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error)
1024 ifeq ($(LLVMConfigLibs),Error)
1025 $(error llvm-config --libs failed)
1027 LLVMLibsOptions += $(LLVMConfigLibs)
1028 LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error)
1029 ifeq ($(LLVMConfigLibfiles),Error)
1030 $(error llvm-config --libfiles failed)
1032 LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles)
1039 # Set up the library exports file.
1040 ifdef EXPORTED_SYMBOL_FILE
1042 # First, set up the native export file, which may differ from the source
1045 ifeq ($(HOST_OS),Darwin)
1046 # Darwin convention prefixes symbols with underscores.
1047 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
1048 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1049 $(Verb) sed -e 's/^/_/' < $< > $@
1051 -$(Verb) $(RM) -f $(NativeExportsFile)
1053 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1054 # Gold and BFD ld require a version script rather than a plain list.
1055 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map
1056 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1057 $(Verb) echo "{" > $@
1058 $(Verb) grep -q "\<" $< && echo " global:" >> $@ || :
1059 $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@
1060 ifneq ($(HOST_OS),OpenBSD)
1061 $(Verb) echo " local: *;" >> $@
1063 $(Verb) echo "};" >> $@
1065 -$(Verb) $(RM) -f $(NativeExportsFile)
1067 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1068 # GNU ld Win32 accepts .DEF files that contain "DATA" entries.
1069 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def))
1070 $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir
1071 $(Echo) Generating $(notdir $@)
1072 $(Verb) $(ECHO) "EXPORTS" > $@
1073 $(Verb) $(CAT) $< >> $@
1075 -$(Verb) $(RM) -f $(NativeExportsFile)
1077 # Default behavior: just use the exports file verbatim.
1078 NativeExportsFile := $(EXPORTED_SYMBOL_FILE)
1083 # Now add the linker command-line options to use the native export file.
1086 ifeq ($(HOST_OS),Darwin)
1087 LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile)
1090 # gold, bfd ld, etc.
1091 ifeq ($(HAVE_LINK_VERSION_SCRIPT),1)
1092 LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile)
1096 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1097 # LLVMLibsOptions is invalidated at processing tools/llvm-shlib.
1098 SharedLinkOptions += $(NativeExportsFile)
1103 ###############################################################################
1104 # Library Build Rules: Four ways to build a library
1105 ###############################################################################
1107 #---------------------------------------------------------
1108 # Bytecode Module Targets:
1109 # If the user set MODULE_NAME then they want to build a
1110 # bytecode module from the sources. We compile all the
1111 # sources and link it together into a single bytecode
1113 #---------------------------------------------------------
1116 ifeq ($(strip $(LLVMCC)),)
1117 $(warning Modules require LLVM capable compiler but none is available ****)
1120 Module := $(LibDir)/$(MODULE_NAME).bc
1121 LinkModule := $(LLVMLD) -r
1124 ifdef EXPORTED_SYMBOL_FILE
1125 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1128 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
1129 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
1130 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
1132 all-local:: $(Module)
1135 ifneq ($(strip $(Module)),)
1136 -$(Verb) $(RM) -f $(Module)
1139 ifdef BYTECODE_DESTINATION
1140 ModuleDestDir := $(BYTECODE_DESTINATION)
1142 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
1147 $(Echo) Install circumvented with NO_INSTALL
1149 $(Echo) Uninstall circumvented with NO_INSTALL
1151 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
1153 install-module:: $(DestModule)
1154 install-local:: $(DestModule)
1156 $(DestModule): $(ModuleDestDir) $(Module)
1157 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
1158 $(Verb) $(DataInstall) $(Module) $(DestModule)
1161 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
1162 -$(Verb) $(RM) -f $(DestModule)
1168 # if we're building a library ...
1171 # Make sure there isn't any extraneous whitespace on the LIBRARYNAME option
1172 LIBRARYNAME := $(strip $(LIBRARYNAME))
1173 ifdef LOADABLE_MODULE
1174 BaseLibName.A := $(LIBRARYNAME).a
1175 BaseLibName.SO := $(LIBRARYNAME)$(SHLIBEXT)
1177 BaseLibName.A := lib$(LIBRARYNAME).a
1178 BaseLibName.SO := $(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT)
1180 LibName.A := $(LibDir)/$(BaseLibName.A)
1181 LibName.SO := $(SharedLibDir)/$(BaseLibName.SO)
1182 LibName.O := $(LibDir)/$(LIBRARYNAME).o
1183 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
1185 #---------------------------------------------------------
1186 # Shared Library Targets:
1187 # If the user asked for a shared library to be built
1188 # with the SHARED_LIBRARY variable, then we provide
1189 # targets for building them.
1190 #---------------------------------------------------------
1191 ifdef SHARED_LIBRARY
1193 all-local:: $(LibName.SO)
1195 ifdef EXPORTED_SYMBOL_FILE
1196 $(LibName.SO): $(NativeExportsFile)
1199 ifdef LINK_LIBS_IN_SHARED
1200 ifdef LOADABLE_MODULE
1201 SharedLibKindMessage := "Loadable Module"
1202 SharedLinkOptions := $(LoadableModuleOptions) $(SharedLinkOptions)
1204 SharedLibKindMessage := "Shared Library"
1206 $(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir
1207 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
1209 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \
1210 $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS)
1212 $(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir
1213 $(Echo) Linking $(BuildMode) Shared Library $(notdir $@)
1214 $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO)
1218 ifneq ($(strip $(LibName.SO)),)
1219 -$(Verb) $(RM) -f $(LibName.SO)
1224 $(Echo) Install circumvented with NO_INSTALL
1226 $(Echo) Uninstall circumvented with NO_INSTALL
1229 # Win32.DLL prefers to be located on the "PATH" of binaries.
1230 ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
1231 DestSharedLibDir := $(DESTDIR)$(PROJ_bindir)
1233 DestSharedLibDir := $(DESTDIR)$(PROJ_libdir)
1235 DestSharedLib := $(DestSharedLibDir)/$(BaseLibName.SO)
1237 install-local:: $(DestSharedLib)
1239 $(DestSharedLib): $(LibName.SO) $(DestSharedLibDir)
1240 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
1241 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
1244 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1245 -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).*
1249 #---------------------------------------------------------
1250 # Bytecode Library Targets:
1251 # If the user asked for a bytecode library to be built
1252 # with the BYTECODE_LIBRARY variable, then we provide
1253 # targets for building them.
1254 #---------------------------------------------------------
1255 ifdef BYTECODE_LIBRARY
1256 ifeq ($(strip $(LLVMCC)),)
1257 $(warning Bytecode libraries require LLVM capable compiler but none is available ****)
1260 all-local:: $(LibName.BCA)
1262 ifdef EXPORTED_SYMBOL_FILE
1263 BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
1265 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
1266 $(LLVMToolDir)/llvm-ar
1267 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
1269 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC)
1271 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc
1273 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
1274 $(LLVMToolDir)/llvm-ar
1275 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
1277 $(Verb) $(LArchive) $@ $(ObjectsBC)
1282 ifneq ($(strip $(LibName.BCA)),)
1283 -$(Verb) $(RM) -f $(LibName.BCA)
1286 ifdef BYTECODE_DESTINATION
1287 BytecodeDestDir := $(BYTECODE_DESTINATION)
1289 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
1292 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
1294 install-bytecode-local:: $(DestBytecodeLib)
1298 $(Echo) Install circumvented with NO_INSTALL
1300 $(Echo) Uninstall circumvented with NO_INSTALL
1302 install-local:: $(DestBytecodeLib)
1304 $(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir)
1305 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1306 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
1309 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
1310 -$(Verb) $(RM) -f $(DestBytecodeLib)
1315 #---------------------------------------------------------
1317 # If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to
1318 # building an archive.
1319 #---------------------------------------------------------
1320 ifndef NO_BUILD_ARCHIVE
1321 ifndef BUILD_ARCHIVE
1322 ifndef LOADABLE_MODULE
1328 #---------------------------------------------------------
1329 # Archive Library Targets:
1330 # If the user wanted a regular archive library built,
1331 # then we provide targets for building them.
1332 #---------------------------------------------------------
1335 all-local:: $(LibName.A)
1337 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
1338 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
1339 -$(Verb) $(RM) -f $@
1340 $(Verb) $(Archive) $@ $(ObjectsO)
1341 $(Verb) $(Ranlib) $@
1344 ifneq ($(strip $(LibName.A)),)
1345 -$(Verb) $(RM) -f $(LibName.A)
1350 $(Echo) Install circumvented with NO_INSTALL
1352 $(Echo) Uninstall circumvented with NO_INSTALL
1354 ifdef NO_INSTALL_ARCHIVES
1356 $(Echo) Install circumvented with NO_INSTALL
1358 $(Echo) Uninstall circumvented with NO_INSTALL
1360 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
1362 install-local:: $(DestArchiveLib)
1364 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
1365 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1366 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
1367 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
1370 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
1371 -$(Verb) $(RM) -f $(DestArchiveLib)
1379 ###############################################################################
1380 # Tool Build Rules: Build executable tool based on TOOLNAME option
1381 ###############################################################################
1385 #---------------------------------------------------------
1386 # Set up variables for building a tool.
1387 #---------------------------------------------------------
1388 TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT)
1390 ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME)
1392 ToolBuildPath := $(ToolDir)/$(TOOLEXENAME)
1395 # TOOLALIAS is a name to symlink (or copy) the tool to.
1398 ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1400 ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT)
1404 #---------------------------------------------------------
1406 #---------------------------------------------------------
1408 # If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
1409 # not exporting all of the weak symbols from the binary. This reduces dyld
1410 # startup time by 4x on darwin in some cases.
1411 ifdef TOOL_NO_EXPORTS
1412 ifeq ($(HOST_OS),Darwin)
1414 # Tiger tools don't support this.
1415 ifneq ($(DARWIN_MAJVERS),4)
1416 LD.Flags += -Wl,-exported_symbol,_main
1420 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
1421 ifneq ($(ARCH), Mips)
1422 LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
1427 #---------------------------------------------------------
1428 # Tool Order File Support
1429 #---------------------------------------------------------
1431 ifeq ($(HOST_OS),Darwin)
1432 ifdef TOOL_ORDER_FILE
1434 LD.Flags += -Wl,-order_file,$(TOOL_ORDER_FILE)
1439 #---------------------------------------------------------
1440 # Tool Version Info Support
1441 #---------------------------------------------------------
1443 ifeq ($(HOST_OS),Darwin)
1444 ifdef TOOL_INFO_PLIST
1446 LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST)
1448 $(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST)
1450 $(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir
1451 $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..."
1452 $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \
1453 -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \
1454 -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \
1455 -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \
1461 #---------------------------------------------------------
1462 # Provide targets for building the tools
1463 #---------------------------------------------------------
1464 all-local:: $(ToolBuildPath) $(ToolAliasBuildPath)
1467 ifneq ($(strip $(ToolBuildPath)),)
1468 -$(Verb) $(RM) -f $(ToolBuildPath)
1470 ifneq ($(strip $(ToolAliasBuildPath)),)
1471 -$(Verb) $(RM) -f $(ToolAliasBuildPath)
1475 $(ToolBuildPath): $(ExmplDir)/.dir
1477 $(ToolBuildPath): $(ToolDir)/.dir
1480 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1481 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1482 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1483 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1484 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1487 ifneq ($(strip $(ToolAliasBuildPath)),)
1488 $(ToolAliasBuildPath): $(ToolBuildPath)
1489 $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg)
1490 $(Verb) $(RM) -f $(ToolAliasBuildPath)
1491 $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath)
1492 $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \
1498 $(Echo) Install circumvented with NO_INSTALL
1500 $(Echo) Uninstall circumvented with NO_INSTALL
1502 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
1504 install-local:: $(DestTool)
1506 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
1507 $(Echo) Installing $(BuildMode) $(DestTool)
1508 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1511 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1512 -$(Verb) $(RM) -f $(DestTool)
1514 # TOOLALIAS install.
1516 DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT)
1518 install-local:: $(DestToolAlias)
1520 $(DestToolAlias): $(DestTool)
1521 $(Echo) Installing $(BuildMode) $(DestToolAlias)
1522 $(Verb) $(RM) -f $(DestToolAlias)
1523 $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias)
1526 $(Echo) Uninstalling $(BuildMode) $(DestToolAlias)
1527 -$(Verb) $(RM) -f $(DestToolAlias)
1533 ###############################################################################
1534 # Object Build Rules: Build object files based on sources
1535 ###############################################################################
1537 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1538 ifeq ($(HOST_OS),HP-UX)
1539 DISABLE_AUTO_DEPENDENCIES=1
1542 # Provide rule sets for when dependency generation is enabled
1543 ifndef DISABLE_AUTO_DEPENDENCIES
1545 #---------------------------------------------------------
1546 # Create .o files in the ObjDir directory from the .cpp and .c files...
1547 #---------------------------------------------------------
1549 DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
1550 -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
1552 # If the build succeeded, move the dependency file over, otherwise
1554 DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
1555 else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
1557 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1558 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1559 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1562 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1563 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1564 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1567 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1568 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1569 $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1572 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1573 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1574 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1577 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_MAKEFILE)
1578 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1579 $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
1582 #---------------------------------------------------------
1583 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1584 #---------------------------------------------------------
1586 BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \
1587 -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d"
1589 # If the build succeeded, move the dependency file over, otherwise
1591 BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \
1592 else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi
1594 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1595 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1596 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1597 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1598 $(BC_DEPEND_MOVEFILE)
1600 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1601 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1602 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1603 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1604 $(BC_DEPEND_MOVEFILE)
1606 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1607 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1608 $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \
1609 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1610 $(BC_DEPEND_MOVEFILE)
1612 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1613 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1614 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1615 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1616 $(BC_DEPEND_MOVEFILE)
1618 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1619 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1620 $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \
1621 $< -o $(ObjDir)/$*.ll -S $(LLVMCC_EMITIR_FLAG) ; \
1622 $(BC_DEPEND_MOVEFILE)
1624 # Provide alternate rule sets if dependencies are disabled
1627 $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1628 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1629 $(Compile.CXX) $< -o $@
1631 $(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1632 $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG)
1633 $(Compile.CXX) $< -o $@
1635 $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1636 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1637 $(Compile.CXX) $< -o $@
1639 $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1640 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1641 $(Compile.C) $< -o $@
1643 $(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1644 $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG)
1645 $(Compile.C) $< -o $@
1647 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1648 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1649 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1651 $(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1652 $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)"
1653 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1655 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX)
1656 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1657 $(BCCompile.CXX) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1659 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1660 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1661 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1663 $(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC)
1664 $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)"
1665 $(BCCompile.C) $< -o $@ -S $(LLVMCC_EMITIR_FLAG)
1670 ## Rules for building preprocessed (.i/.ii) outputs.
1671 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1672 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1673 $(Verb) $(Preprocess.CXX) $< -o $@
1675 $(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1676 $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file"
1677 $(Verb) $(Preprocess.CXX) $< -o $@
1679 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1680 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1681 $(Verb) $(Preprocess.CXX) $< -o $@
1683 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1684 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1685 $(Verb) $(Preprocess.C) $< -o $@
1687 $(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1688 $(Echo) "Compiling $*.m for $(BuildMode) build to .i file"
1689 $(Verb) $(Preprocess.C) $< -o $@
1692 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1693 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1694 $(Compile.CXX) $< -o $@ -S
1696 $(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES)
1697 $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG)
1698 $(Compile.CXX) $< -o $@ -S
1700 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1701 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1702 $(Compile.CXX) $< -o $@ -S
1704 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1705 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1706 $(Compile.C) $< -o $@ -S
1708 $(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES)
1709 $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG)
1710 $(Compile.C) $< -o $@ -S
1713 # make the C and C++ compilers strip debug info out of bytecode libraries.
1715 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1716 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1717 $(Verb) $(LOPT) $< -std-compile-opts -o $@
1719 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
1720 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1721 $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
1725 #---------------------------------------------------------
1726 # Provide rule to build .bc files from .ll sources,
1727 # regardless of dependencies
1728 #---------------------------------------------------------
1729 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1730 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1731 $(Verb) $(LLVMAS) $< -f -o $@
1733 ###############################################################################
1734 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1735 ###############################################################################
1738 TABLEGEN_INC_FILES_COMMON = 1
1741 ifdef TABLEGEN_INC_FILES_COMMON
1743 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1744 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1745 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1747 # INCFiles rule: All of the tblgen generated files are emitted to
1748 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1749 # us to only "touch" the real file if the contents of it change. IOW, if
1750 # tblgen is modified, all of the .inc.tmp files are regenerated, but no
1751 # dependencies of the .inc files are, unless the contents of the .inc file
1753 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1754 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1756 endif # TABLEGEN_INC_FILES_COMMON
1760 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1761 $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \
1762 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \
1763 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \
1764 $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \
1765 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
1766 $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
1768 # All .inc.tmp files depend on the .td files.
1769 $(INCTMPFiles) : $(TDFiles)
1771 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1772 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1773 $(Echo) "Building $(<F) register info implementation with tblgen"
1774 $(Verb) $(LLVMTableGen) -gen-register-info -o $(call SYSPATH, $@) $<
1776 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1777 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1778 $(Echo) "Building $(<F) instruction information with tblgen"
1779 $(Verb) $(LLVMTableGen) -gen-instr-info -o $(call SYSPATH, $@) $<
1781 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1782 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1783 $(Echo) "Building $(<F) assembly writer with tblgen"
1784 $(Verb) $(LLVMTableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
1786 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1787 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1788 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1789 $(Verb) $(LLVMTableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
1791 $(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
1792 $(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1793 $(Echo) "Building $(<F) assembly matcher with tblgen"
1794 $(Verb) $(LLVMTableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
1796 $(TARGET:%=$(ObjDir)/%GenMCCodeEmitter.inc.tmp): \
1797 $(ObjDir)/%GenMCCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1798 $(Echo) "Building $(<F) MC code emitter with tblgen"
1799 $(Verb) $(LLVMTableGen) -gen-emitter -mc-emitter -o $(call SYSPATH, $@) $<
1801 $(TARGET:%=$(ObjDir)/%GenMCPseudoLowering.inc.tmp): \
1802 $(ObjDir)/%GenMCPseudoLowering.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1803 $(Echo) "Building $(<F) MC Pseudo instruction expander with tblgen"
1804 $(Verb) $(LLVMTableGen) -gen-pseudo-lowering -o $(call SYSPATH, $@) $<
1806 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1807 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1808 $(Echo) "Building $(<F) code emitter with tblgen"
1809 $(Verb) $(LLVMTableGen) -gen-emitter -o $(call SYSPATH, $@) $<
1811 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1812 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1813 $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
1814 $(Verb) $(LLVMTableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1816 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1817 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1818 $(Echo) "Building $(<F) disassembly tables with tblgen"
1819 $(Verb) $(LLVMTableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
1821 $(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
1822 $(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1823 $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
1824 $(Verb) $(LLVMTableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
1826 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
1827 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1828 $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
1829 $(Verb) $(LLVMTableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
1831 $(TARGET:%=$(ObjDir)/%GenSubtargetInfo.inc.tmp): \
1832 $(ObjDir)/%GenSubtargetInfo.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1833 $(Echo) "Building $(<F) subtarget information with tblgen"
1834 $(Verb) $(LLVMTableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
1836 $(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
1837 $(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1838 $(Echo) "Building $(<F) calling convention information with tblgen"
1839 $(Verb) $(LLVMTableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
1841 $(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
1842 $(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1843 $(Echo) "Building $(<F) intrinsics information with tblgen"
1844 $(Verb) $(LLVMTableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
1846 $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN)
1847 $(Echo) "Building $(<F) decoder tables with tblgen"
1848 $(Verb) $(LLVMTableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
1852 -$(Verb) $(RM) -f $(INCFiles)
1856 ###############################################################################
1857 # OTHER RULES: Other rules needed
1858 ###############################################################################
1860 # To create postscript files from dot files...
1861 ifneq ($(DOT),false)
1863 $(DOT) -Tps < $< > $@
1866 $(Echo) "Cannot build $@: The program dot is not installed"
1869 # This rules ensures that header files that are removed still have a rule for
1870 # which they can be "generated." This allows make to ignore them and
1871 # reproduce the dependency lists.
1875 # Define clean-local to clean the current directory. Note that this uses a
1876 # very conservative approach ensuring that empty variables do not cause
1877 # errors or disastrous removal.
1879 ifneq ($(strip $(ObjRootDir)),)
1880 -$(Verb) $(RM) -rf $(ObjRootDir)
1882 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1883 -$(Verb) $(RM) -f *$(SHLIBEXT)
1887 -$(Verb) $(RM) -rf Debug Release Profile
1890 ###############################################################################
1891 # DEPENDENCIES: Include the dependency files if we should
1892 ###############################################################################
1893 ifndef DISABLE_AUTO_DEPENDENCIES
1895 # If its not one of the cleaning targets
1896 ifndef IS_CLEANING_TARGET
1898 # Get the list of dependency files
1899 DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources)))
1900 DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1902 # Include bitcode dependency files if using bitcode libraries
1903 ifdef BYTECODE_LIBRARY
1904 DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d)
1907 -include $(DependFiles) ""
1913 ###############################################################################
1914 # CHECK: Running the test suite
1915 ###############################################################################
1918 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1919 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1920 $(EchoCmd) Running test suite ; \
1921 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1922 TESTSUITE=$(TESTSUITE) ; \
1924 $(EchoCmd) No Makefile in test directory ; \
1927 $(EchoCmd) No test directory ; \
1933 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1934 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1935 $(EchoCmd) Running test suite ; \
1936 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \
1938 $(EchoCmd) No Makefile in test directory ; \
1941 $(EchoCmd) No test directory ; \
1945 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1946 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1947 $(EchoCmd) Running test suite ; \
1948 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \
1950 $(EchoCmd) No Makefile in test directory ; \
1953 $(EchoCmd) No test directory ; \
1956 ###############################################################################
1957 # UNITTESTS: Running the unittests test suite
1958 ###############################################################################
1961 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \
1962 if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \
1963 $(EchoCmd) Running unittests test suite ; \
1964 $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \
1966 $(EchoCmd) No Makefile in unittests directory ; \
1969 $(EchoCmd) No unittests directory ; \
1972 ###############################################################################
1973 # DISTRIBUTION: Handle construction of a distribution tarball
1974 ###############################################################################
1976 #------------------------------------------------------------------------
1977 # Define distribution related variables
1978 #------------------------------------------------------------------------
1979 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1980 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1981 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1982 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1983 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1984 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1985 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1986 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1987 Makefile.config.in configure autoconf
1988 DistOther := $(notdir $(wildcard \
1989 $(PROJ_SRC_DIR)/*.h \
1990 $(PROJ_SRC_DIR)/*.td \
1991 $(PROJ_SRC_DIR)/*.def \
1992 $(PROJ_SRC_DIR)/*.ll \
1993 $(PROJ_SRC_DIR)/*.in))
1994 DistSubDirs := $(SubDirs)
1995 DistSources = $(Sources) $(EXTRA_DIST)
1996 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1998 #------------------------------------------------------------------------
1999 # We MUST build distribution with OBJ_DIR != SRC_DIR
2000 #------------------------------------------------------------------------
2001 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
2002 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2003 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
2007 #------------------------------------------------------------------------
2008 # Prevent attempt to run dist targets from anywhere but the top level
2009 #------------------------------------------------------------------------
2011 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
2012 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
2015 #------------------------------------------------------------------------
2016 # Provide the top level targets
2017 #------------------------------------------------------------------------
2019 dist-gzip:: $(DistTarGZip)
2021 $(DistTarGZip) : $(TopDistDir)/.makedistdir
2022 $(Echo) Packing gzipped distribution tar file.
2023 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
2024 $(GZIP) -c > "$(DistTarGZip)"
2026 dist-bzip2:: $(DistTarBZ2)
2028 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
2029 $(Echo) Packing bzipped distribution tar file.
2030 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
2031 $(BZIP2) -c >$(DistTarBZ2)
2033 dist-zip:: $(DistZip)
2035 $(DistZip) : $(TopDistDir)/.makedistdir
2036 $(Echo) Packing zipped distribution file.
2037 $(Verb) rm -f $(DistZip)
2038 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
2040 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
2041 $(Echo) ===== DISTRIBUTION PACKAGING SUCCESSFUL =====
2043 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
2045 dist-check:: $(DistTarGZip)
2046 $(Echo) Checking distribution tar file.
2047 $(Verb) if test -d $(DistCheckDir) ; then \
2048 $(RM) -rf $(DistCheckDir) ; \
2050 $(Verb) $(MKDIR) $(DistCheckDir)
2051 $(Verb) cd $(DistCheckDir) && \
2052 $(MKDIR) $(DistCheckDir)/build && \
2053 $(MKDIR) $(DistCheckDir)/install && \
2054 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
2056 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
2057 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
2060 $(MAKE) unittests && \
2061 $(MAKE) install && \
2062 $(MAKE) uninstall && \
2063 $(MAKE) dist-clean && \
2064 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
2067 $(Echo) Cleaning distribution files
2068 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
2073 #------------------------------------------------------------------------
2074 # Provide the recursive distdir target for building the distribution directory
2075 #------------------------------------------------------------------------
2076 distdir: $(DistDir)/.makedistdir
2077 $(DistDir)/.makedistdir: $(DistSources)
2078 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2079 if test -d "$(DistDir)" ; then \
2080 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
2083 $(EchoCmd) Removing old $(DistDir) ; \
2084 $(RM) -rf $(DistDir); \
2085 $(EchoCmd) Making 'all' to verify build ; \
2086 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
2088 $(Echo) Building Distribution Directory $(DistDir)
2089 $(Verb) $(MKDIR) $(DistDir)
2090 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
2091 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
2092 for file in $(DistFiles) ; do \
2094 $(PROJ_SRC_DIR)/*) \
2095 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
2097 $(PROJ_SRC_ROOT)/*) \
2098 file=`echo "$$file" | \
2099 sed "s#^$$srcrootstrip/##"` \
2102 if test -f "$(PROJ_SRC_DIR)/$$file" || \
2103 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
2104 from_dir="$(PROJ_SRC_DIR)" ; \
2105 elif test -f "$$file" || test -d "$$file" ; then \
2108 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
2109 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
2110 to_dir="$(DistDir)/$$dir"; \
2111 $(MKDIR) "$$to_dir" ; \
2113 to_dir="$(DistDir)"; \
2115 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
2116 if test -n "$$mid_dir" ; then \
2117 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
2119 if test -d "$$from_dir/$$file"; then \
2120 if test -d "$(PROJ_SRC_DIR)/$$file" && \
2121 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
2122 cd $(PROJ_SRC_DIR) ; \
2123 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2124 ( cd $$to_dir ; $(TAR) xf - ) ; \
2125 cd $(PROJ_OBJ_DIR) ; \
2128 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
2129 ( cd $$to_dir ; $(TAR) xf - ) ; \
2130 cd $(PROJ_OBJ_DIR) ; \
2132 elif test -f "$$from_dir/$$file" ; then \
2133 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
2134 elif test -L "$$from_dir/$$file" ; then \
2135 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
2136 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
2137 $(EchoCmd) "===== WARNING: Distribution Source " \
2138 "$$from_dir/$$file Not Found!" ; \
2139 elif test "$(Verb)" != '@' ; then \
2140 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
2143 $(Verb) for subdir in $(DistSubDirs) ; do \
2144 if test "$$subdir" \!= "." ; then \
2145 new_distdir="$(DistDir)/$$subdir" ; \
2146 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
2147 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
2148 DistDir="$$new_distdir" distdir ) || exit 1; \
2151 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
2152 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
2153 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
2154 -name .svn \) -print` ;\
2155 $(MAKE) dist-hook ; \
2156 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
2157 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
2158 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
2159 -o ! -type d ! -perm -444 -exec \
2160 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
2161 || chmod -R a+r $(DistDir) ; \
2164 # This is invoked by distdir target, define it as a no-op to avoid errors if not
2170 ###############################################################################
2171 # TOP LEVEL - targets only to apply at the top level directory
2172 ###############################################################################
2176 #------------------------------------------------------------------------
2177 # Install support for the project's include files:
2178 #------------------------------------------------------------------------
2181 $(Echo) Install circumvented with NO_INSTALL
2183 $(Echo) Uninstall circumvented with NO_INSTALL
2186 $(Echo) Installing include files
2187 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
2188 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
2189 cd $(PROJ_SRC_ROOT)/include && \
2190 for hdr in `find . -type f \
2191 '(' -name LICENSE.TXT \
2196 ')' -print | grep -v CVS | \
2197 grep -v .svn` ; do \
2198 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2199 if test \! -d "$$instdir" ; then \
2200 $(EchoCmd) Making install directory $$instdir ; \
2201 $(MKDIR) $$instdir ;\
2203 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2206 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
2207 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
2208 cd $(PROJ_OBJ_ROOT)/include && \
2209 for hdr in `find . -type f \
2210 '(' -name LICENSE.TXT \
2215 ')' -print | grep -v CVS | \
2216 grep -v .svn` ; do \
2217 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
2218 if test \! -d "$$instdir" ; then \
2219 $(EchoCmd) Making install directory $$instdir ; \
2220 $(MKDIR) $$instdir ;\
2222 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
2228 $(Echo) Uninstalling include files
2229 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
2230 cd $(PROJ_SRC_ROOT)/include && \
2231 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
2232 '!' '(' -name '*~' -o -name '.#*' \
2233 -o -name '*.in' ')' -print ')' | \
2234 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2235 cd $(PROJ_SRC_ROOT)/include && \
2236 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
2237 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
2243 @echo searching for overlength lines in files: $(Sources)
2246 egrep -n '.{81}' $(Sources) /dev/null
2249 @echo searching for tabs in files: $(Sources)
2252 egrep -n ' ' $(Sources) /dev/null
2255 @ls -l $(LibDir) | awk '\
2256 BEGIN { sum = 0; } \
2258 END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2259 @ls -l $(ToolDir) | awk '\
2260 BEGIN { sum = 0; } \
2262 END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
2263 #------------------------------------------------------------------------
2264 # Print out the directories used for building
2265 #------------------------------------------------------------------------
2267 $(Echo) "BuildMode : " '$(BuildMode)'
2268 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
2269 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
2270 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
2271 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
2272 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
2273 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
2274 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
2275 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
2276 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
2277 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
2278 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
2279 $(Echo) "UserTargets : " '$(UserTargets)'
2280 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
2281 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
2282 $(Echo) "ObjDir : " '$(ObjDir)'
2283 $(Echo) "LibDir : " '$(LibDir)'
2284 $(Echo) "ToolDir : " '$(ToolDir)'
2285 $(Echo) "ExmplDir : " '$(ExmplDir)'
2286 $(Echo) "Sources : " '$(Sources)'
2287 $(Echo) "TDFiles : " '$(TDFiles)'
2288 $(Echo) "INCFiles : " '$(INCFiles)'
2289 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
2290 $(Echo) "PreConditions: " '$(PreConditions)'
2291 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
2292 $(Echo) "Compile.C : " '$(Compile.C)'
2293 $(Echo) "Archive : " '$(Archive)'
2294 $(Echo) "YaccFiles : " '$(YaccFiles)'
2295 $(Echo) "LexFiles : " '$(LexFiles)'
2296 $(Echo) "Module : " '$(Module)'
2297 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
2298 $(Echo) "SubDirs : " '$(SubDirs)'
2299 $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
2300 $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
2305 # General debugging rule, use 'make dbg-print-XXX' to print the
2306 # definition, value and origin of XXX.
2308 $(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))