diff options
-rw-r--r-- | redo.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/redo.c b/redo.c index 781c828..08dbbb4 100644 --- a/redo.c +++ b/redo.c @@ -468,12 +468,6 @@ run_script(char *target, int implicit) target = targetchdir(target); - dofile = find_dofile(target); - if (!dofile) { - fprintf(stderr, "no dofile for %s.\n", target); - exit(1); - } - dep_fd = mkstemp(temp_depfile); fd = mkstemp(temp_target); @@ -481,6 +475,12 @@ run_script(char *target, int implicit) // TODO locking to detect parallel jobs building same target? + dofile = find_dofile(target); + if (!dofile) { + fprintf(stderr, "no dofile for %s.\n", target); + exit(1); + } + fd = open(dofile, O_RDONLY); dprintf(dep_fd, "=%s %s\n", hashfile(fd), dofile); close(fd); |