From d8f60f325500a14e590ef2a73ddb69233f596b80 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sun, 4 Apr 2021 16:58:53 -0600 Subject: give .SUFFIXES to file readers for disambiguating --- src/makefile/input.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 } }); -- cgit v1.2.3