Back end (part 3) The C program will do "the work" of a Makefile. The recursive algorithm (vaguely) is: int check_node_foo_c (time_t parent) { time_t mtime = 0; int rebuild = 0; struct stat target; if (stat ("foo.c", &target) == -1) rebuild = 1; else mtime = statr.st_mtime; rebuild = check_first_dep (mtime) || rebuild; // ... if (rebuild) { write (1, "gcc -c foo.c\n", 13); system ("gcc -c foo.c"); return 1 } else return mtime > parent; } With some extra error handling thrown in.