diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-06-25 01:07:00 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-06-25 01:07:00 +0000 |
commit | be76ef2188953186dfd921f05fe9c8d168ed144f (patch) | |
tree | 3a94cd55c5bc2398dcd8d2785ed77be9284bff91 /Makefile.rules | |
parent | ae2ed1ffa3ffb7f3dabaaedc2dd76e7da075c1d9 (diff) | |
download | external_llvm-be76ef2188953186dfd921f05fe9c8d168ed144f.zip external_llvm-be76ef2188953186dfd921f05fe9c8d168ed144f.tar.gz external_llvm-be76ef2188953186dfd921f05fe9c8d168ed144f.tar.bz2 |
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.rules | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules index c706bed..a1a1924 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 ############################################################################### |