manually upgrade test. Add a new test2. I have no way to see if this works
[oota-llvm.git] / Makefile.rules
index e06ae184c93e854774b36a56b2486e1565406873..de97781fcc47e1f38dd635f67480891b915c550c 100644 (file)
@@ -85,7 +85,7 @@ preconditions: $(PreConditions)
 #------------------------------------------------------------------------
 $(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES)
 
-clean-local::
+clean-all-local::
 ifneq ($(strip $(BUILT_SOURCES)),)
        -$(Verb) $(RM) -f $(BUILT_SOURCES)
 endif
@@ -312,11 +312,8 @@ ifndef TBLGEN
   endif
 endif
 LLVM_CONFIG := $(LLVMToolDir)/llvm-config 
-ifndef GCCAS
-GCCAS    := $(LLVMToolDir)/gccas$(EXEEXT)
-endif
-ifndef GCCLD
-GCCLD    := $(LLVMToolDir)/gccld$(EXEEXT)
+ifndef LLVMLD
+LLVMLD    := $(LLVMToolDir)/llvm-ld$(EXEEXT)
 endif
 ifndef LLVMDIS
 LLVMDIS  := $(LLVMToolDir)/llvm-dis$(EXEEXT)
@@ -712,14 +709,14 @@ $(warning Modules require llvm-gcc but no llvm-gcc is available ****)
 else
 
 Module     := $(LibDir)/$(MODULE_NAME).bc
-LinkModule := $(GCCLD) -L$(CFERuntimeLibDir)
+LinkModule := $(LLVMLD) -L$(CFERuntimeLibDir)
 
 
 ifdef EXPORTED_SYMBOL_FILE
 LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
 endif
 
-$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD)
+$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD)
        $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@)
        $(Verb) $(LinkModule) -o $@ $(ObjectsBC)
 
@@ -842,10 +839,10 @@ else
 all-local:: $(LibName.BCA)
 
 ifdef EXPORTED_SYMBOL_FILE
-BCLinkLib = $(GCCLD) -L$(CFERuntimeLibDir) \
+BCLinkLib = $(LLVMLD) -L$(CFERuntimeLibDir) \
                      -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE)
 
-$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(GCCLD) \
+$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \
                 $(LLVMToolDir)/llvm-ar
        $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \
          "(internalize)"
@@ -1182,13 +1179,14 @@ $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
 
 # make the C and C++ compilers strip debug info out of bytecode libraries.
 ifdef DEBUG_RUNTIME
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
-       $(Verb) $(GCCAS) $< -o $@
+       $(Verb) $(LLVMAS) $< -o - | $(LOPT) -std-compile-opts -o $@ -f
 else
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(GCCAS)
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
-       $(Verb) $(GCCAS) -strip-debug $< -o $@
+       $(Verb) $(LLVMAS) $< -o - | \
+          $(LOPT) -std-compile-opts -strip-debug -o $@ -f
 endif
 
 
@@ -1208,6 +1206,7 @@ ifdef TARGET
 
 TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \
            $(LLVM_SRC_ROOT)/lib/Target/Target.td \
+           $(LLVM_SRC_ROOT)/lib/Target/TargetCallingConv.td \
            $(LLVM_SRC_ROOT)/lib/Target/TargetSelectionDAG.td \
            $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \
            $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td)
@@ -1277,6 +1276,11 @@ $(ObjDir)/%GenSubtarget.inc.tmp : %.td $(ObjDir)/.dir
        $(Echo) "Building $(<F) subtarget information with tblgen"
        $(Verb) $(TableGen) -gen-subtarget -o $@ $<
 
+$(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
+$(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir
+       $(Echo) "Building $(<F) calling convention information with tblgen"
+       $(Verb) $(TableGen) -gen-callingconv -o $@ $<
+
 clean-local::
        -$(Verb) $(RM) -f $(INCFiles)
 
@@ -1687,7 +1691,8 @@ install-local::
        $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
          cd $(PROJ_SRC_ROOT)/include && \
          for  hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
-             -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \
+             -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \
+             grep -v .svn` ; do \
            instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
            if test \! -d "$$instdir" ; then \
              $(EchoCmd) Making install directory $$instdir ; \
@@ -1756,3 +1761,5 @@ printvars::
        $(Echo) "Module       : " '$(Module)'
        $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
        $(Echo) "SubDirs      : " '$(SubDirs)'
+       $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
+       $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'