Expose most of the rest of IRBuilder's functions to llvm-c.
[oota-llvm.git] / Makefile.rules
index a1a1924a9903eec991368f600689a28f367e5cb9..c29b5b26fd65d2a62bcd22c535e2cc3cbd346e09 100644 (file)
@@ -128,8 +128,11 @@ reconfigure:
          $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
          $(ConfigStatusScript)
 
+# FIXME: The {PIC16,MSP430}/AsmPrinter line here is a hack to force a reconfigure to pick
+# up AsmPrinter changes. Remove it after a reasonable delay from 2009-08-13.
+
 .PRECIOUS: $(ConfigStatusScript)
-$(ConfigStatusScript): $(ConfigureScript)
+$(ConfigStatusScript): $(ConfigureScript) $(LLVM_SRC_ROOT)/lib/Target/PIC16/AsmPrinter/Makefile $(LLVM_SRC_ROOT)/lib/Target/MSP430/AsmPrinter/Makefile
        $(Echo) Reconfiguring with $<
        $(Verb) cd $(PROJ_OBJ_ROOT) && \
          if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \
@@ -201,15 +204,19 @@ LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
 CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
 REQUIRES_EH := 1
 
+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
+  LOADABLE_MODULE = 1
 endif
 
 # TableGen stuff...
 ifneq ($(BUILT_SOURCES),)
-LLVMC_BUILD_AUTOGENERATED_INC=1
+  LLVMC_BUILD_AUTOGENERATED_INC=1
 endif
 
 endif # LLVMC_PLUGIN
@@ -217,10 +224,16 @@ endif # LLVMC_PLUGIN
 ifdef LLVMC_BASED_DRIVER
 
 TOOLNAME = $(LLVMC_BASED_DRIVER)
-LLVMLIBS = CompilerDriver.a
-LINK_COMPONENTS = support system
+
 REQUIRES_EH := 1
 
+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),)
@@ -502,8 +515,7 @@ ifeq ($(OS),Darwin)
 else
   ifeq ($(OS),Cygwin)
     SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
-                      -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
-                      -Wl,--enable-runtime-pseudo-relocs
+                      -Wl,--enable-auto-import -Wl,--enable-auto-image-base
   else
     SharedLinkOptions=-shared
   endif
@@ -1203,7 +1215,7 @@ install-local::
 uninstall-local::
        $(Echo) Uninstall circumvented with NO_INSTALL
 else
-DestTool = $(PROJ_bindir)/$(TOOLNAME)
+DestTool = $(PROJ_bindir)/$(TOOLNAME)$(EXEEXT)
 
 install-local:: $(DestTool)
 
@@ -1441,6 +1453,11 @@ $(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir
        $(Echo) "Building $(<F) assembly writer #1 with tblgen"
        $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
 
+$(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
+$(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir
+       $(Echo) "Building $(<F) assembly matcher with tblgen"
+       $(Verb) $(TableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
+
 $(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
 $(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir
        $(Echo) "Building $(<F) code emitter with tblgen"