blob: 93501657fb63a915042db21dacc7b6ebceb26235 [file] [log] [blame]
Mikhail Glushenkov15456a12008-05-06 18:08:12 +00001##===- tools/llvmc2/Makefile -------------------------------*- Makefile -*-===##
Anton Korobeynikove9ffb5b2008-03-23 08:57:20 +00002#
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##===----------------------------------------------------------------------===##
Mikhail Glushenkovadcf7532008-10-02 21:15:05 +00009
10# Compiled-in plugins
11BUILTIN_PLUGINS = Base
12
Anton Korobeynikove9ffb5b2008-03-23 08:57:20 +000013LEVEL = ../..
14TOOLNAME = llvmc2
Anton Korobeynikove9ffb5b2008-03-23 08:57:20 +000015LINK_COMPONENTS = support system
16REQUIRES_EH := 1
17
Mikhail Glushenkovadcf7532008-10-02 21:15:05 +000018ifneq ($(BUILTIN_PLUGINS),)
19
20export BUILTIN_LLVMC_PLUGIN=1
21USEDLIBS = $(patsubst %,LLVMC%,$(BUILTIN_PLUGINS))
22
23endif
24
Anton Korobeynikove9ffb5b2008-03-23 08:57:20 +000025include $(LEVEL)/Makefile.common
26
Mikhail Glushenkovadcf7532008-10-02 21:15:05 +000027TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td)
Anton Korobeynikove9ffb5b2008-03-23 08:57:20 +000028
Mikhail Glushenkovadcf7532008-10-02 21:15:05 +000029# There is probably a better way to do this: currently we enter the
30# subdirectory 2 times - the second time is not needed.
31# This probably also needs to be integrated into Makefile.rules.
32define PLUGIN_template
33PLUGIN_$(1)_SOURCES=$$(wildcard plugins/$(1)/*.cpp)
34PLUGIN_$(1)_TD_SOURCES=$$(wildcard plugins/$(1)/*.cpp)
Anton Korobeynikove9ffb5b2008-03-23 08:57:20 +000035
Mikhail Glushenkovadcf7532008-10-02 21:15:05 +000036$$(LibDir)/LLVMC$(1).o: $$(PLUGIN_$(1)_SOURCES) $$(PLUGIN_$(1)_TD_SOURCES) \
37 $$(TD_COMMON)
38 @$$(MAKE) -C plugins/$(1)
39
40$$(RecursiveTargets) ::
41 @$$(MAKE) -C plugins/$(1) $$@
42endef
43
44$(foreach plugin,$(BUILTIN_PLUGINS),$(eval $(call PLUGIN_template,$(plugin))))