diff options
author | Melody Horn <melody@boringcactus.com> | 2024-11-11 17:20:54 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2024-11-11 17:20:54 -0700 |
commit | dfb51bfebd0d5c22e82d2a73412a19c3e0599524 (patch) | |
tree | 285b73276cbe6f6ba1808b3db4482c6c7b01649a /src/makefile/input.rs | |
parent | 4f9299b4639802e05e1cb27d8eb40305ff8e110e (diff) | |
download | makers-dfb51bfebd0d5c22e82d2a73412a19c3e0599524.tar.gz makers-dfb51bfebd0d5c22e82d2a73412a19c3e0599524.zip |
remember the posix mode
i should either delete or overhaul that at some point
Diffstat (limited to 'src/makefile/input.rs')
-rw-r--r-- | src/makefile/input.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs index 9fdcf6a..2c4a6bb 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -981,6 +981,7 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { let name = name.trim(); value.trim_start(); + #[cfg(feature = "full")] let value = if expand_value { TokenString::text( self.expand_macros(&value) @@ -1016,13 +1017,17 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { Some(ItemSource::CommandLineOrMakeflags) => true, // We let environment variables override macros from the file only if the command-line argument to do that was given Some(ItemSource::Environment) => self.args.environment_overrides, + #[cfg(feature = "full")] Some(_) => macro_assignment.skip_if_defined, + #[cfg(not(feature = "full"))] + Some(_) => false, None => false, }; if skipped { None } else { Some(match stack.get(¯o_assignment.name) { + #[cfg(feature = "full")] Some(old_value) if macro_assignment.append => { MacroAssignmentOutcome::AppendedTo(old_value.into_owned()) } @@ -1039,18 +1044,17 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { ) -> Result<(String, Macro)> { match outcome { MacroAssignmentOutcome::AppendedTo(mut old_value) => { + let value = macro_assignment.value; #[cfg(feature = "full")] let value = if old_value.eagerly_expanded { - TokenString::text(self.expand_macros(¯o_assignment.value).wrap_err_with( - || { - format!( - "while defining {} on line {}", - macro_assignment.name, line_number - ) - }, - )?) + TokenString::text(self.expand_macros(&value).wrap_err_with(|| { + format!( + "while defining {} on line {}", + macro_assignment.name, line_number + ) + })?) } else { - macro_assignment.value + value }; old_value.text.extend(TokenString::text(" ")); old_value.text.extend(value); |