Ardupilot2/README-WAF.md

72 lines
1.6 KiB
Markdown
Raw Normal View History

# WAF Build #
2015-10-09 11:03:59 -03:00
To keep access to waf convenient, use the following alias from the
2015-12-07 16:04:33 -04:00
root ardupilot directory:
2015-10-09 11:03:59 -03:00
```bash
2015-12-07 16:04:33 -04:00
alias waf="$PWD/modules/waf/waf-light"
```
2015-10-09 11:03:59 -03:00
2015-12-07 16:04:33 -04:00
Waf should always be called from the ardupilot's root.
2015-10-09 11:03:59 -03:00
Differently from the make-based build, with waf there's a configure step
to choose the board to be used
```bash
2015-10-09 11:03:59 -03:00
# Configure the Linux board.
waf configure --board=linux
```
2015-10-09 11:03:59 -03:00
by default the board used is `sitl`.
2015-10-09 11:03:59 -03:00
To build, use the 'waf build' command. This is the default command, so
calling just `waf` is enough
2015-10-09 11:03:59 -03:00
```bash
2015-10-09 11:03:59 -03:00
# From the root ardupilot directory, build everything.
waf
# Waf also accepts '-j' option to parallelize the build.
waf -j8
```
2015-10-09 11:03:59 -03:00
2015-12-07 16:04:33 -04:00
It's possible to build for just a vehicle or an example by specifying it as the
target:
2015-10-09 11:03:59 -03:00
```bash
# From the top directory
waf --targets bin/ArduCopter
2015-10-09 11:03:59 -03:00
# List all the targets available
waf list
```
2015-10-09 11:03:59 -03:00
There are also shortcuts for vehicle builds, for example:
```bash
# Shortcut for waf --targets bin/ArduCopter
waf copter
```
2015-10-09 11:03:59 -03:00
By default all the files produced by the build will be inside the build/
subdirectory. The binaries will also be there, with the name identifying
the target board.
To clean things up use
```bash
2015-10-09 11:03:59 -03:00
# Clean the build products, but keep configure information
waf clean
# Clean everything, will need to call configure again
waf distclean
```
2015-10-09 11:03:59 -03:00
using git to clean the files also work fine.
There's also a make wrapper called `Makefile.waf`. You can use
2015-12-07 16:04:33 -04:00
`make -f Makefile.waf help` for instructions on how to use it.
2015-10-09 11:03:59 -03:00
*TODO: Add explanation on how the build system is organized once we
settle down.*