diff options
author | Melody Horn <melody@boringcactus.com> | 2021-03-26 19:43:40 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-03-26 19:43:40 -0600 |
commit | 45fa49be5dc2630187e78c8adec498b751d9481e (patch) | |
tree | d6af3f08f4349caa867795ef52a4a356a1d8ce76 /src/main.rs | |
parent | abd55e36d781645566a7815c7712ded6b5cc1923 (diff) | |
download | makers-45fa49be5dc2630187e78c8adec498b751d9481e.tar.gz makers-45fa49be5dc2630187e78c8adec498b751d9481e.zip |
overhaul target handling
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 4048886..2764e97 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,10 +26,6 @@ fn main() { // TODO dump command-line macros into environment // TODO add SHELL macro let mut makefile = Makefile::new(args.clone()); - if !args.no_builtin_rules { - makefile.add_builtins(); - } - makefile.add_env(); for filename in &args.makefile { if filename == &PathBuf::from("-") { makefile.and_read(stdin().lock()); @@ -37,4 +33,18 @@ fn main() { makefile.and_read_file(filename); }; } + + if args.print_everything { + println!("{}", &makefile); + } + + let targets = if args.targets().count() == 0 { + vec![makefile.first_non_special_target.clone().expect("couldn't find a target!")] + } else { + args.targets().cloned().collect() + }; + + for target in targets { + makefile.update_target(&target); + } } |