* The aesthetic police is on patrol!!...
[oota-llvm.git] / Makefile.rules
index 78cc43632cfe9096ea099e02f1ee3d5472ead859..5fd539daaa7c6f07bfc0dd2d7481677463da483e 100644 (file)
@@ -275,6 +275,9 @@ endif
 ifndef LLI
 LLI      := $(LLVMToolDir)/lli$(EXEEXT)
 endif
+ifndef LLC
+LLC      := $(LLVMToolDir)/llc$(EXEEXT)
+endif
 ifndef LOPT
 LOPT     := $(LLVMToolDir)/opt$(EXEEXT)
 endif
@@ -322,6 +325,7 @@ endif
 ifndef KEEP_SYMBOLS
   Strip := $(PLATFORMSTRIPOPTS)
   StripWarnMsg := "(without symbols)"
+  Install.StripFlag += -s
 endif
 
 # Adjust linker flags for building an executable
@@ -359,7 +363,10 @@ Link          = $(LIBTOOL) $(LibTool.Flags) --mode=link $(CXX) $(CPP.Flags) \
                $(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)
@@ -526,9 +533,9 @@ install-local:: $(PROJ_etcdir) $(CONFIG_FILES)
        $(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 \
@@ -590,7 +597,7 @@ install-local:: $(DestModule)
 
 $(DestModule): $(ModuleDestDir) $(Module) 
        $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule)
-       $(Verb) $(INSTALL) $(Module) $@
+       $(Verb) $(DataInstall) $(Module) $(DestModule)
 
 uninstall-local::
        $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule)
@@ -704,7 +711,7 @@ install-local:: $(DestBytecodeLib)
 
 $(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)
@@ -811,7 +818,7 @@ endif
 
 # 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
@@ -825,8 +832,8 @@ endif
 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
@@ -838,12 +845,12 @@ endif
 
 # 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
 
 #---------------------------------------------------------
@@ -898,7 +905,7 @@ install-local:: $(DestTool)
 
 $(DestTool): $(PROJ_bindir) $(ToolBuildPath)
        $(Echo) Installing $(BuildMode) $(DestTool)
-       $(Verb) $(INSTALL) $(ToolBuildPath) $(DestTool)
+       $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
 
 uninstall-local::
        $(Echo) Uninstalling $(BuildMode) $(DestTool)
@@ -1461,17 +1468,22 @@ ifeq ($(LEVEL),.)
 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 && \
          for  hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \
              -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \
-           $(INSTALL) $$hdr $(PROJ_includedir) ; \
+           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 [ -d "$(PROJ_OBJ_ROOT)/include" ] ; then \
+       $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
          cd $(PROJ_OBJ_ROOT)/include && \
          for hdr in `find . -type f -print` ; do \
-           $(INSTALL) $$hdr $(PROJ_includedir) ; \
+           $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
          done ; \
        fi
 
@@ -1504,6 +1516,7 @@ printvars::
        $(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)'
@@ -1515,7 +1528,7 @@ printvars::
        $(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)'