From d09eb6c95b85fcb22d6b36353c82c3b4293e6fb7 Mon Sep 17 00:00:00 2001 From: Tharre Date: Wed, 13 Aug 2014 17:30:02 +0200 Subject: Implement (incomplete) dependency checking. Targets still do not depend on .do-files, and a lot of the edge cases are still not handled correctly. Furthermore some error-checking code is still missing, which could possibly crash the program (partially marked with comments), as well as some free() calls. An utitlity python script (print_dep.py) was also added to aid in debugging matters. --- src/redo-ifchange.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/redo-ifchange.c') diff --git a/src/redo-ifchange.c b/src/redo-ifchange.c index 219a0a1..1efe0a5 100644 --- a/src/redo-ifchange.c +++ b/src/redo-ifchange.c @@ -1,11 +1,19 @@ #include +#include #include "build.h" +#include "dbg.h" int main(int argc, char *argv[]) { int i; for (i = 1; i < argc; ++i) { - build_target(argv[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");*/ + } add_dep(argv[i], 'c'); } } -- cgit v1.2.3-70-g09d2