Mikhail Glushenkov | 15456a1 | 2008-05-06 18:08:12 +0000 | [diff] [blame] | 1 | ##===- tools/llvmc2/Makefile -------------------------------*- Makefile -*-===## |
Anton Korobeynikov | e9ffb5b | 2008-03-23 08:57:20 +0000 | [diff] [blame] | 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 | ##===----------------------------------------------------------------------===## |
Mikhail Glushenkov | adcf753 | 2008-10-02 21:15:05 +0000 | [diff] [blame^] | 9 | |
| 10 | # Compiled-in plugins |
| 11 | BUILTIN_PLUGINS = Base |
| 12 | |
Anton Korobeynikov | e9ffb5b | 2008-03-23 08:57:20 +0000 | [diff] [blame] | 13 | LEVEL = ../.. |
| 14 | TOOLNAME = llvmc2 |
Anton Korobeynikov | e9ffb5b | 2008-03-23 08:57:20 +0000 | [diff] [blame] | 15 | LINK_COMPONENTS = support system |
| 16 | REQUIRES_EH := 1 |
| 17 | |
Mikhail Glushenkov | adcf753 | 2008-10-02 21:15:05 +0000 | [diff] [blame^] | 18 | ifneq ($(BUILTIN_PLUGINS),) |
| 19 | |
| 20 | export BUILTIN_LLVMC_PLUGIN=1 |
| 21 | USEDLIBS = $(patsubst %,LLVMC%,$(BUILTIN_PLUGINS)) |
| 22 | |
| 23 | endif |
| 24 | |
Anton Korobeynikov | e9ffb5b | 2008-03-23 08:57:20 +0000 | [diff] [blame] | 25 | include $(LEVEL)/Makefile.common |
| 26 | |
Mikhail Glushenkov | adcf753 | 2008-10-02 21:15:05 +0000 | [diff] [blame^] | 27 | TD_COMMON = $(wildcard $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td) |
Anton Korobeynikov | e9ffb5b | 2008-03-23 08:57:20 +0000 | [diff] [blame] | 28 | |
Mikhail Glushenkov | adcf753 | 2008-10-02 21:15:05 +0000 | [diff] [blame^] | 29 | # 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. |
| 32 | define PLUGIN_template |
| 33 | PLUGIN_$(1)_SOURCES=$$(wildcard plugins/$(1)/*.cpp) |
| 34 | PLUGIN_$(1)_TD_SOURCES=$$(wildcard plugins/$(1)/*.cpp) |
Anton Korobeynikov | e9ffb5b | 2008-03-23 08:57:20 +0000 | [diff] [blame] | 35 | |
Mikhail Glushenkov | adcf753 | 2008-10-02 21:15:05 +0000 | [diff] [blame^] | 36 | $$(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) $$@ |
| 42 | endef |
| 43 | |
| 44 | $(foreach plugin,$(BUILTIN_PLUGINS),$(eval $(call PLUGIN_template,$(plugin)))) |