AP_TECS: Remove duplicate setting of flare pitch upper limit
[ardupilot.git] / Makefile
blob97cfde52e62a65c633792f6ca0c3c8d767585987
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)
12 all: help
14 $(WAF_BINARY):
15 @git submodule init && git submodule update
17 waf-%: $(WAF_BINARY)
18 @$(WAF) $*
20 %-configure: $(WAF_BINARY)
21 @$(WAF) configure --board $*
23 $(EXPLICIT_COMMANDS): $(WAF_BINARY)
24 @$(WAF) $@
26 $(VEHICLES): $(WAF_BINARY)
27 @echo Build for vehicle $@
28 @$(WAF) $@
30 .DEFAULT: %-configure
31 @$(WAF) configure --board $@ build
33 define target_template
34 $(1)-$(2) : $(1)-configure $(2)
35 endef
37 $(foreach board,$(BOARD_LIST),$(foreach vehicle,$(VEHICLES),$(eval $(call target_template,$(board),$(vehicle)))))
39 help:
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)'."
46 @echo ""
47 @echo "For more detailed instructions see https://ardupilot.org/dev/docs/building-the-code.html"
48 @echo ""
49 @echo "Boards"
50 @echo "------"
51 @echo ""
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."
57 @echo ""
58 @echo "You can get a list of available boards using the command:"
59 @echo " make list_boards"
60 @echo ""
61 @echo "Vehicles"
62 @echo "--------"
63 @echo ""
64 @echo "It's possible to build for a specific vehicle by defining the target as one of:"
65 @echo " $(VEHICLES)"
66 @echo ""
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)"
70 @echo ""
71 @echo "Combinations"
72 @echo "------------"
73 @echo ""
74 @echo "It's possible to build for a specific vehicle type and board using"
75 @echo " make BOARD-VEHICLE"
76 @echo ""
77 @echo "For example, to build copter for the Pixracer, use this:"
78 @echo " make Pixracer-copter"
79 @echo ""
80 @echo "Check"
81 @echo "-----"
82 @echo ""
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"
87 @echo ""
88 @echo "Waf commands"
89 @echo "------------"
90 @echo ""
91 @echo "Waf commands can be explicitly called with targets prefixed by 'waf-'. Example:"
92 @echo " make waf-clean"
93 @echo " make waf-build"
94 @echo ""
95 @echo "Common commands"
96 @echo "---------------"
97 @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)"
100 @echo ""
101 @echo "Waf flags"
102 @echo "---------"
103 @echo ""
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'"
106 @echo ""
108 # Don't run in parallel, let waf take care of that.
109 .NOTPARALLEL: