llvmc: remove dynamic plugins.
[oota-llvm.git] / Makefile.rules
index 056a0ea3eff5ce47b38e293bb0b959b472540c2b..2e14094b3a1872fb02d76d2613cb5f9504a1cc0d 100644 (file)
@@ -196,57 +196,15 @@ install-local:: all-local
 install-bytecode:: install-bytecode-local
 
 ###############################################################################
-# LLVMC: Provide rules for compiling llvmc plugins
+# LLVMC: Provide rules for compiling llvmc-based driver
 ###############################################################################
 
-ifdef LLVMC_PLUGIN
-
-LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
-CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
-
-ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
-  LD.Flags += -lCompilerDriver
-endif
-
-# Build a dynamic library if the user runs `make` directly from the plugin
-# directory.
-ifndef LLVMC_BUILTIN_PLUGIN
-  LOADABLE_MODULE = 1
-endif
-
-# TableGen stuff...
-ifneq ($(BUILT_SOURCES),)
-  LLVMC_BUILD_AUTOGENERATED_INC=1
-endif
-
-endif # LLVMC_PLUGIN
-
 ifdef LLVMC_BASED_DRIVER
 
 TOOLNAME = $(LLVMC_BASED_DRIVER)
 
-ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
-  LD.Flags += -lCompilerDriver
-else
-  LLVMLIBS = CompilerDriver.a
-  LINK_COMPONENTS = support system
-endif
-
-# Preprocessor magic that generates references to static variables in built-in
-# plugins.
-ifneq ($(LLVMC_BUILTIN_PLUGINS),)
-
-USEDLIBS += $(patsubst %,plugin_llvmc_%.a,$(LLVMC_BUILTIN_PLUGINS))
-
-LLVMC_BUILTIN_PLUGINS.pre := \
-  $(patsubst %,-DLLVMC_BUILTIN_PLUGIN_%=, \
-    1 2 3 4 5 6 7 8 9 10)
-
-CPP.Flags += \
-  $(filter-out $(LLVMC_BUILTIN_PLUGINS.pre) $(LLVMC_BUILTIN_PLUGINS), \
-    $(join $(LLVMC_BUILTIN_PLUGINS.pre), $(LLVMC_BUILTIN_PLUGINS)))
-
-endif
+LLVMLIBS = CompilerDriver.a
+LINK_COMPONENTS = support system
 
 endif # LLVMC_BASED_DRIVER
 
@@ -1601,7 +1559,7 @@ ifdef TARGET
 TABLEGEN_INC_FILES_COMMON = 1
 endif
 
-ifdef LLVMC_BUILD_AUTOGENERATED_INC
+ifdef LLVMC_BASED_DRIVER
 TABLEGEN_INC_FILES_COMMON = 1
 endif
 
@@ -1725,20 +1683,26 @@ clean-local::
 
 endif # TARGET
 
-ifdef LLVMC_BUILD_AUTOGENERATED_INC
+ifdef LLVMC_BASED_DRIVER
+
+TDSrc := $(sort $(strip $(wildcard $(PROJ_SRC_DIR)/*.td)) \
+               $(strip $(wildcard $(PROJ_OBJ_DIR)/*.td)))
 
-LLVMCPluginSrc := $(sort $(strip $(wildcard $(PROJ_SRC_DIR)/*.td)) \
-       $(strip $(wildcard $(PROJ_OBJ_DIR)/*.td)))
+TDCommon := $(strip $(wildcard \
+               $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
 
-TDFiles := $(LLVMCPluginSrc) \
-       $(strip $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
+TDFiles := $(TDSrc) $(TDCommon)
 
-$(ObjDir)/AutoGenerated.inc.tmp: $(LLVMCPluginSrc) $(ObjDir)/.dir \
-                               $(TBLGEN) $(TD_COMMON)
-       $(Echo) "Building LLVMC configuration library with tblgen"
+$(INCTMPFiles) : $(TBLGEN) $(TDFiles)
+
+$(ObjDir)/%.inc.tmp: %.td $(ObjDir)/.dir
+       $(Echo) "Building LLVMC compilation graph description with tblgen"
        $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
 
-endif # LLVMC_BUILD_AUTOGENERATED_INC
+clean-local::
+       -$(Verb) $(RM) -f $(INCFiles)
+
+endif # LLVMC_BASED_DRIVER
 
 ###############################################################################
 # OTHER RULES: Other rules needed