cc50eafc56338b6d97681152ff290c4a8564650c
[oota-llvm.git] / tools / llvmc / example / mcc16 / driver / Makefile
1 ##===- llvmc/example/mcc16/driver/Makefile -----------------*- Makefile -*-===##
2 #
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file is distributed under the University of Illinois Open
6 # Source License. See LICENSE.TXT for details.
7 #
8 ##===----------------------------------------------------------------------===##
9
10 LEVEL = $(LLVMC_BASE_LEVEL)/..
11 include $(LEVEL)/Makefile.config
12
13 TOOLNAME = $(LLVMC_BASED_DRIVER_NAME)
14 LLVMLIBS = CompilerDriver.a
15 LINK_COMPONENTS = support system
16 REQUIRES_EH := 1
17
18 # Preprocessor magic that generates references to static variables in built-in
19 # plugins.
20 # TODO: Move this to Makefile.rules? (also used by examples/{Skeleton, mcc16})
21 ifneq ($(LLVMC_BUILTIN_PLUGINS),)
22
23 USEDLIBS += $(patsubst %,plugin_llvmc_%.a,$(LLVMC_BUILTIN_PLUGINS))
24
25 LLVMC_BUILTIN_PLUGIN_1 = $(word 1, $(LLVMC_BUILTIN_PLUGINS))
26 LLVMC_BUILTIN_PLUGIN_2 = $(word 2, $(LLVMC_BUILTIN_PLUGINS))
27 LLVMC_BUILTIN_PLUGIN_3 = $(word 3, $(LLVMC_BUILTIN_PLUGINS))
28 LLVMC_BUILTIN_PLUGIN_4 = $(word 4, $(LLVMC_BUILTIN_PLUGINS))
29 LLVMC_BUILTIN_PLUGIN_5 = $(word 5, $(LLVMC_BUILTIN_PLUGINS))
30
31 ifneq ($(LLVMC_BUILTIN_PLUGIN_1),)
32 CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_1=$(LLVMC_BUILTIN_PLUGIN_1)
33 endif
34
35 ifneq ($(LLVMC_BUILTIN_PLUGIN_2),)
36 CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_2=$(LLVMC_BUILTIN_PLUGIN_2)
37 endif
38
39 ifneq ($(LLVMC_BUILTIN_PLUGIN_3),)
40 CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_3=$(LLVMC_BUILTIN_PLUGIN_3)
41 endif
42
43 ifneq ($(LLVMC_BUILTIN_PLUGIN_4),)
44 CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_4=$(LLVMC_BUILTIN_PLUGIN_4)
45 endif
46
47 ifneq ($(LLVMC_BUILTIN_PLUGIN_5),)
48 CPP.Flags += -DLLVMC_BUILTIN_PLUGIN_5=$(LLVMC_BUILTIN_PLUGIN_5)
49 endif
50
51 endif
52
53 include $(LEVEL)/Makefile.common