6.5. Explicit Dependencies: the Depends Function

Sometimes a file depends on another file that is not detected by an SCons scanner. For this situation, SCons allows you to specific explicitly that one file depends on another file, and must be rebuilt whenever that file changes. This is specified using the Depends method:


       hello = Program('hello.c')
       Depends(hello, 'other_file')
    

       % scons -Q hello
       cc -c hello.c -o hello.o
       cc -o hello hello.o
       % scons -Q hello
       scons: `hello' is up to date.
       % edit other_file
           [CHANGE THE CONTENTS OF other_file]
       % scons -Q hello
       cc -c hello.c -o hello.o
       cc -o hello hello.o