aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-03 21:55:02 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-03 21:55:02 -0600
commiteec876fe50ff9b6333109fe717cd50ba2d4781c7 (patch)
treede5f02ca536e92ac6a8e661d66122ae17d750ca3
parentbbc87313478a1b87c23f3124bc2049f037651d02 (diff)
downloadmakers-eec876fe50ff9b6333109fe717cd50ba2d4781c7.tar.gz
makers-eec876fe50ff9b6333109fe717cd50ba2d4781c7.zip
deprioritize builtin inference rules
-rw-r--r--src/makefile/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index ecadf72..f62249b 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -31,6 +31,7 @@ use token::TokenString;
pub struct Makefile<'a> {
inference_rules: Vec<InferenceRule>,
+ builtin_inference_rules: Vec<InferenceRule>,
pub macros: MacroSet<'static, 'static>,
targets: RefCell<HashMap<String, Rc<RefCell<Target>>>>,
pub first_non_special_target: Option<String>,
@@ -69,7 +70,8 @@ impl<'a> Makefile<'a> {
}
Makefile {
- inference_rules,
+ inference_rules: vec![],
+ builtin_inference_rules: inference_rules,
macros,
targets: RefCell::new(targets),
first_non_special_target,
@@ -148,6 +150,7 @@ impl<'a> Makefile<'a> {
let inference_rule_candidates = self
.inference_rules
.iter()
+ .chain(self.builtin_inference_rules.iter())
.filter(|rule| rule.matches(name).unwrap_or(false));
for rule in inference_rule_candidates {
// whose prerequisite file ($*.s2) exists.