add a new value for the command line optn
[oota-llvm.git] / Makefile.rules
index b48b906cb779f0bc8f069e8556ed3f9bb6ddb947..b6ad1b56ad4aa14b7cff5be6010c340dfcb1eab8 100644 (file)
@@ -73,6 +73,7 @@ PreConditions      := $(ConfigStatusScript) $(ObjMakefiles)
 ifneq ($(MakefileCommonIn),)
 PreConditions      += $(MakefileCommon)
 endif
+
 ifneq ($(MakefileConfigIn),)
 PreConditions      += $(MakefileConfig)
 endif
@@ -304,7 +305,7 @@ endif
 ifndef GCCLD
 GCCLD    := $(LLVMToolDir)/gccld$(EXEEXT)
 endif
-ifndef LDIS
+ifndef LLVMDIS
 LLVMDIS  := $(LLVMToolDir)/llvm-dis$(EXEEXT)
 endif
 ifndef LLI
@@ -624,68 +625,6 @@ endif
 # Set up variables for building libararies
 ###############################################################################
 
-#---------------------------------------------------------
-# Handle the special "JIT" value for LLVM_LIBS which is a
-# shorthand for a bunch of libraries that get the correct
-# JIT support for a library or a tool that runs JIT.
-#---------------------------------------------------------
-ifeq ($(firstword $(LLVMLIBS)),config)
-LLVMLIBS := $(shell $(LLVM_CONFIG) --libnames $(wordlist 2,9999,$(LLVMLIBS)))
-LLVMLIBS := $(patsubst lib%.a,%.a,$(LLVMLIBS))
-LLVMLIBS := $(patsubst %.o,%,$(LLVMLIBS))
-endif
-
-ifeq ($(LLVMLIBS),JIT)
-
-# Make sure we can get our own symbols in the tool
-Link += -dlopen self
-
-# Generic JIT libraries
-JIT_LIBS := LLVMInterpreter LLVMJIT
-
-# You can enable the X86 JIT on a non-X86 host by setting the flag
-# ENABLE_X86_JIT on the make command line. If not, it will still be
-# enabled automagically on an X86 host.
-ifeq ($(ARCH), x86)
-  ENABLE_X86_JIT = 1
-endif
-
-# What the X86 JIT requires
-ifdef ENABLE_X86_JIT
-  JIT_LIBS += LLVMX86 
-endif
-
-# You can enable the PowerPC JIT on a non-PowerPC host by setting the flag
-# ENABLE_PPC_JIT on the make command line. If not, it will still be
-# enabled automagically on an PowerPC host.
-ifeq ($(ARCH), PowerPC)
-  ENABLE_PPC_JIT = 1
-endif
-
-# What the PowerPC JIT requires
-ifdef ENABLE_PPC_JIT
-  JIT_LIBS += LLVMPowerPC 
-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 
-endif
-
-JIT_LIBS +=  LLVMTarget.a LLVMSelectionDAG.a LLVMCodeGen.a LLVMExecutionEngine
-
-LLVMLIBS := $(JIT_LIBS) LLVMScalarOpts.a LLVMTransformUtils.a LLVMAnalysis.a \
-            LLVMBCReader.a LLVMCore.a LLVMSupport.a LLVMbzip2.a \
-            LLVMSystem.a $(PLATFORMLIBDL)
-endif
-
 #---------------------------------------------------------
 # Define various command line options pertaining to the
 # libraries needed when linking. There are "Proj" libs 
@@ -707,10 +646,20 @@ LLVMUsedLibs    := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
 LLVMLibsPaths   := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
 endif
 
-ifneq ($(strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
+ifeq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
 ifdef LINK_COMPONENTS
-ProjLibsOptions := $(shell $(LLVM_CONFIG) --libs     $(LINK_COMPONENTS))
-ProjLibsPaths   := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
+
+# If LLVM_CONFIG doesn't exist, build it.  This can happen if you do a make
+# clean in tools, then do a make in tools (instead of at the top level).
+$(LLVM_CONFIG):
+       @echo "*** llvm-config doesn't exist - rebuilding it."
+       @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config
+        
+$(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG)
+
+ProjLibsOptions = $(shell $(LLVM_CONFIG) --libs     $(LINK_COMPONENTS))
+ProjLibsPaths   = $(LLVM_CONFIG) \
+                  $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
 endif
 endif
 
@@ -989,13 +938,6 @@ else
 ToolBuildPath   := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
 endif
 
-#---------------------------------------------------------
-# Tell make that we need to rebuild subdirectories before 
-# we can link the tool. This affects things like LLI which 
-# has library subdirectories.
-#---------------------------------------------------------
-$(ToolBuildPath): $(addsuffix /.makeall, $(PARALLEL_DIRS))
-
 #---------------------------------------------------------
 # Provide targets for building the tools
 #---------------------------------------------------------
@@ -1417,7 +1359,7 @@ CTAGS:
 ifndef DISABLE_AUTO_DEPENDENCIES
 
 # If its not one of the cleaning targets
-ifneq ($(strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
+ifneq ($(strip $(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
 
 # Get the list of dependency files
 DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))