aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-11 18:41:18 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-11 18:41:18 -0600
commitade0629bc862004bcc069345ec91aa0142c1f257 (patch)
tree973bac3c4d29f45a07a04beb88cfd3a6422dbf47 /src
parentab249a1f95e898b2d81e480b32a5b6ad9e4a7087 (diff)
downloadmakers-ade0629bc862004bcc069345ec91aa0142c1f257.tar.gz
makers-ade0629bc862004bcc069345ec91aa0142c1f257.zip
add $^ for all prerequisites
Diffstat (limited to 'src')
-rw-r--r--src/makefile/macro.rs2
-rw-r--r--src/makefile/mod.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/makefile/macro.rs b/src/makefile/macro.rs
index 3444e2c..fc3be51 100644
--- a/src/makefile/macro.rs
+++ b/src/makefile/macro.rs
@@ -221,7 +221,7 @@ impl<'parent, 'lookup> Set<'parent, 'lookup> {
let name = self
.expand(name)
.wrap_err_with(|| format!("while expanding \"{}\"", name))?;
- let internal_macro_names = &['@', '?', '<', '*'][..];
+ let internal_macro_names = &['@', '?', '<', '*', '^'][..];
let internal_macro_suffices = &['D', 'F'][..];
let just_internal = name.len() == 1 && name.starts_with(internal_macro_names);
let suffixed_internal = name.len() == 2
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index ac6090e..eb06939 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -348,6 +348,8 @@ impl<'a> Makefile<'a> {
// The $* macro shall evaluate to the current target name with
// its suffix deleted. (GNUism: the match stem)
vec![target.stem.as_ref().unwrap_or(&target.name).to_owned()]
+ } else if macro_name.starts_with('^') {
+ target.prerequisites.clone()
} else {
unreachable!()
};