mk: Use rwildcard to calculate dependent files

The previous dependency calculation was based on an arbitrary set of asterisks
at an arbitrary depth, but using the recursive version should be much more
robust in figuring out what's dependent.

Closes #13118
This commit is contained in:
Alex Crichton 2014-03-25 15:40:52 -07:00
parent de4473201a
commit 47093648a7
2 changed files with 4 additions and 6 deletions

View File

@ -177,10 +177,10 @@ include config.mk
# Just a few macros used everywhere # Just a few macros used everywhere
include $(CFG_SRC_DIR)mk/util.mk include $(CFG_SRC_DIR)mk/util.mk
# All crates and their dependencies
include $(CFG_SRC_DIR)mk/crates.mk
# Reconfiguring when the makefiles or submodules change # Reconfiguring when the makefiles or submodules change
include $(CFG_SRC_DIR)mk/reconfig.mk include $(CFG_SRC_DIR)mk/reconfig.mk
# All crates and their dependencies
include $(CFG_SRC_DIR)mk/crates.mk
# Various bits of setup, common macros, and top-level rules # Various bits of setup, common macros, and top-level rules
include $(CFG_SRC_DIR)mk/main.mk include $(CFG_SRC_DIR)mk/main.mk
# C and assembly components that are not LLVM # C and assembly components that are not LLVM

View File

@ -105,8 +105,7 @@ COMPILER_DOC_CRATES := rustc syntax
# $(1) is the crate to generate variables for # $(1) is the crate to generate variables for
define RUST_CRATE define RUST_CRATE
CRATEFILE_$(1) := $$(S)src/lib$(1)/lib.rs CRATEFILE_$(1) := $$(S)src/lib$(1)/lib.rs
RSINPUTS_$(1) := $$(wildcard $$(addprefix $(S)src/lib$(1), \ RSINPUTS_$(1) := $$(call rwildcard,$(S)src/lib$(1)/,*.rs)
*.rs */*.rs */*/*.rs */*/*/*.rs))
RUST_DEPS_$(1) := $$(filter-out native:%,$$(DEPS_$(1))) RUST_DEPS_$(1) := $$(filter-out native:%,$$(DEPS_$(1)))
NATIVE_DEPS_$(1) := $$(patsubst native:%,%,$$(filter native:%,$$(DEPS_$(1)))) NATIVE_DEPS_$(1) := $$(patsubst native:%,%,$$(filter native:%,$$(DEPS_$(1))))
endef endef
@ -117,8 +116,7 @@ $(foreach crate,$(CRATES),$(eval $(call RUST_CRATE,$(crate))))
# #
# $(1) is the crate to generate variables for # $(1) is the crate to generate variables for
define RUST_TOOL define RUST_TOOL
TOOL_INPUTS_$(1) := $$(wildcard $$(addprefix $$(dir $$(TOOL_SOURCE_$(1))), \ TOOL_INPUTS_$(1) := $$(call rwildcard,$$(dir $$(TOOL_SOURCE_$(1))),*.rs)
*.rs */*.rs */*/*.rs */*/*/*.rs))
endef endef
$(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate)))) $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))