aboutsummaryrefslogtreecommitdiff
path: root/src/makefile
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-04 16:58:53 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-04 16:58:53 -0600
commitd8f60f325500a14e590ef2a73ddb69233f596b80 (patch)
tree5cd82730f48b96042743023268e59541039dcdf9 /src/makefile
parenta52f538bddab95ab7826167bd3a0cbd0f5f12d83 (diff)
downloadmakers-d8f60f325500a14e590ef2a73ddb69233f596b80.tar.gz
makers-d8f60f325500a14e590ef2a73ddb69233f596b80.zip
give .SUFFIXES to file readers for disambiguating
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile/input.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs
index 5afecc6..b828829 100644
--- a/src/makefile/input.rs
+++ b/src/makefile/input.rs
@@ -182,6 +182,22 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> {
#[cfg(feature = "full")]
conditional_stack: Vec::new(),
};
+ // TODO be smart about this instead
+ if !args.no_builtin_rules {
+ reader.targets.insert(
+ ".SUFFIXES".to_owned(),
+ Target {
+ name: ".SUFFIXES".into(),
+ prerequisites: vec![".o", ".c", ".y", ".l", ".a", ".sh", ".f"]
+ .into_iter()
+ .map(String::from)
+ .collect(),
+ commands: vec![],
+ stem: None,
+ already_updated: Cell::new(false),
+ },
+ );
+ }
reader.read_all()?;
Ok(reader)
}
@@ -434,6 +450,11 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> {
{
Some(inference)
} else {
+ log::info!(
+ "looks like {:?} is not a suffix rule because .SUFFIXES is {:?}",
+ inference,
+ self.targets.get(".SUFFIXES")
+ );
None
}
});