SCons User Guide 0.92 | ||
---|---|---|
<<< Previous | Installing Files in Other Directories | Next >>> |
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]) |
In this case, the InstallAs function loops through both lists simultaneously, and copies each source file into its corresponding target file name:
% scons install
cc -c goodbye.c -o goodbye.o
cc -o goodbye goodbye.o
cc -c hello.c -o hello.o
cc -o hello hello.o
Install file: "goodbye" as "/usr/bin/goodbye-new"
Install file: "hello" as "/usr/bin/hello-new"
<<< Previous | Home | Next >>> |
Installing a File Under a Different Name | Up | Preventing Removal of Targets |