lrs_build is the special-purpose build system of lrs.
Usage: lrs_build [options]* Options: -r --rebuild Rebuild everything -t --target <TARGET> Build for <TARGET> instead of the default target --times Print compile times after a successful exit -f --finish Print when a compile step finishes -g --graph Print the dependency graph and exit -h --help Print this help and exit
lrs_build allows us to do the following things efficiently:
-
Build only those crates that have been modified or whose dependencies have been modified.
-
Build only the crate we’re currently working on and possibly its modified dependencies.
-
Forward arbitrary arguments to lrsc.
When lrs_build is invoked, it searches the directory tree upwards for a
directory that contains a file called LRSBuild. Then it checks from which
directory it was invoked: If it was invoked from ./src/io
or any of its
subdirectories, lrs_build will only build the io
crate and possibly its
dependencies. But if lrs was invoked from ./src
or .
, it will build all of
lrs.
Unless the -r
argument was used, lrs_build will only rebuild those crates
whose dependencies—source code or other crates—have changed. The -r
argument
is sometimes necessary hen you want to change the arguments lrsc uses when
compiling a crate, for example, configuration flags.
lrs_build will, by default, build for your native target. This can be
overwritten by using the -t
flag. Possible arguments are
-
x86_64,
-
i686,
-
arm, and
-
aarch64.
In order to pass arbitrary arguments to lrsc, terminate the lrs_build argument
list with --
and append the lrsc arguments. For example:
lrs_build -r -- -O
rebuilds all of lrs with optimization enabled.
The LRSBuild
file has the following syntax:
obj <obj_name> [dependency_name]*
For example,
obj core obj clock core
means that core
has no dependencies and clock
has only the core
dependency. The dependencies should be exactly the dependencies that are
declared via extern crate
in the lib.rs
file.
lrs_build will build crates in parallel if possible.
lrs_build can print a dependency graph with the -g
argument. For example,
lrs_build -g | dot -T svg -o graph.svg
will print the graph to the graph.svg
file.
Assuming that you’ve already followed the Building and Using guide to this point, you can build lrs_build with the provided makefile.