1 ROOT
= $(dir $(lastword
$(MAKEFILE_LIST
)))
3 WAF_BINARY
= $(realpath
$(ROOT
)/modules
/waf
/waf-light
)
4 WAF
= python
$(WAF_BINARY
) $(WAF_FLAGS
)
6 EXPLICIT_COMMANDS
= check check-all
clean list_boards
8 VEHICLES
= copter plane rover sub heli
10 BOARD_LIST
:= $(shell $(WAF
) list_boards | head
-1)
15 @git submodule init
&& git submodule update
20 %-configure
: $(WAF_BINARY
)
21 @
$(WAF
) configure
--board
$*
23 $(EXPLICIT_COMMANDS
): $(WAF_BINARY
)
26 $(VEHICLES
): $(WAF_BINARY
)
27 @echo Build for vehicle
$@
31 @
$(WAF
) configure
--board
$@ build
33 define target_template
34 $(1)-$(2) : $(1)-configure
$(2)
37 $(foreach board
,$(BOARD_LIST
),$(foreach vehicle
,$(VEHICLES
),$(eval
$(call target_template
,$(board
),$(vehicle
)))))
40 @echo
"Ardupilot Building"
41 @echo
"=================="
42 @echo
"This is a make wrapper for Ardupilot's Waf build system. This wrapper is"
43 @echo
"intended to provide convenience for basic and common build tasks. If you need"
44 @echo
"more than what this wrapper provides, it's a good idea to use waf directly."
45 @echo
"The waf executable is at '$(WAF_BINARY)'."
47 @echo
"For more detailed instructions see https://ardupilot.org/dev/docs/building-the-code.html"
52 @echo
"In order to trigger the build for a board/platform, the name of the board is"
53 @echo
"used as the target. Example: make linux"
54 @echo
"If no target is passed, then the build will be triggered for the last board"
55 @echo
"used. You can suffix the board/platform with '-configure' in order to just "
56 @echo
"configure without triggering a build command."
58 @echo
"You can get a list of available boards using the command:"
59 @echo
" make list_boards"
64 @echo
"It's possible to build for a specific vehicle by defining the target as one of:"
67 @echo
"Not that if it's your first time building or you want to change the target "
68 @echo
"board/platform, you'll need to configure the build before (e.g"
69 @echo
"make linux-configure)"
74 @echo
"It's possible to build for a specific vehicle type and board using"
75 @echo
" make BOARD-VEHICLE"
77 @echo
"For example, to build copter for the Pixracer, use this:"
78 @echo
" make Pixracer-copter"
83 @echo
"Check targets are used for running tests. There are two targets available:"
84 @echo
" check: for running tests that are still failing or that are new or"
85 @echo
" have been modified"
86 @echo
" check-all: to run all tests"
91 @echo
"Waf commands can be explicitly called with targets prefixed by 'waf-'. Example:"
92 @echo
" make waf-clean"
93 @echo
" make waf-build"
95 @echo
"Common commands"
96 @echo
"---------------"
98 @echo
"Some Waf commands can be executed without the need of prefixing the target name"
99 @echo
"with 'waf-'. They are: $(EXPLICIT_COMMANDS)"
104 @echo
"The variable WAF_FLAGS can be used to set any waf command line options that"
105 @echo
"come to be necessary. Ex: make linux WAF_FLAGS='-c no'"
108 # Don't run in parallel, let waf take care of that.