1 #===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file was developed by the LLVM research group and is distributed under
6 # the University of Illinois Open Source 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
23 LocalTargets := all-local clean-local clean-all-local check-local \
24 install-local printvars uninstall-local \
25 install-bytecode-local
26 TopLevelTargets := check dist dist-check dist-clean tags dist-gzip dist-bzip2 \
28 UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
29 InternalTargets := preconditions distdir dist-hook
31 ################################################################################
32 # INITIALIZATION: Basic things the makefile needs
33 ################################################################################
35 #--------------------------------------------------------------------
36 # Set the VPATH so that we can find source files.
37 #--------------------------------------------------------------------
40 #--------------------------------------------------------------------
41 # Reset the list of suffixes we know how to build
42 #--------------------------------------------------------------------
44 .SUFFIXES: .c .cpp .cc .h .hpp .y .l .lo .o .a .bc .td .ps .dot .ll
45 .SUFFIXES: $(SHLIBEXT) $(SUFFIXES)
47 #--------------------------------------------------------------------
48 # Mark all of these targets as phony to avoid implicit rule search
49 #--------------------------------------------------------------------
50 .PHONY: $(UserTargets) $(InternalTargets)
52 #--------------------------------------------------------------------
53 # Make sure all the user-target rules are double colon rules and
54 # they are defined first.
55 #--------------------------------------------------------------------
59 ################################################################################
60 # PRECONDITIONS: that which must be built/checked first
61 ################################################################################
63 SrcMakefiles := $(filter %Makefile %Makefile.tests,\
64 $(wildcard $(PROJ_SRC_DIR)/Makefile*))
65 ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles))
66 ConfigureScript := $(PROJ_SRC_ROOT)/configure
67 ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status
68 MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in))
69 MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in))
70 MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config
71 MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common
72 PreConditions := $(ConfigStatusScript) $(ObjMakefiles)
73 ifneq ($(MakefileCommonIn),)
74 PreConditions += $(MakefileCommon)
76 ifneq ($(MakefileConfigIn),)
77 PreConditions += $(MakefileConfig)
80 preconditions: $(PreConditions)
82 #------------------------------------------------------------------------
83 # Make sure the BUILT_SOURCES are built first
84 #------------------------------------------------------------------------
85 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
88 ifneq ($(strip $(BUILT_SOURCES)),)
89 -$(Verb) $(RM) -f $(BUILT_SOURCES)
92 ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT))
94 $(Verb) if test -x config.status ; then \
95 $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \
96 $(MKDIR) .spotless.save ; \
97 $(MV) config.status .spotless.save ; \
98 $(MV) mklib .spotless.save ; \
99 $(MV) projects .spotless.save ; \
101 $(MV) .spotless.save/config.status . ; \
102 $(MV) .spotless.save/mklib . ; \
103 $(MV) .spotless.save/projects . ; \
104 $(RM) -rf .spotless.save ; \
105 $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \
106 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
107 $(ConfigStatusScript) ; \
109 $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
113 $(EchoCmd) "spotless target not supported for objdir == srcdir"
116 $(BUILT_SOURCES) : $(ObjMakefiles)
118 #------------------------------------------------------------------------
119 # Make sure we're not using a stale configuration
120 #------------------------------------------------------------------------
122 $(Echo) Reconfiguring $(PROJ_OBJ_ROOT)
123 $(Verb) cd $(PROJ_OBJ_ROOT) && \
124 if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \
125 $(RM) $(PROJ_OBJ_ROOT)/config.cache ; \
127 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
128 $(ConfigStatusScript)
130 .PRECIOUS: $(ConfigStatusScript)
131 $(ConfigStatusScript): $(ConfigureScript)
132 $(Echo) Reconfiguring with $<
133 $(Verb) cd $(PROJ_OBJ_ROOT) && \
134 if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \
135 $(RM) $(PROJ_OBJ_ROOT)/config.cache ; \
137 $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
138 $(ConfigStatusScript)
140 #------------------------------------------------------------------------
141 # Make sure the configuration makefile is up to date
142 #------------------------------------------------------------------------
143 ifneq ($(MakefileConfigIn),)
144 $(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript)
145 $(Echo) Regenerating $@
146 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config
149 ifneq ($(MakefileCommonIn),)
150 $(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript)
151 $(Echo) Regenerating $@
152 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common
155 #------------------------------------------------------------------------
156 # If the Makefile in the source tree has been updated, copy it over into the
157 # build tree. But, only do this if the source and object makefiles differ
158 #------------------------------------------------------------------------
159 ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR))
161 Makefile: $(PROJ_SRC_DIR)/Makefile
162 $(Echo) "Updating Makefile"
163 $(Verb) $(MKDIR) $(@D)
164 $(Verb) $(CP) -f $< $@
166 # Copy the Makefile.* files unless we're in the root directory which avoids
167 # the copying of Makefile.config.in or other things that should be explicitly
169 $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_SRC_DIR)/Makefile%
171 *Makefile.rules) ;; \
173 *) $(Echo) "Updating $(@F)" ; \
180 #------------------------------------------------------------------------
181 # Set up the basic dependencies
182 #------------------------------------------------------------------------
183 $(UserTargets):: $(PreConditions)
187 clean-all:: clean-local clean-all-local
188 install:: install-local
189 uninstall:: uninstall-local
190 install-local:: all-local
191 install-bytecode:: install-bytecode-local
193 ###############################################################################
194 # VARIABLES: Set up various variables based on configuration data
195 ###############################################################################
197 #--------------------------------------------------------------------
198 # Variables derived from configuration we are building
199 #--------------------------------------------------------------------
201 # OPTIMIZE_OPTION - The optimization level option we want to build LLVM with
202 # this can be overridden on the make command line.
204 OPTIMIZE_OPTION := -O3
206 OPTIMIZE_OPTION := -O2
209 ifdef ENABLE_PROFILING
211 CXX.Flags := $(OPTIMIZE_OPTION) -pg -g
212 C.Flags := $(OPTIMIZE_OPTION) -pg -g
213 LD.Flags := $(OPTIMIZE_OPTION) -pg -g
215 ifdef ENABLE_OPTIMIZED
217 # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
218 ifneq ($(OS),FreeBSD)
220 OmitFramePointer := -fomit-frame-pointer
224 # Darwin requires -fstrict-aliasing to be explicitly enabled.
226 EXTRA_OPTIONS += -fstrict-aliasing
229 CXX.Flags := $(OPTIMIZE_OPTION) $(OmitFramePointer)
230 C.Flags := $(OPTIMIZE_OPTION) $(OmitFramePointer)
231 LD.Flags := $(OPTIMIZE_OPTION)
241 # IF REQUIRES_EH=1 is specified then don't disable exceptions
243 CXX.Flags += -fno-exceptions
246 # If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
247 # then disable assertions by defining the appropriate preprocessor symbols.
248 ifdef DISABLE_ASSERTIONS
249 BuildMode := $(BuildMode)-Asserts
250 CXX.Flags += -DNDEBUG
253 CXX.Flags += -D_DEBUG
257 CXX.Flags += $(CXXFLAGS) -Woverloaded-virtual
259 CPP.BaseFlags += $(CPPFLAGS)
260 LD.Flags += $(LDFLAGS)
262 LibTool.Flags := --tag=CXX
264 # Make Floating point IEEE compliant on Alpha.
266 CXX.Flags += -mieee -fPIC
267 CPP.BaseFlags += -mieee -fPIC
270 #--------------------------------------------------------------------
271 # Directory locations
272 #--------------------------------------------------------------------
273 ObjDir := $(PROJ_OBJ_DIR)/$(BuildMode)
274 LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib
275 ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin
276 ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples
277 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
278 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
279 LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
280 CFERuntimeLibDir := $(LLVMGCCDIR)/lib
282 #--------------------------------------------------------------------
283 # Full Paths To Compiled Tools and Utilities
284 #--------------------------------------------------------------------
285 EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]:
288 LIBTOOL := $(LLVM_OBJ_ROOT)/mklib
291 LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT)
294 ifeq ($(LLVM_CROSS_COMPILING),1)
295 TBLGEN := $(LLVMToolDir)/tblgen$(BUILD_EXEEXT)
297 TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT)
300 LLVM_CONFIG := $(LLVMToolDir)/llvm-config
302 GCCAS := $(LLVMToolDir)/gccas$(EXEEXT)
305 GCCLD := $(LLVMToolDir)/gccld$(EXEEXT)
308 LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
311 LLI := $(LLVMToolDir)/lli$(EXEEXT)
314 LLC := $(LLVMToolDir)/llc$(EXEEXT)
317 LOPT := $(LLVMToolDir)/opt$(EXEEXT)
320 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
323 LLVMGCCWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC)
324 LLVMGXXWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX)
326 #--------------------------------------------------------------------
327 # Adjust to user's request
328 #--------------------------------------------------------------------
330 # Adjust LD.Flags and Libtool.Flags depending on the kind of library that is
331 # to be built. Note that if LOADABLE_MODULE is specified then the resulting
332 # shared library can be opened with dlopen. Also, LOADABLE_MODULE implies
333 # several other things so we force them to be defined/on.
334 ifdef LOADABLE_MODULE
336 DONT_BUILD_RELINKED := 1
337 LINK_LIBS_IN_SHARED := 1
342 LD.Flags += -rpath $(LibDir)
344 LibTool.Flags += --tag=disable-shared
354 # Adjust settings for verbose mode
357 LibTool.Flags += --silent
358 AR.Flags += >/dev/null 2>/dev/null
359 ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1
361 ConfigureScriptFLAGS :=
364 # By default, strip symbol information from executable
366 Strip := $(PLATFORMSTRIPOPTS)
367 StripWarnMsg := "(without symbols)"
368 Install.StripFlag += -s
371 # Adjust linker flags for building an executable
374 LD.Flags += -rpath $(ExmplDir) -export-dynamic
376 LD.Flags += -rpath $(ToolDir) -export-dynamic
380 #----------------------------------------------------------
381 # Options To Invoke Tools
382 #----------------------------------------------------------
384 CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -Wno-long-long \
385 -pedantic $(EXTRA_OPTIONS)
388 CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE
391 # If we are building a universal binary on Mac OS/X, pass extra options. This
392 # is useful to people that want to link the LLVM libraries into their universal
395 # The following can be optionally specified:
396 # UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use.
397 # For Mac OS/X 10.4 Intel machines, the traditional one is:
398 # UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/
399 # UNIVERSAL_ARCH can be optionally specified to be a list of architectures
400 # to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to
403 ifndef UNIVERSAL_ARCH
404 UNIVERSAL_ARCH := i386 ppc
406 UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %)
407 CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS)
408 Relink.Flags := $(UNIVERSAL_ARCH_OPTIONS:%=-XCClinker %)
409 ifdef UNIVERSAL_SDK_PATH
410 CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH)
411 Relink.Flags += -XCClinker -isysroot -XCClinker $(UNIVERSAL_SDK_PATH)
414 # Building universal cannot compute dependencies automatically.
415 DISABLE_AUTO_DEPENDENCIES=1
418 LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
419 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
420 # All -I flags should go here, so that they don't confuse llvm-config.
421 CPP.Flags += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
422 -I$(PROJ_OBJ_ROOT)/include \
423 -I$(PROJ_SRC_ROOT)/include \
424 -I$(LLVM_OBJ_ROOT)/include \
425 -I$(LLVM_SRC_ROOT)/include \
428 Compile.C = $(CC) $(CPP.Flags) $(CompileCommonOpts) -c $(C.Flags)
429 LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C)
430 BCCompile.C = $(LLVMGCCWITHPATH) $(CPP.Flags) $(CompileCommonOpts) \
432 Preprocess.C = $(CC) $(CPP.Flags) $(CompileCommonOpts) -E $(C.Flags)
434 Compile.CXX = $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -c
435 LTCompile.CXX = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.CXX)
436 BCCompile.CXX = $(LLVMGXXWITHPATH) $(CPP.Flags) $(CompileCommonOpts) \
438 Preprocess.CXX= $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -E
439 Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
441 LTLink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(Link)
442 Relink = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
444 LTRelink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(Relink)
445 LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) \
447 ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
448 ScriptInstall = $(INSTALL) -m 0755
449 DataInstall = $(INSTALL) -m 0644
450 TableGen = $(TBLGEN) -I $(PROJ_SRC_DIR) -I$(PROJ_SRC_ROOT)/include \
451 -I $(PROJ_SRC_ROOT)/lib/Target
452 Archive = $(AR) $(AR.Flags)
453 LArchive = $(LLVMToolDir)/llvm-ar rcsf
460 #----------------------------------------------------------
461 # Get the list of source files and compute object file
463 #----------------------------------------------------------
466 Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \
467 $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c $(PROJ_SRC_DIR)/*.y \
468 $(PROJ_SRC_DIR)/*.l))
470 Sources := $(SOURCES)
474 Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES))
477 BaseNameSources := $(sort $(basename $(Sources)))
479 ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o)
480 ObjectsLO := $(BaseNameSources:%=$(ObjDir)/%.lo)
481 ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
483 ###############################################################################
484 # DIRECTORIES: Handle recursive descent of directory structure
485 ###############################################################################
487 #---------------------------------------------------------
488 # Provide rules to make install dirs. This must be early
489 # in the file so they get built before dependencies
490 #---------------------------------------------------------
492 $(PROJ_bindir): $(PROJ_bindir)/.dir
493 $(PROJ_libdir): $(PROJ_libdir)/.dir
494 $(PROJ_includedir): $(PROJ_includedir)/.dir
495 $(PROJ_etcdir): $(PROJ_etcdir)/.dir
497 # To create other directories, as needed, and timestamp their creation
499 $(Verb) $(MKDIR) $* > /dev/null
502 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
503 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
505 #---------------------------------------------------------
506 # Handle the DIRS options for sequential construction
507 #---------------------------------------------------------
513 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
514 $(RecursiveTargets)::
515 $(Verb) for dir in $(DIRS); do \
516 if [ ! -f $$dir/Makefile ]; then \
518 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
520 ($(MAKE) -C $$dir $@ ) || exit 1; \
523 $(RecursiveTargets)::
524 $(Verb) for dir in $(DIRS); do \
525 ($(MAKE) -C $$dir $@ ) || exit 1; \
531 #---------------------------------------------------------
532 # Handle the EXPERIMENTAL_DIRS options ensuring success
533 # after each directory is built.
534 #---------------------------------------------------------
535 ifdef EXPERIMENTAL_DIRS
536 $(RecursiveTargets)::
537 $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \
538 if [ ! -f $$dir/Makefile ]; then \
540 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
542 ($(MAKE) -C $$dir $@ ) || exit 0; \
546 #-----------------------------------------------------------
547 # Handle the PARALLEL_DIRS options for parallel construction
548 #-----------------------------------------------------------
551 SubDirs += $(PARALLEL_DIRS)
553 # Unfortunately, this list must be maintained if new recursive targets are added
554 all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS))
555 clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS))
556 clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS))
557 install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS))
558 uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS))
559 install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS))
561 ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T))
564 $(Verb) if [ ! -f $(@D)/Makefile ]; then \
566 $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \
568 $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) ;
571 #---------------------------------------------------------
572 # Handle the OPTIONAL_DIRS options for directores that may
574 #---------------------------------------------------------
577 SubDirs += $(OPTIONAL_DIRS)
579 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
580 $(RecursiveTargets)::
581 $(Verb) for dir in $(OPTIONAL_DIRS); do \
582 if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\
583 if [ ! -f $$dir/Makefile ]; then \
585 $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \
587 ($(MAKE) -C$$dir $@ ) || exit 1; \
591 $(RecursiveTargets)::
592 $(Verb) for dir in $(OPTIONAL_DIRS); do \
593 ($(MAKE) -C$$dir $@ ) || exit 1; \
598 #---------------------------------------------------------
599 # Handle the CONFIG_FILES options
600 #---------------------------------------------------------
603 install-local:: $(PROJ_etcdir) $(CONFIG_FILES)
604 $(Echo) Installing Configuration Files To $(PROJ_etcdir)
605 $(Verb)for file in $(CONFIG_FILES); do \
606 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
607 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
608 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
609 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
611 $(ECHO) Error: cannot find config file $${file}. ; \
616 $(Echo) Uninstalling Configuration Files From $(PROJ_etcdir)
617 $(Verb)for file in $(CONFIG_FILES); do \
618 $(RM) -f $(PROJ_etcdir)/$${file} ; \
623 ###############################################################################
624 # Set up variables for building libararies
625 ###############################################################################
627 #---------------------------------------------------------
628 # Handle the special "JIT" value for LLVM_LIBS which is a
629 # shorthand for a bunch of libraries that get the correct
630 # JIT support for a library or a tool that runs JIT.
631 #---------------------------------------------------------
632 ifeq ($(firstword $(LLVMLIBS)),config)
633 LLVMLIBS := $(shell $(LLVM_CONFIG) --libnames $(wordlist 2,9999,$(LLVMLIBS)))
634 LLVMLIBS := $(patsubst lib%.a,%.a,$(LLVMLIBS))
635 LLVMLIBS := $(patsubst %.o,%,$(LLVMLIBS))
638 ifeq ($(LLVMLIBS),JIT)
640 # Make sure we can get our own symbols in the tool
643 # Generic JIT libraries
644 JIT_LIBS := LLVMInterpreter LLVMJIT
646 # You can enable the X86 JIT on a non-X86 host by setting the flag
647 # ENABLE_X86_JIT on the make command line. If not, it will still be
648 # enabled automagically on an X86 host.
653 # What the X86 JIT requires
658 # You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
659 # ENABLE_PPC_JIT on the make command line. If not, it will still be
660 # enabled automagically on an PowerPC host.
661 ifeq ($(ARCH), PowerPC)
665 # What the PowerPC JIT requires
667 JIT_LIBS += LLVMPowerPC
670 # You can enable the Alpha JIT on a non-Alpha host by setting the flag
671 # ENABLE_ALPHA_JIT on the make command line. If not, it will still be
672 # enabled automagically on an Alpha host.
673 ifeq ($(ARCH), Alpha)
677 # What the Alpha JIT requires
678 ifdef ENABLE_ALPHA_JIT
679 JIT_LIBS += LLVMAlpha
682 JIT_LIBS += LLVMTarget.a LLVMSelectionDAG.a LLVMCodeGen.a LLVMExecutionEngine
684 LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts.a LLVMTransformUtils.a LLVMAnalysis.a \
685 LLVMBCReader.a LLVMCore.a LLVMSupport.a LLVMbzip2.a \
686 LLVMSystem.a $(PLATFORMLIBDL)
689 #---------------------------------------------------------
690 # Define various command line options pertaining to the
691 # libraries needed when linking. There are "Proj" libs
692 # (defined by the user's project) and "LLVM" libs (defined
693 # by the LLVM project).
694 #---------------------------------------------------------
697 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
698 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
699 ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
700 ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs))
704 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
705 LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions))
706 LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
707 LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
710 ifneq ($(strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
711 ifdef LINK_COMPONENTS
712 ProjLibsOptions := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS))
713 ProjLibsPaths := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
717 ###############################################################################
718 # Library Build Rules: Four ways to build a library
719 ###############################################################################
721 #---------------------------------------------------------
722 # Bytecode Module Targets:
723 # If the user set MODULE_NAME then they want to build a
724 # bytecode module from the sources. We compile all the
725 # sources and link it together into a single bytecode
727 #---------------------------------------------------------
730 ifeq ($(strip $(LLVMGCC)),)
731 $(warning Modules require llvm-gcc but no llvm-gcc is available ****)
734 Module := $(LibDir)/$(MODULE_NAME).bc
735 LinkModule := $(GCCLD) -L$(CFERuntimeLibDir)
738 ifdef EXPORTED_SYMBOL_FILE
739 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
742 $(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
743 $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
744 $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
746 all-local:: $(Module)
749 ifneq ($(strip $(Module)),)
750 -$(Verb) $(RM) -f $(Module)
753 ifdef BYTECODE_DESTINATION
754 ModuleDestDir := $(BYTECODE_DESTINATION)
756 ModuleDestDir := $(PROJ_libdir)
759 DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc
761 install-module:: $(DestModule)
762 install-local:: $(DestModule)
764 $(DestModule): $(ModuleDestDir) $(Module)
765 $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
766 $(Verb) $(DataInstall) $(Module) $(DestModule)
769 $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
770 -$(Verb) $(RM) -f $(DestModule)
775 # if we're building a library ...
778 # Make sure there isn't any extranous whitespace on the LIBRARYNAME option
779 LIBRARYNAME := $(strip $(LIBRARYNAME))
780 ifdef LOADABLE_MODULE
781 LibName.LA := $(LibDir)/$(LIBRARYNAME).la
783 LibName.LA := $(LibDir)/lib$(LIBRARYNAME).la
785 LibName.A := $(LibDir)/lib$(LIBRARYNAME).a
786 LibName.O := $(LibDir)/$(LIBRARYNAME).o
787 LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca
789 #---------------------------------------------------------
790 # Shared Library Targets:
791 # If the user asked for a shared library to be built
792 # with the SHARED_LIBRARY variable, then we provide
793 # targets for building them.
794 #---------------------------------------------------------
797 all-local:: $(LibName.LA)
799 ifdef LINK_LIBS_IN_SHARED
800 ifdef LOADABLE_MODULE
801 SharedLibKindMessage := "Lodable Module"
803 SharedLibKindMessage := "Shared Library"
805 $(LibName.LA): $(ObjectsLO) $(LibDir)/.dir
806 $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \
807 $(LIBRARYNAME)$(SHLIBEXT)
808 $(Verb) $(LTLink) -o $@ $(ObjectsLO) $(ProjLibsOptions) \
810 $(Verb) $(LTInstall) $@ $(LibDir)
812 $(LibName.LA): $(ObjectsLO) $(LibDir)/.dir
813 $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT)
814 $(Verb) $(LTLink) -o $@ $(ObjectsLO)
815 $(Verb) $(LTInstall) $@ $(LibDir)
819 ifneq ($(strip $(LibName.LA)),)
820 -$(Verb) $(RM) -f $(LibName.LA)
823 DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
825 install-local:: $(DestSharedLib)
827 $(DestSharedLib): $(PROJ_libdir) $(LibName.LA)
828 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
829 $(Verb) $(LTInstall) $(LibName.LA) $(DestSharedLib)
830 $(Verb) $(LIBTOOL) --finish $(PROJ_libdir)
833 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
834 -$(Verb) $(RM) -f $(PROJ_libdir)/lib$(LIBRARYNAME).*
838 #---------------------------------------------------------
839 # Bytecode Library Targets:
840 # If the user asked for a bytecode library to be built
841 # with the BYTECODE_LIBRARY variable, then we provide
842 # targets for building them.
843 #---------------------------------------------------------
844 ifdef BYTECODE_LIBRARY
845 ifeq ($(strip $(LLVMGCC)),)
846 $(warning Bytecode libraries require llvm-gcc which could not be found ****)
849 all-local:: $(LibName.BCA)
851 ifdef EXPORTED_SYMBOL_FILE
852 BCLinkLib = $(GCCLD) -L$(CFERuntimeLibDir) \
853 -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
855 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(GCCLD) \
856 $(LLVMToolDir)/llvm-ar
857 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
859 $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC)
861 $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o
863 $(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \
864 $(LLVMToolDir)/llvm-ar
865 $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@)
867 $(Verb) $(LArchive) $@ $(ObjectsBC)
872 ifneq ($(strip $(LibName.BCA)),)
873 -$(Verb) $(RM) -f $(LibName.BCA)
876 ifdef BYTECODE_DESTINATION
877 BytecodeDestDir := $(BYTECODE_DESTINATION)
879 BytecodeDestDir := $(PROJ_libdir)
882 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).a
884 install-bytecode-local:: $(DestBytecodeLib)
886 install-local:: $(DestBytecodeLib)
888 $(DestBytecodeLib): $(BytecodeDestDir) $(LibName.BCA)
889 $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
890 $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
893 $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
894 -$(Verb) $(RM) -f $(DestBytecodeLib)
899 #---------------------------------------------------------
900 # ReLinked Library Targets:
901 # If the user explicitly requests a relinked library with
902 # BUILD_RELINKED, provide it. Otherwise, if they specify
903 # neither of BUILD_ARCHIVE or DONT_BUILD_RELINKED, give
905 #---------------------------------------------------------
907 ifndef DONT_BUILD_RELINKED
914 all-local:: $(LibName.O)
916 $(LibName.O): $(ObjectsO) $(LibDir)/.dir
917 $(Echo) Linking $(BuildMode) Object Library $(notdir $@)
918 $(Verb) $(LTRelink) -o $@ $(ObjectsO)
921 ifneq ($(strip $(LibName.O)),)
922 -$(Verb) $(RM) -f $(LibName.O)
925 DestRelinkedLib = $(PROJ_libdir)/$(LIBRARYNAME).o
927 install-local:: $(DestRelinkedLib)
929 $(DestRelinkedLib): $(PROJ_libdir) $(LibName.O)
930 $(Echo) Installing $(BuildMode) Object Library $(DestRelinkedLib)
931 $(Verb) $(LTInstall) $(LibName.O) $(DestRelinkedLib)
934 $(Echo) Uninstalling $(BuildMode) Object Library $(DestRelinkedLib)
935 -$(Verb) $(RM) -f $(DestRelinkedLib)
939 #---------------------------------------------------------
940 # Archive Library Targets:
941 # If the user wanted a regular archive library built,
942 # then we provide targets for building them.
943 #---------------------------------------------------------
946 all-local:: $(LibName.A)
948 $(LibName.A): $(ObjectsO) $(LibDir)/.dir
949 $(Echo) Building $(BuildMode) Archive Library $(notdir $@)
951 $(Verb) $(Archive) $@ $(ObjectsO)
955 ifneq ($(strip $(LibName.A)),)
956 -$(Verb) $(RM) -f $(LibName.A)
959 DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a
961 install-local:: $(DestArchiveLib)
963 $(DestArchiveLib): $(PROJ_libdir) $(LibName.A)
964 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
965 $(Verb) $(MKDIR) $(PROJ_libdir)
966 $(Verb) $(LTInstall) $(LibName.A) $(DestArchiveLib)
969 $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib)
970 -$(Verb) $(RM) -f $(DestArchiveLib)
977 ###############################################################################
978 # Tool Build Rules: Build executable tool based on TOOLNAME option
979 ###############################################################################
983 #---------------------------------------------------------
984 # Set up variables for building a tool.
985 #---------------------------------------------------------
987 ToolBuildPath := $(ExmplDir)/$(strip $(TOOLNAME))$(EXEEXT)
989 ToolBuildPath := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
992 #---------------------------------------------------------
993 # Tell make that we need to rebuild subdirectories before
994 # we can link the tool. This affects things like LLI which
995 # has library subdirectories.
996 #---------------------------------------------------------
997 $(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS))
999 #---------------------------------------------------------
1000 # Provide targets for building the tools
1001 #---------------------------------------------------------
1002 all-local:: $(ToolBuildPath)
1005 ifneq ($(strip $(ToolBuildPath)),)
1006 -$(Verb) $(RM) -f $(ToolBuildPath)
1010 $(ToolBuildPath): $(ExmplDir)/.dir
1012 $(ToolBuildPath): $(ToolDir)/.dir
1015 $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
1016 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
1017 $(Verb) $(LTLink) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
1018 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
1019 $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
1022 DestTool = $(PROJ_bindir)/$(TOOLNAME)
1024 install-local:: $(DestTool)
1026 $(DestTool): $(PROJ_bindir) $(ToolBuildPath)
1027 $(Echo) Installing $(BuildMode) $(DestTool)
1028 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
1031 $(Echo) Uninstalling $(BuildMode) $(DestTool)
1032 -$(Verb) $(RM) -f $(DestTool)
1036 ###############################################################################
1037 # Object Build Rules: Build object files based on sources
1038 ###############################################################################
1040 # FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
1042 DISABLE_AUTO_DEPENDENCIES=1
1045 ifdef SHARED_LIBRARY
1047 MAYBE_PIC_Compile.CXX = $(LTCompile.CXX)
1048 MAYBE_PIC_Compile.C = $(LTCompile.C)
1050 MAYBE_PIC_Compile.CXX = $(Compile.CXX)
1051 MAYBE_PIC_Compile.C = $(Compile.C)
1054 # Provide rule sets for when dependency generation is enabled
1055 ifndef DISABLE_AUTO_DEPENDENCIES
1057 #---------------------------------------------------------
1058 # Create .lo files in the ObjDir directory from the .cpp and .c files...
1059 #---------------------------------------------------------
1061 $(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1062 $(Echo) "Compiling $*.cpp for $(BuildMode) build " $(PIC_FLAG)
1063 $(Verb) if $(MAYBE_PIC_Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ;\
1064 then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
1065 else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
1067 $(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1068 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1069 $(Verb) if $(MAYBE_PIC_Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ;\
1070 then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
1071 else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
1073 $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1074 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1075 $(Verb) if $(MAYBE_PIC_Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \
1076 then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \
1077 else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi
1079 #---------------------------------------------------------
1080 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
1081 #---------------------------------------------------------
1083 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1084 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1085 $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
1086 $< -o $@ -S -emit-llvm ; \
1087 then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
1088 else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
1090 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1091 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1092 $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
1093 $< -o $@ -S -emit-llvm ; \
1094 then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
1095 else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
1097 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1098 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1099 $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" \
1100 $< -o $@ -S -emit-llvm ; \
1101 then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
1102 else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
1104 # Provide alternate rule sets if dependencies are disabled
1107 $(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1108 $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG)
1109 $(MAYBE_PIC_Compile.CXX) $< -o $@
1111 $(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1112 $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
1113 $(MAYBE_PIC_Compile.CXX) $< -o $@
1115 $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1116 $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
1117 $(MAYBE_PIC_Compile.C) $< -o $@
1119 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1120 $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
1121 $(BCCompile.CXX) $< -o $@ -S -emit-llvm
1123 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1124 $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
1125 $(BCCompile.CXX) $< -o $@ -S -emit-llvm
1127 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1128 $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
1129 $(BCCompile.C) $< -o $@ -S -emit-llvm
1134 ## Rules for building preprocessed (.i/.ii) outputs.
1135 $(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1136 $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file"
1137 $(Verb) $(Preprocess.CXX) $< -o $@
1139 $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1140 $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
1141 $(Verb) $(Preprocess.CXX) $< -o $@
1143 $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1144 $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
1145 $(Verb) $(Preprocess.C) $< -o $@
1148 $(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
1149 $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG)
1150 $(MAYBE_PIC_Compile.CXX) $< -o $@ -S
1152 $(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
1153 $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG)
1154 $(MAYBE_PIC_Compile.CXX) $< -o $@ -S
1156 $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
1157 $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
1158 $(MAYBE_PIC_Compile.C) $< -o $@ -S
1161 # make the C and C++ compilers strip debug info out of bytecode libraries.
1163 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
1164 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1165 $(Verb) $(GCCAS) $< -o $@
1167 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
1168 $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
1169 $(Verb) $(GCCAS) -strip-debug $< -o $@
1173 #---------------------------------------------------------
1174 # Provide rule to build .bc files from .ll sources,
1175 # regardless of dependencies
1176 #---------------------------------------------------------
1177 $(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS)
1178 $(Echo) "Compiling $*.ll for $(BuildMode) build"
1179 $(Verb) $(LLVMAS) $< -f -o $@
1181 ###############################################################################
1182 # TABLEGEN: Provide rules for running tblgen to produce *.inc files
1183 ###############################################################################
1187 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
1188 $(LLVM_SRC_ROOT)/lib/Target/Target.td \
1189 $(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td \
1190 $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td)
1191 INCFiles := $(filter %.inc,$(BUILT_SOURCES))
1192 INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp)
1193 .PRECIOUS: $(INCTMPFiles) $(INCFiles)
1195 # All of these files depend on tblgen and the .td files.
1196 $(INCTMPFiles) : $(TBLGEN) $(TDFiles)
1198 # INCFiles rule: All of the tblgen generated files are emitted to
1199 # $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows
1200 # us to only "touch" the real file if the contents of it change. IOW, if
1201 # tblgen is modified, all of the .inc.tmp files are regereated, but no
1202 # dependencies of the .inc files are, unless the contents of the .inc file
1204 $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp
1205 $(Verb) $(CMP) -s $@ $< || $(CP) $< $@
1207 $(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \
1208 $(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir
1209 $(Echo) "Building $(<F) register names with tblgen"
1210 $(Verb) $(TableGen) -gen-register-enums -o $@ $<
1212 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.h.inc.tmp): \
1213 $(ObjDir)/%GenRegisterInfo.h.inc.tmp : %.td $(ObjDir)/.dir
1214 $(Echo) "Building $(<F) register information header with tblgen"
1215 $(Verb) $(TableGen) -gen-register-desc-header -o $@ $<
1217 $(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
1218 $(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir
1219 $(Echo) "Building $(<F) register info implementation with tblgen"
1220 $(Verb) $(TableGen) -gen-register-desc -o $@ $<
1222 $(TARGET:%=$(ObjDir)/%GenInstrNames.inc.tmp): \
1223 $(ObjDir)/%GenInstrNames.inc.tmp : %.td $(ObjDir)/.dir
1224 $(Echo) "Building $(<F) instruction names with tblgen"
1225 $(Verb) $(TableGen) -gen-instr-enums -o $@ $<
1227 $(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
1228 $(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir
1229 $(Echo) "Building $(<F) instruction information with tblgen"
1230 $(Verb) $(TableGen) -gen-instr-desc -o $@ $<
1232 $(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
1233 $(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir
1234 $(Echo) "Building $(<F) assembly writer with tblgen"
1235 $(Verb) $(TableGen) -gen-asm-writer -o $@ $<
1237 $(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
1238 $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir
1239 $(Echo) "Building $(<F) assembly writer #1 with tblgen"
1240 $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $<
1242 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
1243 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir
1244 $(Echo) "Building $(<F) code emitter with tblgen"
1245 $(Verb) $(TableGen) -gen-emitter -o $@ $<
1247 $(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
1248 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
1249 $(Echo) "Building $(<F) instruction selector implementation with tblgen"
1250 $(Verb) $(TableGen) -gen-dag-isel -o $@ $<
1252 $(TARGET:%=$(ObjDir)/%GenSubtarget.inc.tmp): \
1253 $(ObjDir)/%GenSubtarget.inc.tmp : %.td $(ObjDir)/.dir
1254 $(Echo) "Building $(<F) subtarget information with tblgen"
1255 $(Verb) $(TableGen) -gen-subtarget -o $@ $<
1258 -$(Verb) $(RM) -f $(INCFiles)
1262 ###############################################################################
1263 # LEX AND YACC: Provide rules for generating sources with lex and yacc
1264 ###############################################################################
1266 #---------------------------------------------------------
1267 # Provide rules for generating a .cpp source file from
1268 # (f)lex input sources.
1269 #---------------------------------------------------------
1271 LexFiles := $(filter %.l,$(Sources))
1273 ifneq ($(LexFiles),)
1275 # Cancel built-in rules for lex
1279 all:: $(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs)
1281 # Note the extra sed filtering here, used to cut down on the warnings emited
1282 # by GCC. The last line is a gross hack to work around flex aparently not
1283 # being able to resize the buffer on a large token input. Currently, for
1284 # uninitialized string buffers in LLVM we can generate very long tokens, so
1285 # this is a hack around it.
1286 # FIXME. (f.e. char Buffer[10000] )
1287 $(PROJ_SRC_DIR)/%.cpp: $(PROJ_SRC_DIR)/%.l
1288 $(Echo) Flexing $*.l
1289 $(Verb) $(FLEX) -t $(PROJ_SRC_DIR)/$*.l | \
1290 $(SED) 's/void yyunput/inline void yyunput/' | \
1291 $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
1292 $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
1293 > $(PROJ_SRC_DIR)/$*.cpp
1295 # IFF the .l file has changed since it was last checked into CVS, copy the .l
1296 # file to .l.cvs and the generated .cpp file to .cpp.cvs. We use this mechanism
1297 # so that people without flex can build LLVM by copying the .cvs files to the
1298 # source location and building them.
1299 $(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs): \
1300 $(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
1301 $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs || \
1302 ($(CP) $< $@; $(CP) $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs)
1304 $(LexFiles:%.l=$(ObjDir)/%.o) : \
1305 $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
1308 -$(Verb) $(RM) -f $(LexOutput)
1312 #---------------------------------------------------------
1313 # Provide rules for generating a .cpp and .h source files
1314 # from yacc (bison) input sources.
1315 #---------------------------------------------------------
1317 YaccFiles := $(filter %.y,$(Sources))
1318 ifneq ($(YaccFiles),)
1320 .PRECIOUS: $(YaccOutput)
1322 all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs)
1324 # Cancel built-in rules for yacc
1329 # Rule for building the bison based parsers...
1330 $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
1332 $(Echo) "Bisoning $*.y"
1333 $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
1334 $(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp
1335 $(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
1337 $(Echo) "Bison of $*.y SKIPPED -- bison not found"
1340 # IFF the .y file has changed since it was last checked into CVS, copy the .y
1341 # file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs. We use this
1342 # mechanism so that people without flex can build LLVM by copying the .cvs files
1343 # to the source location and building them.
1344 $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs): \
1345 $(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
1346 $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs || \
1348 $(CP) $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs; \
1349 $(CP) $(PROJ_SRC_DIR)/$*.h $(PROJ_SRC_DIR)/$*.h.cvs)
1352 $(YaccFiles:%.y=$(ObjDir)/%.o): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
1354 YaccOutput := $(YaccFiles:%.y=%.output)
1357 -$(Verb) $(RM) -f $(YaccOutput)
1360 ###############################################################################
1361 # OTHER RULES: Other rules needed
1362 ###############################################################################
1364 # To create postscript files from dot files...
1365 ifneq ($(DOT),false)
1367 $(DOT) -Tps < $< > $@
1370 $(Echo) "Cannot build $@: The program dot is not installed"
1373 # This rules ensures that header files that are removed still have a rule for
1374 # which they can be "generated." This allows make to ignore them and
1375 # reproduce the dependency lists.
1379 # Define clean-local to clean the current directory. Note that this uses a
1380 # very conservative approach ensuring that empty variables do not cause
1381 # errors or disastrous removal.
1383 ifneq ($(strip $(ObjDir)),)
1384 -$(Verb) $(RM) -rf $(ObjDir)
1386 -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
1387 ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
1388 -$(Verb) $(RM) -f *$(SHLIBEXT)
1392 -$(Verb) $(RM) -rf Debug Release Profile
1394 # Build tags database for Emacs/Xemacs:
1398 find $(PROJ_SRC_ROOT)/include $(PROJ_SRC_ROOT)/lib \
1399 $(PROJ_SRC_ROOT)/tools $(PROJ_SRC_ROOT)/examples \
1400 $(PROJ_OBJ_ROOT)/include $(PROJ_OBJ_ROOT)/lib \
1401 $(PROJ_OBJ_ROOT)/tools $(PROJ_OBJ_ROOT)/examples \
1402 -name '*.cpp' -o -name '*.h' | \
1403 $(ETAGS) $(ETAGSFLAGS) -
1406 find $(PROJ_SRC_ROOT)/include $(PROJ_SRC_ROOT)/lib \
1407 $(PROJ_SRC_ROOT)/tools $(PROJ_SRC_ROOT)/examples \
1408 $(PROJ_OBJ_ROOT)/include $(PROJ_OBJ_ROOT)/lib \
1409 $(PROJ_OBJ_ROOT)/tools $(PROJ_OBJ_ROOT)/examples \
1410 \( -name '*.cpp' -o -name '*.h' \) -print | \
1411 ctags -ImtT -o $(PROJ_OBJ_ROOT)/CTAGS -L -
1414 ###############################################################################
1415 # DEPENDENCIES: Include the dependency files if we should
1416 ###############################################################################
1417 ifndef DISABLE_AUTO_DEPENDENCIES
1419 # If its not one of the cleaning targets
1420 ifneq ($(strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
1422 # Get the list of dependency files
1423 DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))
1424 DependFiles := $(DependFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d)
1426 -include /dev/null $(DependFiles)
1432 ###############################################################################
1433 # CHECK: Running the test suite
1434 ###############################################################################
1437 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
1438 if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
1439 $(EchoCmd) Running test suite ; \
1440 $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \
1441 TESTSUITE=$(TESTSUITE) ; \
1443 $(EchoCmd) No Makefile in test directory ; \
1446 $(EchoCmd) No test directory ; \
1449 ###############################################################################
1450 # DISTRIBUTION: Handle construction of a distribution tarball
1451 ###############################################################################
1453 #------------------------------------------------------------------------
1454 # Define distribution related variables
1455 #------------------------------------------------------------------------
1456 DistName := $(PROJECT_NAME)-$(PROJ_VERSION)
1457 DistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1458 TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName)
1459 DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz
1460 DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip
1461 DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2
1462 DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \
1463 ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \
1464 Makefile.config.in configure autoconf
1465 DistOther := $(notdir $(wildcard \
1466 $(PROJ_SRC_DIR)/*.h \
1467 $(PROJ_SRC_DIR)/*.td \
1468 $(PROJ_SRC_DIR)/*.def \
1469 $(PROJ_SRC_DIR)/*.ll \
1470 $(PROJ_SRC_DIR)/*.in))
1471 DistSubDirs := $(SubDirs)
1472 DistSources = $(Sources) $(EXTRA_DIST)
1473 DistFiles = $(DistAlways) $(DistSources) $(DistOther)
1475 #------------------------------------------------------------------------
1476 # We MUST build distribution with OBJ_DIR != SRC_DIR
1477 #------------------------------------------------------------------------
1478 ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR))
1479 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1480 $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR
1484 #------------------------------------------------------------------------
1485 # Prevent attempt to run dist targets from anywhere but the top level
1486 #------------------------------------------------------------------------
1488 dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip ::
1489 $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT)
1492 #------------------------------------------------------------------------
1493 # Provide the top level targets
1494 #------------------------------------------------------------------------
1496 dist-gzip:: $(DistTarGZip)
1498 $(DistTarGZip) : $(TopDistDir)/.makedistdir
1499 $(Echo) Packing gzipped distribution tar file.
1500 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \
1501 $(GZIP) -c > "$(DistTarGZip)"
1503 dist-bzip2:: $(DistTarBZ2)
1505 $(DistTarBZ2) : $(TopDistDir)/.makedistdir
1506 $(Echo) Packing bzipped distribution tar file.
1507 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \
1508 $(BZIP2) -c >$(DistTarBZ2)
1510 dist-zip:: $(DistZip)
1512 $(DistZip) : $(TopDistDir)/.makedistdir
1513 $(Echo) Packing zipped distribution file.
1514 $(Verb) rm -f $(DistZip)
1515 $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
1517 dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
1518 $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
1520 DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
1522 dist-check:: $(DistTarGZip)
1523 $(Echo) Checking distribution tar file.
1524 $(Verb) if test -d $(DistCheckDir) ; then \
1525 $(RM) -rf $(DistCheckDir) ; \
1527 $(Verb) $(MKDIR) $(DistCheckDir)
1528 $(Verb) cd $(DistCheckDir) && \
1529 $(MKDIR) $(DistCheckDir)/build && \
1530 $(MKDIR) $(DistCheckDir)/install && \
1531 gunzip -c $(DistTarGZip) | $(TAR) xf - && \
1533 ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
1534 --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
1537 $(MAKE) install && \
1538 $(MAKE) uninstall && \
1539 $(MAKE) dist-clean && \
1540 $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
1543 $(Echo) Cleaning distribution files
1544 -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
1549 #------------------------------------------------------------------------
1550 # Provide the recursive distdir target for building the distribution directory
1551 #------------------------------------------------------------------------
1552 distdir: $(DistDir)/.makedistdir
1553 $(DistDir)/.makedistdir: $(DistSources)
1554 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
1555 if test -d "$(DistDir)" ; then \
1556 find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
1559 $(EchoCmd) Removing old $(DistDir) ; \
1560 $(RM) -rf $(DistDir); \
1561 $(EchoCmd) Making 'all' to verify build ; \
1562 $(MAKE) ENABLE_OPTIMIZED=1 all ; \
1564 $(Echo) Building Distribution Directory $(DistDir)
1565 $(Verb) $(MKDIR) $(DistDir)
1566 $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
1567 srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
1568 for file in $(DistFiles) ; do \
1570 $(PROJ_SRC_DIR)/*) \
1571 file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
1573 $(PROJ_SRC_ROOT)/*) \
1574 file=`echo "$$file" | \
1575 sed "s#^$$srcrootstrip/##"` \
1578 if test -f "$(PROJ_SRC_DIR)/$$file" || \
1579 test -d "$(PROJ_SRC_DIR)/$$file" ; then \
1580 from_dir="$(PROJ_SRC_DIR)" ; \
1581 elif test -f "$$file" || test -d "$$file" ; then \
1584 to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
1585 if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
1586 to_dir="$(DistDir)/$$dir"; \
1587 $(MKDIR) "$$to_dir" ; \
1589 to_dir="$(DistDir)"; \
1591 mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
1592 if test -n "$$mid_dir" ; then \
1593 $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
1595 if test -d "$$from_dir/$$file"; then \
1596 if test -d "$(PROJ_SRC_DIR)/$$file" && \
1597 test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
1598 cd $(PROJ_SRC_DIR) ; \
1599 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
1600 ( cd $$to_dir ; $(TAR) xf - ) ; \
1601 cd $(PROJ_OBJ_DIR) ; \
1604 $(TAR) cf - $$file --exclude .svn --exclude CVS | \
1605 ( cd $$to_dir ; $(TAR) xf - ) ; \
1606 cd $(PROJ_OBJ_DIR) ; \
1608 elif test -f "$$from_dir/$$file" ; then \
1609 $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
1610 elif test -L "$$from_dir/$$file" ; then \
1611 $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
1612 elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
1613 $(EchoCmd) "===== WARNING: Distribution Source " \
1614 "$$from_dir/$$file Not Found!" ; \
1615 elif test "$(Verb)" != '@' ; then \
1616 $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
1619 $(Verb) for subdir in $(DistSubDirs) ; do \
1620 if test "$$subdir" \!= "." ; then \
1621 new_distdir="$(DistDir)/$$subdir" ; \
1622 test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
1623 ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
1624 DistDir="$$new_distdir" distdir ) || exit 1; \
1627 $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
1628 $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
1629 $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
1630 -name .svn \) -print` ;\
1631 $(MAKE) dist-hook ; \
1632 $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
1633 -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
1634 -o ! -type d ! -perm -400 -exec chmod a+r {} \; \
1635 -o ! -type d ! -perm -444 -exec \
1636 $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
1637 || chmod -R a+r $(DistDir) ; \
1640 # This is invoked by distdir target, define it as a no-op to avoid errors if not
1646 ###############################################################################
1647 # TOP LEVEL - targets only to apply at the top level directory
1648 ###############################################################################
1652 #------------------------------------------------------------------------
1653 # Install support for the project's include files:
1654 #------------------------------------------------------------------------
1656 $(Echo) Installing include files
1657 $(Verb) $(MKDIR) $(PROJ_includedir)
1658 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
1659 cd $(PROJ_SRC_ROOT)/include && \
1660 for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
1661 -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \
1662 instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
1663 if test \! -d "$$instdir" ; then \
1664 $(EchoCmd) Making install directory $$instdir ; \
1665 $(MKDIR) $$instdir ;\
1667 $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
1670 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
1671 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
1672 cd $(PROJ_OBJ_ROOT)/include && \
1673 for hdr in `find . -type f -print | grep -v CVS` ; do \
1674 $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
1680 $(Echo) Uninstalling include files
1681 $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
1682 cd $(PROJ_SRC_ROOT)/include && \
1683 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
1684 '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' \
1685 -o -name '*.in' ')' -print ')' | \
1686 grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
1687 cd $(PROJ_SRC_ROOT)/include && \
1688 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
1689 -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
1694 #------------------------------------------------------------------------
1695 # Print out the directories used for building
1696 #------------------------------------------------------------------------
1698 $(Echo) "BuildMode : " '$(BuildMode)'
1699 $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
1700 $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
1701 $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
1702 $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
1703 $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
1704 $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
1705 $(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
1706 $(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
1707 $(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
1708 $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
1709 $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
1710 $(Echo) "UserTargets : " '$(UserTargets)'
1711 $(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
1712 $(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
1713 $(Echo) "ObjDir : " '$(ObjDir)'
1714 $(Echo) "LibDir : " '$(LibDir)'
1715 $(Echo) "ToolDir : " '$(ToolDir)'
1716 $(Echo) "ExmplDir : " '$(ExmplDir)'
1717 $(Echo) "Sources : " '$(Sources)'
1718 $(Echo) "TDFiles : " '$(TDFiles)'
1719 $(Echo) "INCFiles : " '$(INCFiles)'
1720 $(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
1721 $(Echo) "PreConditions: " '$(PreConditions)'
1722 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
1723 $(Echo) "Compile.C : " '$(Compile.C)'
1724 $(Echo) "Archive : " '$(Archive)'
1725 $(Echo) "YaccFiles : " '$(YaccFiles)'
1726 $(Echo) "LexFiles : " '$(LexFiles)'
1727 $(Echo) "Module : " '$(Module)'
1728 $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
1729 $(Echo) "SubDirs : " '$(SubDirs)'