From 3f696d022cfd5fe2056f287f55025b024c4a9e7b Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 3 Apr 2021 20:59:44 -0600 Subject: only allow inferred prereq targets if they already existed --- src/makefile/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/makefile') diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index c81526b..ecadf72 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -141,6 +141,7 @@ impl<'a> Makefile<'a> { .map_or_else(String::new, |ext| format!(".{}", ext.to_string_lossy())); // is compared to the list of suffixes specified by the .SUFFIXES special // targets. If the .s1 suffix is found in .SUFFIXES... + // TODO figure out if .SUFFIXES is supposed to apply to gnuful patterns if self.special_target_has_prereq(".SUFFIXES", &suffix) || suffix.is_empty() { // the inference rules shall be searched in the order defined... // TODO implement GNUish shortest-stem-first matching @@ -157,7 +158,8 @@ impl<'a> Makefile<'a> { // we can't build this based on itself! fuck outta here return None; } - if self.get_target(&prereq_path_name).is_ok() { + // TODO allow chains but only reluctantly + if self.targets.borrow().contains_key(&prereq_path_name) { return Some(prereq_path_name); } let prereq_path = PathBuf::from(prereq_path_name); -- cgit v1.2.3