Update some of the llvm in the readme
[oota-llvm.git] / Makefile.rules
index b349b2226c9c8050ed567165c7268b3e6b40e190..2b9b7fa1fc8b8d536745f0eb93300e187404d2f8 100644 (file)
@@ -255,6 +255,11 @@ else
   C.Flags   += -D_DEBUG
 endif
 
+ifeq ($(ENABLE_PIC),1)
+  CXX.Flags += -fPIC
+  C.Flags   += -fPIC
+endif
+
 CXX.Flags     += $(CXXFLAGS) -Woverloaded-virtual
 C.Flags       += $(CFLAGS)
 CPP.BaseFlags += $(CPPFLAGS)
@@ -264,8 +269,16 @@ LibTool.Flags := --tag=CXX
 
 # Make Floating point IEEE compliant on Alpha.
 ifeq ($(ARCH),Alpha)
-  CXX.Flags     += -mieee -fPIC
-  CPP.BaseFlags += -mieee -fPIC
+  CXX.Flags     += -mieee
+  CPP.BaseFlags += -mieee
+ifeq ($(ENABLE_PIC),0)
+  CXX.Flags     += -fPIC
+  CPP.BaseFlags += -fPIC
+endif
+endif
+
+ifeq ($(ARCH),Alpha)
+  LD.Flags += -Wl,--no-relax
 endif
 
 #--------------------------------------------------------------------
@@ -326,14 +339,15 @@ 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)
+LLVMGCCWITHPATH  := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC)
+LLVMGXXWITHPATH  := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX)
 else
 UPGRADE_MSG =
 UPGRADE_LL  =
+LLVMGCCWITHPATH  := $(LLVMGCC)
+LLVMGXXWITHPATH  := $(LLVMGXX)
 endif
 
-LLVMGCCWITHPATH  := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC)
-LLVMGXXWITHPATH  := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX)
-
 #--------------------------------------------------------------------
 # Adjust to user's request
 #--------------------------------------------------------------------
@@ -1032,7 +1046,7 @@ $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
 # Create .bc files in the ObjDir directory from .cpp .cc and .c files...
 #---------------------------------------------------------
 
-$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
+$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
        $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)"
        $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
                               $< -o $@ -S -emit-llvm ; \
@@ -1041,7 +1055,7 @@ $(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
        $(call UPGRADE_MSG,$@) 
        $(call UPGRADE_LL,$@)
 
-$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
+$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
        $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)"
        $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" \
                               $< -o $@ -S -emit-llvm ; \
@@ -1050,7 +1064,7 @@ $(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
        $(call UPGRADE_MSG,$@) 
        $(call UPGRADE_LL,$@)
 
-$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
+$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGCC)
        $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
        $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" \
                             $< -o $@ -S -emit-llvm ; \
@@ -1074,19 +1088,19 @@ $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
        $(MAYBE_PIC_Compile.C) $< -o $@ 
 
-$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
+$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
        $(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)
+$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGXX)
        $(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)
+$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMGCC)
        $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)"
        $(BCCompile.C) $< -o $@ -S -emit-llvm
        $(call UPGRADE_MSG,@) 
@@ -1104,7 +1118,7 @@ $(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file"
        $(Verb) $(Preprocess.CXX) $< -o $@
 
- $(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
+$(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
        $(Echo) "Compiling $*.c for $(BuildMode) build to .i file"
        $(Verb) $(Preprocess.C) $< -o $@