]> git.proxmox.com Git - rustc.git/blob - mk/llvm.mk
Imported Upstream version 0.6
[rustc.git] / mk / llvm.mk
1 # Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
4 #
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
10
11
12 ifdef CFG_ENABLE_FAST_MAKE
13 LLVM_DEPS := $(S)/.gitmodules
14 else
15
16 # This is just a rough approximation of LLVM deps
17 LLVM_DEPS=$(call rwildcard,$(CFG_LLVM_SRC_DIR),*cpp *hpp)
18 endif
19
20 define DEF_LLVM_RULES
21
22 # If CFG_LLVM_ROOT is defined then we don't build LLVM ourselves
23 ifeq ($(CFG_LLVM_ROOT),)
24
25 $$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
26 @$$(call E, make: llvm)
27 $$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
28 $$(Q)touch $$(LLVM_CONFIG_$(1))
29 endif
30
31 endef
32
33 $(foreach host,$(CFG_HOST_TRIPLES), \
34 $(eval $(call DEF_LLVM_RULES,$(host))))