How SCons handles dependencies can also be affected
When a file is passed to the
hello = Program('hello.c') AlwaysBuild(hello)
Then the specified target file (hello in our example) will always be considered out-of-date and rebuilt whenever that target file is evaluated while walking the dependency graph:
% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q cc -o hello hello.o
AlwaysBuild function has a somewhat misleading name,
because it does not actually mean the target file will
be rebuilt every single time SCons is invoked.
Instead, it means that the target will, in fact,
be rebuilt whenever the target file is encountered
while evaluating the targets specified on
the command line (and their dependencies).
So specifying some other target on the command line,
a target that does not
itself depend on the
will still be rebuilt only if it's out-of-date
with respect to its dependencies:
% scons -Q cc -o hello.o -c hello.c cc -o hello hello.o % scons -Q hello.o scons: `hello.o' is up to date.