AR.Flags := cru
LibTool.Flags := --tag=CXX
+#Make Floating point ieee complient on alpha
+ifeq ($(ARCH),Alpha)
+ CXX.Flags += -mieee
+ CPP.Flags += -mieee
+endif
+
#--------------------------------------------------------------------
# Directory locations
#--------------------------------------------------------------------
ifndef LLI
LLI := $(LLVMToolDir)/lli$(EXEEXT)
endif
+ifndef LLC
+LLC := $(LLVMToolDir)/llc$(EXEEXT)
+endif
ifndef LOPT
LOPT := $(LLVMToolDir)/opt$(EXEEXT)
endif
ifndef KEEP_SYMBOLS
Strip := $(PLATFORMSTRIPOPTS)
StripWarnMsg := "(without symbols)"
+ Install.StripFlag += -s
endif
# Adjust linker flags for building an executable
CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
-LD.Flags += -L$(LibDir) -L$(LLVMLibDir) $(LIBS)
+LD.Flags += -L$(LibDir) -L$(LLVMLibDir)
CPP.Flags += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
-I$(PROJ_OBJ_ROOT)/include \
-I$(PROJ_SRC_ROOT)/include \
$(CompileCommonOpts) $(LD.Flags) $(Strip)
Relink = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
$(CompileCommonOpts)
-LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL)
+LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) \
+ $(Install.Flags)
+ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755
+DataInstall = $(INSTALL) -m 0644
Burg = $(BURG) -I $(PROJ_SRC_DIR)
TableGen = $(TBLGEN) -I $(PROJ_SRC_DIR)
Archive = $(AR) $(AR.Flags)
$(Echo) Installing Configuration Files To $(PROJ_etcdir)
$(Verb)for file in $(CONFIG_FILES); do \
if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
- $(INSTALL) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
+ $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
- $(INSTALL) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
+ $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
else \
$(ECHO) Error: cannot find config file $${file}. ; \
fi \
#---------------------------------------------------------
ifdef MODULE_NAME
+ifeq ($(strip $(LLVMGCC)),)
+$(warning Modules require llvm-gcc but no llvm-gcc is available)
+else
Module := $(LibDir)/$(MODULE_NAME).bc
LinkModule := $(LLVMGCCWITHPATH) -shared -nostdlib
$(DestModule): $(ModuleDestDir) $(Module)
$(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
- $(Verb) $(INSTALL) $(Module) $@
+ $(Verb) $(DataInstall) $(Module) $(DestModule)
uninstall-local::
$(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
-$(Verb) $(RM) -f $(DestModule)
endif
+endif
# if we're building a library ...
ifdef LIBRARYNAME
# targets for building them.
#---------------------------------------------------------
ifdef BYTECODE_LIBRARY
+ifeq ($(strip $(LLVMGCC)),)
+$(warning Bytecode libraries require llvm-gcc which could not be found)
+else
# make the C and C++ compilers strip debug info out of bytecode libraries.
BCCompile.C += -Wa,-strip-debug
$(DestBytecodeLib): $(BytecodeDestDir) $(LibName.BCA)
$(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib)
- $(Verb) $(INSTALL) $(LibName.BCA) $@
+ $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib)
uninstall-local::
$(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib)
-$(Verb) $(RM) -f $(DestBytecodeLib)
endif
+endif
#---------------------------------------------------------
# ReLinked Library Targets:
# What the X86 JIT requires
ifdef ENABLE_X86_JIT
- JIT_LIBS += LLVMX86 LLVMSelectionDAG
+ JIT_LIBS += LLVMX86 LLVMSelectionDAG
endif
# You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag
ifdef ENABLE_SPARCV9_JIT
JIT_LIBS += LLVMSparcV9 LLVMSparcV9ModuloSched LLVMSparcV9InstrSched \
LLVMSparcV9LiveVar LLVMInstrumentation.a LLVMProfilePaths \
- LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \
- LLVMDataStructure.a LLVMSparcV9RegAlloc
+ LLVMBCWriter LLVMTransforms.a LLVMipo.a LLVMipa.a \
+ LLVMDataStructure.a LLVMSparcV9RegAlloc
endif
# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
# What the PowerPC JIT requires
ifdef ENABLE_PPC_JIT
- JIT_LIBS += LLVMPowerPC
+ JIT_LIBS += LLVMPowerPC LLVMSelectionDAG
endif
LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \
- LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
- LLVMSystem.a $(PLATFORMLIBDL)
+ LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
+ LLVMSystem.a $(PLATFORMLIBDL)
endif
#---------------------------------------------------------
$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
$(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
- $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
+ $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS)
$(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) $(StripWarnMsg)
DestTool = $(PROJ_bindir)/$(TOOLNAME)
$(DestTool): $(PROJ_bindir) $(ToolBuildPath)
$(Echo) Installing $(BuildMode) $(DestTool)
- $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool)
+ $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
uninstall-local::
$(Echo) Uninstalling $(BuildMode) $(DestTool)
install-local::
$(Echo) Installing include files
$(Verb) $(MKDIR) $(PROJ_includedir)
- $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
+ $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
cd $(PROJ_SRC_ROOT)/include && \
- find . -path '*/Internal' -prune -o '(' -type f \
- '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
- -print ')' | grep -v CVS | pax -rwdvpe $(PROJ_includedir) ; \
+ for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
+ -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \
+ instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
+ if test \! -d "$$instdir" ; then \
+ $(EchoCmd) Making install directory $$instdir ; \
+ $(MKDIR) $$instdir ;\
+ fi ; \
+ $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
+ done ; \
+ fi
+ $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
+ cd $(PROJ_OBJ_ROOT)/include && \
+ for hdr in `find . -type f -print` ; do \
+ $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
+ done ; \
fi
uninstall-local::
$(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
cd $(PROJ_SRC_ROOT)/include && \
$(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
- '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' ')' \
+ '!' '(' -name '*~' -o -name '.cvsignore' -o -name '.#*' -o -name '*.in' ')' \
-print ')' | grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
- fi
+ cd $(PROJ_SRC_ROOT)/include && \
+ $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' -print ')' \
+ | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
+ fi
endif
$(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
$(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
$(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
+ $(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
$(Echo) "UserTargets : " '$(UserTargets)'
$(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
$(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
$(Echo) "TDFiles : " '$(TDFiles)'
$(Echo) "INCFiles : " '$(INCFiles)'
$(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
- $(Echo) "Preconditions: " '$(Preconditions)'
+ $(Echo) "PreConditions: " '$(PreConditions)'
$(Echo) "Compile.CXX : " '$(Compile.CXX)'
$(Echo) "Compile.C : " '$(Compile.C)'
$(Echo) "Archive : " '$(Archive)'