this warning is obsolete with llvmgcc3 being gone
[oota-llvm.git] / Makefile.rules
index a8b1b8056df2b203b15736e8134b40db29fcf80a..b349b2226c9c8050ed567165c7268b3e6b40e190 100644 (file)
@@ -320,6 +320,16 @@ endif
 ifndef LBUGPOINT
 LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT)
 endif
+ifndef LUPGRADE
+LUPGRADE := $(LLVMToolDir)/llvm-upgrade$(EXEEXT)
+endif
+ifeq ($(LLVMGCC_MAJVERS),3)
+UPGRADE_MSG = $(Echo) "Upgrading $(1) assembly to latest."
+UPGRADE_LL  = $(Verb)$(LUPGRADE) $(1) -o $(1).up.tmp -f ; $(MV) $(1).up.tmp $(1)
+else
+UPGRADE_MSG =
+UPGRADE_LL  =
+endif
 
 LLVMGCCWITHPATH  := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC)
 LLVMGXXWITHPATH  := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX)
@@ -1028,6 +1038,8 @@ $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
                               $< -o $@ -S -emit-llvm ; \
        then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
        else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
+       $(call UPGRADE_MSG,$@) 
+       $(call UPGRADE_LL,$@)
 
 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
@@ -1035,6 +1047,8 @@ $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
                               $< -o $@ -S -emit-llvm ; \
        then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \
        else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi
+       $(call UPGRADE_MSG,$@) 
+       $(call UPGRADE_LL,$@)
 
 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
@@ -1042,6 +1056,8 @@ $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
                             $< -o $@ -S -emit-llvm ; \
        then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \
        else $(RM) -f "$(ObjDir)/$*.BCCd"; exit 1; fi
+       $(call UPGRADE_MSG,$@) 
+       $(call UPGRADE_LL,$@)
 
 # Provide alternate rule sets if dependencies are disabled
 else
@@ -1061,14 +1077,20 @@ $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
 $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
        $(BCCompile.CXX) $< -o $@ -S -emit-llvm
+       $(call UPGRADE_MSG,$@) 
+       $(call UPGRADE_LL,$@)
 
 $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
        $(BCCompile.CXX) $< -o $@ -S -emit-llvm
+       $(call UPGRADE_MSG,$@) 
+       $(call UPGRADE_LL,$@)
 
 $(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
        $(BCCompile.C) $< -o $@ -S -emit-llvm
+       $(call UPGRADE_MSG,@) 
+       $(call UPGRADE_LL,@)
 
 endif
 
@@ -1099,10 +1121,18 @@ $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG)
        $(MAYBE_PIC_Compile.C) $< -o $@ -S
 
+
 # make the C and C++ compilers strip debug info out of bytecode libraries.
+ifdef DEBUG_RUNTIME
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
+       $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
+       $(Verb) $(GCCAS) $< -o $@
+else
 $(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
        $(Verb) $(GCCAS) -strip-debug $< -o $@
+endif
+
 
 #---------------------------------------------------------
 # Provide rule to build .bc files from .ll sources,