aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-03 11:29:04 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-03 11:29:04 -0600
commit31a35ac86e41a698a5eafcc0b4cbfa64e2066c39 (patch)
treefdbea361b69eba7683b09d32e0a31ec4e9b33110 /src/main.rs
parent2d87ed9a4dc8554bff082c97335b2a48659c7381 (diff)
downloadmakers-31a35ac86e41a698a5eafcc0b4cbfa64e2066c39.tar.gz
makers-31a35ac86e41a698a5eafcc0b4cbfa64e2066c39.zip
correctly handle conditional lines inside rule body
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 116b349..668d2e2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -58,17 +58,15 @@ fn main() -> Result<()> {
// TODO dump command-line args into MAKEFLAGS
// TODO dump command-line macros into environment
// TODO add SHELL macro
- let mut makefile_reader = MakefileReader::new(&args);
+ let mut makefile = Makefile::new(&args);
for filename in &args.makefile {
if filename == &PathBuf::from("-") {
- makefile_reader.and_read(stdin().lock())?;
+ makefile.extend(MakefileReader::read(&args, stdin().lock())?);
} else {
- makefile_reader.and_read_file(filename)?;
+ makefile.extend(MakefileReader::read_file(&args, filename)?);
};
}
- let makefile: Makefile = makefile_reader.into();
-
if args.print_everything {
println!("{}", &makefile);
}