« Prev 4.5.3 PATH Management | Table of Contents | Next » 4.5.5 Executing Commands: The sh Method |
The
rscons
build script method can be used to invoke an rscons subprocess using a
subsidiary rscons build script.
This can be used, for example, when a subproject is imported and a top-level
configure
or build
task should also perform the same task in the
subproject directory.
The first argument to the rscons
method specifies either a directory name, or
the path to the subsidiary Rsconscript file to execute.
Any additional arguments are passed to rscons
when it executes the subsidiary
script.
rscons
will change working directories to the directory containing the
subsidiary script when executing it.
For example:
configure do rscons "subproject", "configure" end task "build" do rscons "subproject/Rsconscript", "build" end
It is also perfectly valid to perform different task(s) in the subsidiary
script from the one being performed in the top-level script.
For example, in a project that requires a particular cross compiler, the
top-level configure
script could build the necessary cross compiler using a
subsidiary build script.
This could look something like:
configure do rscons "cross/Rsconscript" check_c_compiler "i686-elf-gcc" end
This would build, and if necessary first configure, using the cross/Rsconscript subsidiary build script. Subsidiary build scripts are executed from within the directory containing the build script.
« Prev 4.5.3 PATH Management | Table of Contents | Next » 4.5.5 Executing Commands: The sh Method |