2011-05-01 15:18:52 -05:00
|
|
|
######################################################################
|
|
|
|
# rustc LLVM-extensions (C++) library variables and rules
|
|
|
|
######################################################################
|
|
|
|
|
2011-11-01 19:28:41 -05:00
|
|
|
define DEF_RUSTLLVM_TARGETS
|
|
|
|
|
2011-11-27 00:38:36 -06: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)
|
|
|
|
ifdef CFG_WINDOWSY
|
|
|
|
LLVM_EXTRA_INCDIRS_$(1)= -iquote $(S)src/llvm/include \
|
|
|
|
-iquote llvm/$(1)/include
|
|
|
|
endif
|
|
|
|
|
2011-11-01 19:28:41 -05:00
|
|
|
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, RustGCMetadataPrinter.cpp \
|
2011-08-11 23:14:08 -05:00
|
|
|
RustGCStrategy.cpp RustWrapper.cpp)
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-10-31 15:31:04 -05:00
|
|
|
# Behind an ifdef for now since this requires a patched LLVM.
|
|
|
|
ifdef CFG_STACK_GROWTH
|
2011-11-01 19:28:41 -05:00
|
|
|
RUSTLLVM_OBJS_CS_$(1) += rustllvm/RustPrologHook.cpp
|
2011-10-31 15:31:04 -05:00
|
|
|
endif
|
|
|
|
|
2011-11-01 19:28:41 -05:00
|
|
|
RUSTLLVM_DEF_$(1) := rustllvm/rustllvm$$(CFG_DEF_SUFFIX)
|
|
|
|
|
2011-11-27 00:38:36 -06:00
|
|
|
RUSTLLVM_INCS_$(1) = $$(LLVM_EXTRA_INCDIRS_$(1)) \
|
|
|
|
-iquote $$(LLVM_INCDIR_$(1)) \
|
2011-11-02 18:21:17 -05:00
|
|
|
-iquote $$(S)src/rustllvm/include
|
2011-11-01 19:28:41 -05:00
|
|
|
RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=rustllvm/$(1)/%.o)
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-01 19:28:41 -05:00
|
|
|
rustllvm/$(1)/$(CFG_RUSTLLVM): $$(RUSTLLVM_OBJS_OBJS_$(1)) \
|
2011-11-23 17:20:28 -06:00
|
|
|
$$(MKFILE_DEPS) $$(RUSTLLVM_DEF_$(1))
|
2011-11-01 19:28:41 -05:00
|
|
|
@$$(call E, link: $$@)
|
|
|
|
$$(Q)$$(call CFG_LINK_C_$(1),$$@,$$(RUSTLLVM_OBJS_OBJS_$(1)) \
|
2011-11-02 18:21:17 -05:00
|
|
|
$$(CFG_GCCISH_PRE_LIB_FLAGS) $$(LLVM_LIBS_$(1)) \
|
2011-11-01 19:28:41 -05:00
|
|
|
$$(CFG_GCCISH_POST_LIB_FLAGS) \
|
2011-11-02 18:21:17 -05:00
|
|
|
$$(LLVM_LDFLAGS_$(1)),$$(RUSTLLVM_DEF_$(1)),$$(CFG_RUSTLLVM))
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
|
2011-11-01 19:28:41 -05:00
|
|
|
@$$(call E, compile: $$@)
|
2011-11-02 18:21:17 -05:00
|
|
|
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(LLVM_CXXFLAGS_$(1)) $$(RUSTLLVM_INCS_$(1))) $$<
|
2011-11-01 19:28:41 -05:00
|
|
|
endef
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-11-01 19:28:41 -05:00
|
|
|
# Instantiate template for all stages
|
|
|
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call DEF_RUSTLLVM_TARGETS,$(target))))
|