2012-12-11 02:32:48 +01:00
|
|
|
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2012-02-10 21:07:01 +01:00
|
|
|
|
|
|
|
ifdef CFG_ENABLE_FAST_MAKE
|
|
|
|
LLVM_DEPS := $(S)/.gitmodules
|
|
|
|
else
|
2011-11-26 04:25:09 +01:00
|
|
|
|
2011-11-02 01:09:44 +01:00
|
|
|
# This is just a rough approximation of LLVM deps
|
2013-11-30 02:09:10 +01:00
|
|
|
LLVM_DEPS_SRC=$(call rwildcard,$(CFG_LLVM_SRC_DIR)lib,*cpp *hpp)
|
|
|
|
LLVM_DEPS_INC=$(call rwildcard,$(CFG_LLVM_SRC_DIR)include,*cpp *hpp)
|
2013-05-22 01:34:41 +02:00
|
|
|
LLVM_DEPS=$(LLVM_DEPS_SRC) $(LLVM_DEPS_INC)
|
2012-02-10 21:07:01 +01:00
|
|
|
endif
|
2011-11-01 23:48:30 +01:00
|
|
|
|
2011-11-03 00:21:17 +01:00
|
|
|
define DEF_LLVM_RULES
|
|
|
|
|
|
|
|
# If CFG_LLVM_ROOT is defined then we don't build LLVM ourselves
|
|
|
|
ifeq ($(CFG_LLVM_ROOT),)
|
|
|
|
|
2013-09-04 08:47:13 +02:00
|
|
|
LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
|
|
|
|
|
|
|
|
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
|
2011-11-03 00:21:17 +01:00
|
|
|
@$$(call E, make: llvm)
|
2013-09-17 10:06:01 +02:00
|
|
|
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1))
|
2011-12-13 02:06:43 +01:00
|
|
|
$$(Q)touch $$(LLVM_CONFIG_$(1))
|
2011-11-03 00:21:17 +01:00
|
|
|
endif
|
|
|
|
|
2013-09-04 08:47:13 +02:00
|
|
|
# This is used to independently force an LLVM clean rebuild
|
|
|
|
# when we changed something not otherwise captured by builtin
|
|
|
|
# dependencies. In these cases, commit a change that touches
|
|
|
|
# the stamp in the source dir.
|
|
|
|
$$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
|
2013-11-28 23:16:17 +01:00
|
|
|
@$$(call E, make: cleaning llvm)
|
2013-09-04 08:47:13 +02:00
|
|
|
$(Q)$(MAKE) clean-llvm
|
2013-11-28 23:16:17 +01:00
|
|
|
@$$(call E, make: done cleaning llvm)
|
2013-09-04 08:47:13 +02:00
|
|
|
touch $$@
|
|
|
|
|
2011-11-03 00:21:17 +01:00
|
|
|
endef
|
|
|
|
|
2013-12-01 05:52:21 +01:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
|
|
|
$(eval LLVM_CONFIGS := $(LLVM_CONFIGS) $(LLVM_CONFIG_$(host))))
|
|
|
|
|
|
|
|
$(S)src/librustc/lib/llvmdeps.rs: \
|
|
|
|
$(LLVM_CONFIGS) \
|
|
|
|
$(S)src/etc/mklldeps.py
|
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/mklldeps.py \
|
2013-12-17 06:35:22 +01:00
|
|
|
"$@" "$(LLVM_COMPONENTS)" $(LLVM_CONFIGS)
|
2013-12-01 05:52:21 +01:00
|
|
|
|
2013-10-21 11:18:21 +02:00
|
|
|
$(foreach host,$(CFG_HOST), \
|
2013-02-22 01:15:01 +01:00
|
|
|
$(eval $(call DEF_LLVM_RULES,$(host))))
|