Transform floor((double)FLT) -> (double)floorf(FLT), implementing
[oota-llvm.git] / Makefile.rules
index c130368b7539069f061b65439c9b2b2b854e828f..61e683239e890dded4d3070827301115b70ec5a3 100644 (file)
@@ -28,6 +28,13 @@ TopLevelTargets  := check dist dist-check dist-clean tags dist-gzip dist-bzip2 \
 UserTargets      := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
 InternalTargets  := preconditions distdir dist-hook
 
+FilesToConfig := \
+  include/llvm/Config/config.h \
+  include/llvm/Support/DataTypes.h \
+  include/llvm/ADT/hash_map \
+  include/llvm/ADT/hash_set \
+  include/llvm/ADT/iterator
+
 ################################################################################
 # INITIALIZATION: Basic things the makefile needs
 ################################################################################
@@ -77,6 +84,9 @@ ifneq ($(MakefileConfigIn),)
 PreConditions      += $(MakefileConfig)
 endif
 
+FilesToConfigPATH  := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
+PreConditions      += $(FilesToConfigPATH)
+
 preconditions : $(PreConditions)
 
 #------------------------------------------------------------------------
@@ -134,6 +144,11 @@ $(ConfigStatusScript): $(ConfigureScript)
          $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
          $(ConfigStatusScript)
 
+.PRECIOUS: $(FilesToConfigPATH)
+$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in 
+       $(Echo) Regenerating $*
+       $(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
+
 #------------------------------------------------------------------------
 # Make sure the configuration makefile is up to date
 #------------------------------------------------------------------------
@@ -602,6 +617,18 @@ ifdef ENABLE_PPC_JIT
   JIT_LIBS += LLVMPowerPC LLVMSelectionDAG
 endif
 
+# You can enable the Alpha JIT on a non-Alpha host by setting the flag
+# ENABLE_ALPHA_JIT on the make command line. If not, it will still be
+# enabled automagically on an Alpha host.
+ifeq ($(ARCH), Alpha)
+  ENABLE_ALPHA_JIT = 1
+endif
+
+# What the Alpha JIT requires
+ifdef ENABLE_ALPHA_JIT
+  JIT_LIBS += LLVMAlpha LLVMSelectionDAG
+endif
+
 LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts LLVMAnalysis.a LLVMTransformUtils.a \
             LLVMBCReader LLVMCore LLVMSupport.a LLVMTarget.a LLVMbzip2 \
             LLVMSystem.a $(PLATFORMLIBDL)
@@ -613,6 +640,12 @@ endif
 # (defined by the user's project) and "LLVM" libs (defined 
 # by the # LLVM project).
 #---------------------------------------------------------
+# Some versions of gcc on Alpha produce too many symbols, so use a .a file
+ifeq ($(ARCH),Alpha)
+USEDLIBS :=  $(subst LLVMCore, LLVMCore.a, $(USEDLIBS))
+LLVMLIBS := $(subst LLVMCore, LLVMCore.a, $(LLVMLIBS))
+endif
+
 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o,  $(ProjLibsOptions))
 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
@@ -1366,7 +1399,7 @@ dist-check:: $(DistTarGZip)
          gunzip -c $(DistTarGZip) | $(TAR) xf - && \
          cd build && \
          ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
-           --srcdir=../$(DistName) && \
+           --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
          $(MAKE) all && \
          $(MAKE) check && \
          $(MAKE) install && \
@@ -1432,9 +1465,16 @@ $(DistDir)/.makedistdir: $(DistSources)
          if test -d "$$from_dir/$$file"; then \
            if test -d "$(PROJ_SRC_DIR)/$$file" && \
               test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
-             $(CP) -pR "$(PROJ_SRC_DIR)/$$file" "$$to_dir" || exit 1; \
+              cd $(PROJ_SRC_DIR) ; \
+              $(TAR) cf - $$file --exclude .svn --exclude CVS | \
+                ( cd $$to_dir ; $(TAR) xf - ) ; \
+              cd $(PROJ_OBJ_DIR) ; \
+           else \
+              cd $$from_dir ; \
+              $(TAR) cf - $$file --exclude .svn --exclude CVS | \
+                ( cd $$to_dir ; $(TAR) xf - ) ; \
+              cd $(PROJ_OBJ_DIR) ; \
            fi; \
-           $(CP) -pR $$from_dir/$$file $$to_dir || exit 1; \
          elif test -f "$$from_dir/$$file" ; then \
            $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
          elif test -L "$$from_dir/$$file" ; then \
@@ -1455,8 +1495,8 @@ $(DistDir)/.makedistdir: $(DistSources)
          fi; \
        done
        $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
-         $(EchoCmd) Eliminating CVS directories from distribution ; \
-         $(RM) -rf `find $(TopDistDir) -type d -name CVS -print` ;\
+         $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
+         $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o -name .svn \) -print` ;\
          $(MAKE) dist-hook ; \
          $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
            -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
@@ -1551,3 +1591,4 @@ printvars::
        $(Echo) "YaccFiles    : " '$(YaccFiles)'
        $(Echo) "LexFiles     : " '$(LexFiles)'
        $(Echo) "Module       : " '$(Module)'
+       $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'