aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs18
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);
+ }
}