From b4c1b2145d6a0b1ec4219847dc26877046f84e8b Mon Sep 17 00:00:00 2001 From: Tharre Date: Sun, 16 Nov 2014 17:30:35 +0100 Subject: Change the way redo updates targets. It's done a lot more efficiently now, as we are no longer checking if a target is out-of-date before we rebuild it, but instead rebuild subtargets directly when they are checked. We also now correctly depend on .do files. --- src/redo-ifchange.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/redo-ifchange.c') diff --git a/src/redo-ifchange.c b/src/redo-ifchange.c index cfc017b..d7b4af0 100644 --- a/src/redo-ifchange.c +++ b/src/redo-ifchange.c @@ -14,19 +14,13 @@ int main(int argc, char *argv[]) { if (!environment_sane()) { - fprintf(stderr, "redo: environment variables are missing, \ - please use %s only in do scripts.\n", argv[0]); + fprintf(stderr, "redo: environment variables are missing, " + "please use %s only in do scripts.\n", argv[0]); exit(1); } for (int i = 1; i < argc; ++i) { - /*debug("Testing if %s is up-to-date ...\n", argv[i]);*/ - if (has_changed(argv[i], 'c', false)) { - /*printf("=> no\n");*/ - build_target(argv[i]); - } else { - /*printf("=> yes\n");*/ - } + update_target(argv[i], 'c'); add_dep(argv[i], NULL, 'c'); } -- cgit v1.2.3-70-g09d2