summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-06-25 01:07:00 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-06-25 01:07:00 +0000
commit0a1cb1ea862e03e5109319a247588c6e7b4d0e83 (patch)
tree3a94cd55c5bc2398dcd8d2785ed77be9284bff91 /Makefile.rules
parent7dcf4a826ccdf01749b31b55af15ec0ba3b4079a (diff)
downloadllvm-0a1cb1ea862e03e5109319a247588c6e7b4d0e83.tar.gz
llvm-0a1cb1ea862e03e5109319a247588c6e7b4d0e83.tar.bz2
llvm-0a1cb1ea862e03e5109319a247588c6e7b4d0e83.tar.xz
Remove duplication.
Factor out common preprocessor-related bits to Makefile.rules. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules
index c706bed68a..a1a1924a99 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -214,6 +214,49 @@ endif
endif # LLVMC_PLUGIN
+ifdef LLVMC_BASED_DRIVER
+
+TOOLNAME = $(LLVMC_BASED_DRIVER)
+LLVMLIBS = CompilerDriver.a
+LINK_COMPONENTS = support system
+REQUIRES_EH := 1
+
+# 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_PLUGIN_1 = $(word 1, $(LLVMC_BUILTIN_PLUGINS))
+LLVMC_BUILTIN_PLUGIN_2 = $(word 2, $(LLVMC_BUILTIN_PLUGINS))
+LLVMC_BUILTIN_PLUGIN_3 = $(word 3, $(LLVMC_BUILTIN_PLUGINS))
+LLVMC_BUILTIN_PLUGIN_4 = $(word 4, $(LLVMC_BUILTIN_PLUGINS))
+LLVMC_BUILTIN_PLUGIN_5 = $(word 5, $(LLVMC_BUILTIN_PLUGINS))
+
+ifneq ($(LLVMC_BUILTIN_PLUGIN_1),)
+CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_1=$(LLVMC_BUILTIN_PLUGIN_1)
+endif
+
+ifneq ($(LLVMC_BUILTIN_PLUGIN_2),)
+CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_2=$(LLVMC_BUILTIN_PLUGIN_2)
+endif
+
+ifneq ($(LLVMC_BUILTIN_PLUGIN_3),)
+CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_3=$(LLVMC_BUILTIN_PLUGIN_3)
+endif
+
+ifneq ($(LLVMC_BUILTIN_PLUGIN_4),)
+CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_4=$(LLVMC_BUILTIN_PLUGIN_4)
+endif
+
+ifneq ($(LLVMC_BUILTIN_PLUGIN_5),)
+CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_5)
+endif
+
+endif
+
+endif # LLVMC_BASED_DRIVER
+
###############################################################################
# VARIABLES: Set up various variables based on configuration data
###############################################################################