2012-12-11 01:32:48 +00: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.
|
|
|
|
|
2011-05-01 20:18:52 +00:00
|
|
|
######################################################################
|
|
|
|
# rustc LLVM-extensions (C++) library variables and rules
|
|
|
|
######################################################################
|
|
|
|
|
2011-11-02 00:28:41 +00:00
|
|
|
define DEF_RUSTLLVM_TARGETS
|
|
|
|
|
2011-11-27 06:38:36 +00:00
|
|
|
# FIXME: Lately, on windows, llvm-config --includedir is not enough
|
|
|
|
# to find the llvm includes (probably because we're not actually installing
|
|
|
|
# llvm, but using it straight out of the build directory)
|
2013-03-02 12:25:12 +00:00
|
|
|
ifdef CFG_WINDOWSY_$(1)
|
2011-11-27 06:38:36 +00:00
|
|
|
LLVM_EXTRA_INCDIRS_$(1)= -iquote $(S)src/llvm/include \
|
|
|
|
-iquote llvm/$(1)/include
|
|
|
|
endif
|
|
|
|
|
2013-05-27 23:15:31 +00:00
|
|
|
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, RustWrapper.cpp PassWrapper.cpp)
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2013-02-27 05:53:35 +00:00
|
|
|
RUSTLLVM_DEF_$(1) := rustllvm/rustllvm$(CFG_DEF_SUFFIX_$(1))
|
2011-11-02 00:28:41 +00:00
|
|
|
|
2011-11-27 06:38:36 +00:00
|
|
|
RUSTLLVM_INCS_$(1) = $$(LLVM_EXTRA_INCDIRS_$(1)) \
|
|
|
|
-iquote $$(LLVM_INCDIR_$(1)) \
|
2011-11-02 23:21:17 +00:00
|
|
|
-iquote $$(S)src/rustllvm/include
|
2011-11-02 00:28:41 +00:00
|
|
|
RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=rustllvm/$(1)/%.o)
|
2012-06-14 18:07:19 +00:00
|
|
|
ALL_OBJ_FILES += $$(RUSTLLVM_OBJS_OBJS_$(1))
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2013-02-27 05:53:35 +00:00
|
|
|
rustllvm/$(1)/$(CFG_RUSTLLVM_$(1)): $$(RUSTLLVM_OBJS_OBJS_$(1)) \
|
2011-11-23 23:20:28 +00:00
|
|
|
$$(MKFILE_DEPS) $$(RUSTLLVM_DEF_$(1))
|
2011-11-02 00:28:41 +00:00
|
|
|
@$$(call E, link: $$@)
|
2012-10-03 01:15:02 +00:00
|
|
|
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@,$$(RUSTLLVM_OBJS_OBJS_$(1)) \
|
2013-02-27 05:53:35 +00:00
|
|
|
$$(CFG_GCCISH_PRE_LIB_FLAGS_$(1)) $$(LLVM_LIBS_$(1)) \
|
|
|
|
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) \
|
|
|
|
$$(LLVM_LDFLAGS_$(1)),$$(RUSTLLVM_DEF_$(1)),$$(CFG_RUSTLLVM_$(1)))
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2011-11-23 23:20:28 +00:00
|
|
|
rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
|
2011-11-02 00:28:41 +00:00
|
|
|
@$$(call E, compile: $$@)
|
2012-10-03 01:15:02 +00:00
|
|
|
$$(Q)$$(call CFG_COMPILE_CXX_$(1), $$@, $$(LLVM_CXXFLAGS_$(1)) $$(RUSTLLVM_INCS_$(1))) $$<
|
2011-11-02 00:28:41 +00:00
|
|
|
endef
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2011-11-02 00:28:41 +00:00
|
|
|
# Instantiate template for all stages
|
2013-02-22 00:15:01 +00:00
|
|
|
$(foreach host,$(CFG_HOST_TRIPLES), \
|
|
|
|
$(eval $(call DEF_RUSTLLVM_TARGETS,$(host))))
|