0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-30 02:16:45 +01:00
rust/mk/llvm.mk
Brian Anderson 21cf9c8698 build: Touch llvm-config after building
llvm-config is the file we base our LLVM build rule on, but rebuilding LLVM
doesn't always rebuild it, so touch.
2011-12-13 14:32:32 -08:00

23 lines
684 B
Makefile

# Recursive wildcard function
# http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
$(filter $(subst *,%,$2),$d))
# This is just a rough approximation of LLVM deps
LLVM_DEPS=$(call rwildcard,$(CFG_LLVM_SRC_DIR),*cpp *hpp)
define DEF_LLVM_RULES
# If CFG_LLVM_ROOT is defined then we don't build LLVM ourselves
ifeq ($(CFG_LLVM_ROOT),)
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
@$$(call E, make: llvm)
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
$$(Q)touch $$(LLVM_CONFIG_$(1))
endif
endef
$(foreach target,$(CFG_TARGET_TRIPLES), \
$(eval $(call DEF_LLVM_RULES,$(target))))