Skip to content

mk: Use rwildcard to calculate dependent files #13142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ include config.mk

# Just a few macros used everywhere
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
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
include $(CFG_SRC_DIR)mk/main.mk
# C and assembly components that are not LLVM
Expand Down
6 changes: 2 additions & 4 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ COMPILER_DOC_CRATES := rustc syntax
# $(1) is the crate to generate variables for
define RUST_CRATE
CRATEFILE_$(1) := $$(S)src/lib$(1)/lib.rs
RSINPUTS_$(1) := $$(wildcard $$(addprefix $(S)src/lib$(1), \
*.rs */*.rs */*/*.rs */*/*/*.rs))
RSINPUTS_$(1) := $$(call rwildcard,$(S)src/lib$(1)/,*.rs)
RUST_DEPS_$(1) := $$(filter-out native:%,$$(DEPS_$(1)))
NATIVE_DEPS_$(1) := $$(patsubst native:%,%,$$(filter native:%,$$(DEPS_$(1))))
endef
Expand All @@ -117,8 +116,7 @@ $(foreach crate,$(CRATES),$(eval $(call RUST_CRATE,$(crate))))
#
# $(1) is the crate to generate variables for
define RUST_TOOL
TOOL_INPUTS_$(1) := $$(wildcard $$(addprefix $$(dir $$(TOOL_SOURCE_$(1))), \
*.rs */*.rs */*/*.rs */*/*/*.rs))
TOOL_INPUTS_$(1) := $$(call rwildcard,$$(dir $$(TOOL_SOURCE_$(1))),*.rs)
endef

$(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))