If the repository tree contains the complete results of a build, and we try to build from the repository without any files in our local tree, something moderately surprising happens:
scons -Q -Y /usr/all/repository helloscons: `hello' is up-to-date.
Why does SCons say that the
is up-to-date when there is no
in the local build directory?
Because the repository (not the local directory)
contains the up-to-date
and SCons correctly determines that nothing
needs to be done to rebuild that
up-to-date copy of the file.
There are, however, many times when you want to ensure that a
local copy of a file always exists.
A packaging or testing script, for example,
may assume that certain generated files exist locally.
To tell SCons to make a copy of any up-to-date repository
file in the local build directory,
env = Environment() hello = env.Program('hello.c') Local(hello)
If we then run the same command, SCons will make a local copy of the program from the repository copy, and tell you that it is doing so:
scons -Y /usr/all/repository helloLocal copy of hello from /usr/all/repository/hello scons: `hello' is up-to-date.
(Notice that, because the act of making the local copy
is not considered a "build" of the
SCons still reports that it is up-to-date.)