aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/makefile/input.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs
index ecf195a..283842f 100644
--- a/src/makefile/input.rs
+++ b/src/makefile/input.rs
@@ -229,7 +229,11 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> {
let line = line?;
// handle include lines
- if let Some(line) = line.strip_prefix("include ") {
+ let original_line = &line;
+ if let Some(line) = line
+ .strip_prefix("include ")
+ .or(line.strip_prefix("-include "))
+ {
// remove extra leading space
let line = line.trim_start();
let line = self.expand_macros(&tokenize(line)?)?;
@@ -244,9 +248,11 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> {
let child = child.finish();
self.extend(child);
} else {
- // TODO handle non-file-not-found errors
- log::error!("included makefile {} not found", field);
- self.failed_includes.push(field.to_owned());
+ if !original_line.starts_with('-') {
+ // TODO handle non-file-not-found errors
+ log::error!("included makefile {} not found", field);
+ self.failed_includes.push(field.to_owned());
+ }
}
}
continue;