aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/makefile/input.rs22
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(&macro_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(&macro_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);