Installing Multiple Files Under Different Names

Lastly, if you have multiple files that all need to be installed with different file names, you can either call the InstallAs function multiple times, or as a shorthand, you can supply same-length lists for the both the target and source arguments:

       env = Environment()
       hello = env.Program('hello.c')
       goodbye = env.Program('goodbye.c')
       env.InstallAs(['/usr/bin/hello-new',
                      '/usr/bin/goodbye-new'],
                     [hello, goodbye])
       env.Alias('install', '/usr/bin')
    

In this case, the InstallAs function loops through both lists simultaneously, and copies each source file into its corresponding target file name:

       % scons -Q install
       cc -c -o goodbye.o goodbye.c
       cc -o goodbye goodbye.o
       Install file: "goodbye" as "/usr/bin/goodbye-new"
       cc -c -o hello.o hello.c
       cc -o hello hello.o
       Install file: "hello" as "/usr/bin/hello-new"