REVONANO - Fix Auto Upload
[librepilot.git] / Makefile
blobed7cdffac88713c3731c6953c8f645e03dfdac17
2 # Top level Makefile for the OpenPilot project build system.
3 # Copyright (c) 2010-2013, The OpenPilot Team, http://www.openpilot.org
4 # Use 'make help' for instructions.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # This top level Makefile passes down some variables to sub-makes through
22 # the environment. They are explicitly exported using the export keyword.
23 # Lower level makefiles assume that these variables are defined. To ensure
24 # that a special magic variable is exported here. It must be checked for
25 # existance by each sub-make.
26 export OPENPILOT_IS_COOL := Fuck Yeah!
28 # It is possible to set OPENPILOT_DL_DIR and/or OPENPILOT_TOOLS_DIR environment
29 # variables to override local tools download and installation directorys. So the
30 # same toolchains can be used for all working copies. Particularly useful for CI
31 # server build agents, but also for local installations.
33 # If no OPENPILOT_* variables found, makefile internal DL_DIR and TOOLS_DIR paths
34 # will be used. They still can be overriden by the make command line parameters:
35 # make DL_DIR=/path/to/download/directory TOOLS_DIR=/path/to/tools/directory targets...
37 # Function for converting Windows style slashes into Unix style
38 slashfix = $(subst \,/,$(1))
40 # Function for converting an absolute path to one relative
41 # to the top of the source tree
42 toprel = $(subst $(realpath $(ROOT_DIR))/,,$(abspath $(1)))
44 # Set up some macros for common directories within the tree
45 export ROOT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
46 export DL_DIR := $(if $(OPENPILOT_DL_DIR),$(call slashfix,$(OPENPILOT_DL_DIR)),$(ROOT_DIR)/downloads)
47 export TOOLS_DIR := $(if $(OPENPILOT_TOOLS_DIR),$(call slashfix,$(OPENPILOT_TOOLS_DIR)),$(ROOT_DIR)/tools)
48 export BUILD_DIR := $(ROOT_DIR)/build
49 export PACKAGE_DIR := $(ROOT_DIR)/build/package
50 export DIST_DIR := $(ROOT_DIR)/build/dist
52 DIRS = $(DL_DIR) $(TOOLS_DIR) $(BUILD_DIR) $(PACKAGE_DIR) $(DIST_DIR)
54 # Set up default build configurations (debug | release)
55 GCS_BUILD_CONF := release
56 UAVOGEN_BUILD_CONF := release
57 ANDROIDGCS_BUILD_CONF := debug
58 GOOGLE_API_VERSION := 14
60 # Clean out undesirable variables from the environment and command-line
61 # to remove the chance that they will cause problems with our build
62 define SANITIZE_VAR
63 $(if $(filter-out undefined,$(origin $(1))),
64 $(info $(EMPTY) NOTE Sanitized $(2) variable '$(1)' from $(origin $(1)))
65 MAKEOVERRIDES = $(filter-out $(1)=%,$(MAKEOVERRIDES))
66 override $(1) :=
67 unexport $(1)
69 endef
71 # These specific variables can influence compilation in unexpected (and undesirable) ways
72 # gcc flags
73 SANITIZE_GCC_VARS := TMPDIR GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH
74 # preprocessor flags
75 SANITIZE_GCC_VARS += CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH DEPENDENCIES_OUTPUT
76 # make flags
77 SANITIZE_GCC_VARS += CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LDLIBS
78 $(foreach var, $(SANITIZE_GCC_VARS), $(eval $(call SANITIZE_VAR,$(var),disallowed)))
80 # These specific variables used to be valid but now they make no sense
81 SANITIZE_DEPRECATED_VARS := USE_BOOTLOADER CLEAN_BUILD
82 $(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),deprecated)))
84 # Make sure this isn't being run as root unless installing (no whoami on Windows, but that is ok here)
85 ifeq ($(shell whoami 2>/dev/null),root)
86 ifeq ($(filter install,$(MAKECMDGOALS)),)
87 ifndef FAKEROOTKEY
88 $(error You should not be running this as root)
89 endif
90 endif
91 endif
93 # Decide on a verbosity level based on the V= parameter
94 export AT := @
95 ifndef V
96 export V0 :=
97 export V1 := $(AT)
98 else ifeq ($(V), 0)
99 export V0 := $(AT)
100 export V1 := $(AT)
101 else ifeq ($(V), 1)
102 endif
104 # Make sure we know few things about the architecture before including
105 # the tools.mk to ensure that we download/install the right tools.
106 UNAME := $(shell uname)
107 ARCH := $(shell uname -m)
108 # Here and everywhere if not Linux or Mac then assume Windows
109 ifeq ($(filter Linux Darwin, $(UNAME)), )
110 UNAME := Windows
111 endif
113 # Include tools installers
114 include $(ROOT_DIR)/make/tools.mk
116 # Include third party builders if available
117 -include $(ROOT_DIR)/make/3rdparty/3rdparty.mk
119 # We almost need to consider autoconf/automake instead of this
120 ifeq ($(UNAME), Linux)
121 QT_SPEC = linux-g++
122 UAVOBJGENERATOR = "$(BUILD_DIR)/uavobjgenerator/uavobjgenerator"
123 else ifeq ($(UNAME), Darwin)
124 QT_SPEC = macx-g++
125 UAVOBJGENERATOR = "$(BUILD_DIR)/uavobjgenerator/uavobjgenerator"
126 else ifeq ($(UNAME), Windows)
127 QT_SPEC = win32-g++
128 UAVOBJGENERATOR = "$(BUILD_DIR)/uavobjgenerator/$(UAVOGEN_BUILD_CONF)/uavobjgenerator.exe"
129 endif
131 ##############################
133 # All targets
135 ##############################
137 .PHONY: all
138 all: uavobjects all_ground all_flight
140 .PHONY: all_clean
141 all_clean:
142 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR))"
143 $(V1) [ ! -d "$(BUILD_DIR)" ] || $(RM) -rf "$(BUILD_DIR)"
145 .PONY: clean
146 clean: all_clean
149 ##############################
151 # UAVObjects
153 ##############################
155 ifeq ($(V), 1)
156 UAVOGEN_SILENT :=
157 else
158 UAVOGEN_SILENT := silent
159 endif
161 UAVOBJGENERATOR_DIR = $(BUILD_DIR)/uavobjgenerator
162 DIRS += $(UAVOBJGENERATOR_DIR)
164 .PHONY: uavobjgenerator
165 uavobjgenerator: | $(UAVOBJGENERATOR_DIR)
166 $(V1) cd $(UAVOBJGENERATOR_DIR) && \
167 $(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro \
168 -spec $(QT_SPEC) -r CONFIG+=$(UAVOGEN_BUILD_CONF) CONFIG+=$(UAVOGEN_SILENT) && \
169 $(MAKE) --no-print-directory -w
171 UAVOBJ_TARGETS := gcs flight python matlab java wireshark
173 .PHONY: uavobjects
174 uavobjects: $(addprefix uavobjects_, $(UAVOBJ_TARGETS))
176 UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
177 UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
179 DIRS += $(UAVOBJ_OUT_DIR)
181 uavobjects_%: $(UAVOBJ_OUT_DIR) uavobjgenerator
182 $(V1) ( cd $(UAVOBJ_OUT_DIR) && \
183 $(UAVOBJGENERATOR) -$* $(UAVOBJ_XML_DIR) $(ROOT_DIR) ; \
186 uavobjects_test: $(UAVOBJ_OUT_DIR) uavobjgenerator
187 $(V1) $(UAVOBJGENERATOR) -v -none $(UAVOBJ_XML_DIR) $(ROOT_DIR)
189 uavobjects_clean:
190 @$(ECHO) " CLEAN $(call toprel, $(UAVOBJ_OUT_DIR))"
191 $(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)"
193 ##############################
195 # Flight related components
197 ##############################
199 # Define some pointers to the various important pieces of the flight code
200 # to prevent these being repeated in every sub makefile
201 export PIOS := $(ROOT_DIR)/flight/pios
202 export FLIGHTLIB := $(ROOT_DIR)/flight/libraries
203 export OPMODULEDIR := $(ROOT_DIR)/flight/modules
204 export OPUAVOBJ := $(ROOT_DIR)/flight/uavobjects
205 export OPUAVTALK := $(ROOT_DIR)/flight/uavtalk
206 export OPUAVSYNTHDIR := $(BUILD_DIR)/uavobject-synthetics/flight
207 export OPGCSSYNTHDIR := $(BUILD_DIR)/openpilotgcs-synthetics
209 DIRS += $(OPGCSSYNTHDIR)
211 # Define supported board lists
212 ALL_BOARDS := oplinkmini revolution osd revoproto simposix discoveryf4bare gpsplatinum revonano
214 # Short names of each board (used to display board name in parallel builds)
215 oplinkmini_short := 'oplm'
216 revolution_short := 'revo'
217 osd_short := 'osd '
218 revoproto_short := 'revp'
219 revonano_short := 'revn'
220 simposix_short := 'posx'
221 discoveryf4bare_short := 'df4b'
222 gpsplatinum_short := 'gps9'
224 # SimPosix only builds on Linux so drop it from the list for
225 # all other platforms.
226 ifneq ($(UNAME), Linux)
227 ALL_BOARDS := $(filter-out simposix, $(ALL_BOARDS))
228 endif
230 # Start out assuming that we'll build fw, bl and bu for all boards
231 FW_BOARDS := $(ALL_BOARDS)
232 BL_BOARDS := $(ALL_BOARDS)
233 BU_BOARDS := $(ALL_BOARDS)
234 EF_BOARDS := $(ALL_BOARDS)
236 # SimPosix doesn't have a BL, BU or EF target so we need to
237 # filter them out to prevent errors on the all_flight target.
238 BL_BOARDS := $(filter-out simposix, $(BL_BOARDS))
239 BU_BOARDS := $(filter-out simposix gpsplatinum, $(BU_BOARDS))
240 EF_BOARDS := $(filter-out simposix, $(EF_BOARDS))
242 # Generate the targets for whatever boards are left in each list
243 FW_TARGETS := $(addprefix fw_, $(FW_BOARDS))
244 BL_TARGETS := $(addprefix bl_, $(BL_BOARDS))
245 BU_TARGETS := $(addprefix bu_, $(BU_BOARDS))
246 EF_TARGETS := $(addprefix ef_, $(EF_BOARDS))
248 # When building any of the "all_*" targets, tell all sub makefiles to display
249 # additional details on each line of output to describe which build and target
250 # that each line applies to. The same applies also to all, opfw_resource,
251 # package targets
252 ifneq ($(strip $(filter all_% all opfw_resource package,$(MAKECMDGOALS))),)
253 export ENABLE_MSG_EXTRA := yes
254 endif
256 # When building more than one goal in a single make invocation, also
257 # enable the extra context for each output line
258 ifneq ($(word 2,$(MAKECMDGOALS)),)
259 export ENABLE_MSG_EXTRA := yes
260 endif
262 # TEMPLATES (used to generate build rules)
264 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
265 # $(2) = Short name for board (e.g cc)
266 define FW_TEMPLATE
267 .PHONY: $(1) fw_$(1)
268 $(1): fw_$(1)_opfw
269 fw_$(1): fw_$(1)_opfw
271 fw_$(1)_%: uavobjects_flight
272 $(V1) $$(ARM_GCC_VERSION_CHECK_TEMPLATE)
273 $(V1) $(MKDIR) -p $(BUILD_DIR)/fw_$(1)/dep
274 $(V1) cd $(ROOT_DIR)/flight/targets/boards/$(1)/firmware && \
275 $$(MAKE) -r --no-print-directory \
276 BUILD_TYPE=fw \
277 BOARD_NAME=$(1) \
278 BOARD_SHORT_NAME=$(2) \
279 TOPDIR=$(ROOT_DIR)/flight/targets/boards/$(1)/firmware \
280 OUTDIR=$(BUILD_DIR)/fw_$(1) \
281 TARGET=fw_$(1) \
284 .PHONY: $(1)_clean
285 $(1)_clean: fw_$(1)_clean
286 fw_$(1)_clean:
287 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/fw_$(1))"
288 $(V1) $(RM) -fr $(BUILD_DIR)/fw_$(1)
289 endef
291 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
292 # $(2) = Short name for board (e.g cc)
293 define BL_TEMPLATE
294 .PHONY: bl_$(1)
295 bl_$(1): bl_$(1)_bin
296 bl_$(1)_bino: bl_$(1)_bin
298 bl_$(1)_%:
299 $(V1) $$(ARM_GCC_VERSION_CHECK_TEMPLATE)
300 $(V1) $(MKDIR) -p $(BUILD_DIR)/bl_$(1)/dep
301 $(V1) cd $(ROOT_DIR)/flight/targets/boards/$(1)/bootloader && \
302 $$(MAKE) -r --no-print-directory \
303 BUILD_TYPE=bl \
304 BOARD_NAME=$(1) \
305 BOARD_SHORT_NAME=$(2) \
306 TOPDIR=$(ROOT_DIR)/flight/targets/boards/$(1)/bootloader \
307 OUTDIR=$(BUILD_DIR)/bl_$(1) \
308 TARGET=bl_$(1) \
311 .PHONY: unbrick_$(1)
312 unbrick_$(1): bl_$(1)_hex
313 $(if $(filter-out undefined,$(origin UNBRICK_TTY)),
314 $(V0) @$(ECHO) " UNBRICK $(1) via $$(UNBRICK_TTY)"
315 $(V1) $(STM32FLASH_DIR)/stm32flash \
316 -w $(BUILD_DIR)/bl_$(1)/bl_$(1).hex \
317 -g 0x0 \
318 $$(UNBRICK_TTY)
320 $(V0) @$(ECHO)
321 $(V0) @$(ECHO) "ERROR: You must specify UNBRICK_TTY=<serial-device> to use for unbricking."
322 $(V0) @$(ECHO) " eg. $$(MAKE) $$@ UNBRICK_TTY=/dev/ttyUSB0"
325 .PHONY: bl_$(1)_clean
326 bl_$(1)_clean:
327 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/bl_$(1))"
328 $(V1) $(RM) -fr $(BUILD_DIR)/bl_$(1)
329 endef
331 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
332 # $(2) = Short name for board (e.g cc)
333 define BU_TEMPLATE
334 .PHONY: bu_$(1)
335 bu_$(1): bu_$(1)_opfw
337 bu_$(1)_%: bl_$(1)_bino
338 $(V1) $(MKDIR) -p $(BUILD_DIR)/bu_$(1)/dep
339 $(V1) cd $(ROOT_DIR)/flight/targets/common/bootloader_updater && \
340 $$(MAKE) -r --no-print-directory \
341 BUILD_TYPE=bu \
342 BOARD_NAME=$(1) \
343 BOARD_SHORT_NAME=$(2) \
344 TOPDIR=$(ROOT_DIR)/flight/targets/common/bootloader_updater \
345 OUTDIR=$(BUILD_DIR)/bu_$(1) \
346 TARGET=bu_$(1) \
349 .PHONY: bu_$(1)_clean
350 bu_$(1)_clean:
351 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/bu_$(1))"
352 $(V1) $(RM) -fr $(BUILD_DIR)/bu_$(1)
353 endef
355 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
356 # $(2) = Short name for board (e.g cc)
357 define EF_TEMPLATE
358 .PHONY: ef_$(1)
359 ef_$(1): ef_$(1)_bin
361 ef_$(1)_%: bl_$(1)_bin fw_$(1)_opfw
362 $(V1) $(MKDIR) -p $(BUILD_DIR)/ef_$(1)
363 $(V1) cd $(ROOT_DIR)/flight/targets/common/entire_flash && \
364 $$(MAKE) -r --no-print-directory \
365 BUILD_TYPE=ef \
366 BOARD_NAME=$(1) \
367 BOARD_SHORT_NAME=$(2) \
368 DFU_CMD="$(DFUUTIL_DIR)/bin/dfu-util" \
369 TOPDIR=$(ROOT_DIR)/flight/targets/common/entire_flash \
370 OUTDIR=$(BUILD_DIR)/ef_$(1) \
371 TARGET=ef_$(1) \
374 .PHONY: ef_$(1)_clean
375 ef_$(1)_clean:
376 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/ef_$(1))"
377 $(V1) $(RM) -fr $(BUILD_DIR)/ef_$(1)
378 endef
380 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
381 define BOARD_PHONY_TEMPLATE
382 .PHONY: all_$(1)
383 all_$(1): $$(filter fw_$(1), $$(FW_TARGETS))
384 all_$(1): $$(filter bl_$(1), $$(BL_TARGETS))
385 all_$(1): $$(filter bu_$(1), $$(BU_TARGETS))
386 all_$(1): $$(filter ef_$(1), $$(EF_TARGETS))
388 .PHONY: all_$(1)_clean
389 all_$(1)_clean: $$(addsuffix _clean, $$(filter fw_$(1), $$(FW_TARGETS)))
390 all_$(1)_clean: $$(addsuffix _clean, $$(filter bl_$(1), $$(BL_TARGETS)))
391 all_$(1)_clean: $$(addsuffix _clean, $$(filter bu_$(1), $$(BU_TARGETS)))
392 all_$(1)_clean: $$(addsuffix _clean, $$(filter ef_$(1), $$(EF_TARGETS)))
393 endef
395 # Generate flight build rules
396 .PHONY: all_fw all_fw_clean
397 all_fw: $(addsuffix _opfw, $(FW_TARGETS))
398 all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
400 .PHONY: all_bl all_bl_clean
401 all_bl: $(addsuffix _bin, $(BL_TARGETS))
402 all_bl_clean: $(addsuffix _clean, $(BL_TARGETS))
404 .PHONY: all_bu all_bu_clean
405 all_bu: $(addsuffix _opfw, $(BU_TARGETS))
406 all_bu_clean: $(addsuffix _clean, $(BU_TARGETS))
408 .PHONY: all_ef all_ef_clean
409 all_ef: $(EF_TARGETS)
410 all_ef_clean: $(addsuffix _clean, $(EF_TARGETS))
412 .PHONY: all_flight all_flight_clean
413 all_flight: all_fw all_bl all_bu all_ef
414 all_flight_clean: all_fw_clean all_bl_clean all_bu_clean all_ef_clean
416 # Expand the groups of targets for each board
417 $(foreach board, $(ALL_BOARDS), $(eval $(call BOARD_PHONY_TEMPLATE,$(board))))
419 # Expand the firmware rules
420 $(foreach board, $(ALL_BOARDS), $(eval $(call FW_TEMPLATE,$(board),$($(board)_short))))
422 # Expand the bootloader rules
423 $(foreach board, $(ALL_BOARDS), $(eval $(call BL_TEMPLATE,$(board),$($(board)_short))))
425 # Expand the bootloader updater rules
426 $(foreach board, $(ALL_BOARDS), $(eval $(call BU_TEMPLATE,$(board),$($(board)_short))))
428 # Expand the entire-flash rules
429 $(foreach board, $(ALL_BOARDS), $(eval $(call EF_TEMPLATE,$(board),$($(board)_short))))
431 .PHONY: sim_win32
432 sim_win32: sim_win32_exe
434 sim_win32_%: uavobjects_flight
435 $(V1) $(MKDIR) -p $(BUILD_DIR)/sitl_win32
436 $(V1) $(MAKE) --no-print-directory \
437 -C $(ROOT_DIR)/flight/targets/OpenPilot --file=$(ROOT_DIR)/flight/targets/OpenPilot/Makefile.win32 $*
439 .PHONY: sim_osx
440 sim_osx: sim_osx_elf
442 sim_osx_%: uavobjects_flight
443 $(V1) $(MKDIR) -p $(BUILD_DIR)/sim_osx
444 $(V1) $(MAKE) --no-print-directory \
445 -C $(ROOT_DIR)/flight/targets/SensorTest --file=$(ROOT_DIR)/flight/targets/SensorTest/Makefile.osx $*
447 ##############################
449 # GCS related components
451 ##############################
453 .PHONY: all_ground
454 all_ground: openpilotgcs uploader
456 # Convenience target for the GCS
457 .PHONY: gcs gcs_qmake gcs_clean
458 gcs: openpilotgcs
459 gcs_qmake: openpilotgcs_qmake
460 gcs_clean: openpilotgcs_clean
462 ifeq ($(V), 1)
463 GCS_SILENT :=
464 else
465 GCS_SILENT := silent
466 endif
468 OPENPILOTGCS_DIR := $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)
469 DIRS += $(OPENPILOTGCS_DIR)
471 OPENPILOTGCS_MAKEFILE := $(OPENPILOTGCS_DIR)/Makefile
473 .PHONY: openpilotgcs_qmake
474 openpilotgcs_qmake $(OPENPILOTGCS_MAKEFILE): | $(OPENPILOTGCS_DIR)
475 $(V1) cd $(OPENPILOTGCS_DIR) && \
476 $(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro \
477 -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS)
479 .PHONY: openpilotgcs
480 openpilotgcs: uavobjects_gcs $(OPENPILOTGCS_MAKEFILE)
481 $(V1) $(MAKE) -w -C $(OPENPILOTGCS_DIR)/$(MAKE_DIR);
483 .PHONY: openpilotgcs_clean
484 openpilotgcs_clean:
485 @$(ECHO) " CLEAN $(call toprel, $(OPENPILOTGCS_DIR))"
486 $(V1) [ ! -d "$(OPENPILOTGCS_DIR)" ] || $(RM) -r "$(OPENPILOTGCS_DIR)"
490 ################################
492 # Serial Uploader tool
494 ################################
496 UPLOADER_DIR := $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)
497 DIRS += $(UPLOADER_DIR)
499 UPLOADER_MAKEFILE := $(UPLOADER_DIR)/Makefile
501 .PHONY: uploader_qmake
502 uploader_qmake $(UPLOADER_MAKEFILE): | $(UPLOADER_DIR)
503 $(V1) cd $(UPLOADER_DIR) && \
504 $(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/src/experimental/USB_UPLOAD_TOOL/upload.pro \
505 -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS)
507 .PHONY: uploader
508 uploader: $(UPLOADER_MAKEFILE)
509 $(V1) $(MAKE) -w -C $(UPLOADER_DIR)
511 .PHONY: uploader_clean
512 uploader_clean:
513 @$(ECHO) " CLEAN $(call toprel, $(UPLOADER_DIR))"
514 $(V1) [ ! -d "$(UPLOADER_DIR)" ] || $(RM) -r "$(UPLOADER_DIR)"
517 # We want to take snapshots of the UAVOs at each point that they change
518 # to allow the GCS to be compatible with as many versions as possible.
519 # We always include a pseudo collection called "srctree" which represents
520 # the UAVOs in the source tree. So not necessary to add current tree UAVO
521 # hash here, it is always included.
523 # Find the git hashes of each commit that changes uavobjects with:
524 # git log --format=%h -- shared/uavobjectdefinition/ | head -n 2
525 # List only UAVO hashes of past releases, do not list current hash.
526 # Past compatible versions are so far: RELEASE-12.10.2
527 UAVO_GIT_VERSIONS := 5e14f53
529 # All versions includes also the current source tree UAVO hash
530 UAVO_ALL_VERSIONS := $(UAVO_GIT_VERSIONS) srctree
532 # This is where the UAVO collections are stored
533 UAVO_COLLECTION_DIR := $(BUILD_DIR)/uavo-collections
535 # $(1) git hash of a UAVO snapshot
536 define UAVO_COLLECTION_GIT_TEMPLATE
538 # Make the output directory that will contain all of the synthetics for the
539 # uavo collection referenced by the git hash $(1)
540 $$(UAVO_COLLECTION_DIR)/$(1):
541 $$(V1) $(MKDIR) -p $$(UAVO_COLLECTION_DIR)/$(1)
543 # Extract the snapshot of shared/uavobjectdefinition from git hash $(1)
544 $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar: | $$(UAVO_COLLECTION_DIR)/$(1)
545 $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar:
546 $$(V0) @$(ECHO) " UAVOTAR $(1)"
547 $$(V1) $(GIT) archive $(1) -o $$@ -- shared/uavobjectdefinition/
549 # Extract the uavo xml files from our snapshot
550 $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar
551 $$(V0) @$(ECHO) " UAVOUNTAR $(1)"
552 $$(V1) $(RM) -rf $$@
553 $$(V1) $(MKDIR) -p $$@
554 $$(V1) $(TAR) -C $$(call toprel, $$@) -xf $$(call toprel, $$<) || $(RM) -rf $$@
555 endef
557 # Map the current working directory into the set of UAVO collections
558 $(UAVO_COLLECTION_DIR)/srctree:
559 $(V1) $(MKDIR) -p $@
561 $(UAVO_COLLECTION_DIR)/srctree/uavo-xml: | $(UAVO_COLLECTION_DIR)/srctree
562 $(UAVO_COLLECTION_DIR)/srctree/uavo-xml: $(UAVOBJ_XML_DIR)
563 $(V1) $(LN) -sf $(ROOT_DIR) $(UAVO_COLLECTION_DIR)/srctree/uavo-xml
565 # $(1) git hash (or symbolic name) of a UAVO snapshot
566 define UAVO_COLLECTION_BUILD_TEMPLATE
568 # This leaves us with a (broken) symlink that points to the full sha1sum of the collection
569 $$(UAVO_COLLECTION_DIR)/$(1)/uavohash: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml
570 # Compute the sha1 hash for this UAVO collection
571 # The sed bit truncates the UAVO hash to 16 hex digits
572 $$(V1) $$(VERSION_INFO) \
573 --uavodir=$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition \
574 --format='$$$${UAVO_HASH}' | \
575 $(SED) -e 's|\(................\).*|\1|' > $$@
577 $$(V0) @$(ECHO) " UAVOHASH $(1) ->" $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
579 # Generate the java uavobjects for this UAVO collection
580 $$(UAVO_COLLECTION_DIR)/$(1)/java-build/java: $$(UAVO_COLLECTION_DIR)/$(1)/uavohash
581 $$(V0) @$(ECHO) " UAVOJAVA $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
582 $$(V1) $(MKDIR) -p $$@
583 $$(V1) ( \
584 cd $$(UAVO_COLLECTION_DIR)/$(1)/java-build && \
585 $$(UAVOBJGENERATOR) -java $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition $$(ROOT_DIR) ; \
588 # Build a jar file for this UAVO collection
589 $$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: | $$(ANDROIDGCS_ASSETS_DIR)/uavos
590 $$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: $$(UAVO_COLLECTION_DIR)/$(1)/java-build/java
591 $$(V0) @$(ECHO) " UAVOJAR $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
592 $$(V1) ( \
593 HASH=$$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) && \
594 cd $$(UAVO_COLLECTION_DIR)/$(1)/java-build && \
595 $(JAVAC) java/*.java \
596 $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVDataObject.java \
597 $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVObject*.java \
598 $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVMetaObject.java \
599 -d . && \
600 find ./org/openpilot/uavtalk/uavobjects -type f -name '*.class' > classlist.txt && \
601 $(JAR) cf tmp_uavobjects.jar @classlist.txt && \
602 $$(ANDROID_DX) \
603 --dex \
604 --output $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar \
605 tmp_uavobjects.jar && \
606 $(LN) -sf $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar uavobjects.jar \
609 endef
611 # One of these for each element of UAVO_GIT_VERSIONS so we can extract the UAVOs from git
612 $(foreach githash, $(UAVO_GIT_VERSIONS), $(eval $(call UAVO_COLLECTION_GIT_TEMPLATE,$(githash))))
614 # One of these for each UAVO_ALL_VERSIONS which includes the ones in the srctree
615 $(foreach githash, $(UAVO_ALL_VERSIONS), $(eval $(call UAVO_COLLECTION_BUILD_TEMPLATE,$(githash))))
617 .PHONY: uavo-collections_java
618 uavo-collections_java: $(foreach githash, $(UAVO_ALL_VERSIONS), $(UAVO_COLLECTION_DIR)/$(githash)/java-build/uavobjects.jar)
620 .PHONY: uavo-collections
621 uavo-collections: uavo-collections_java
623 .PHONY: uavo-collections_clean
624 uavo-collections_clean:
625 @$(ECHO) " CLEAN $(call toprel, $(UAVO_COLLECTION_DIR))"
626 $(V1) [ ! -d "$(UAVO_COLLECTION_DIR)" ] || $(RM) -r $(UAVO_COLLECTION_DIR)
628 ##############################
630 # Unit Tests
632 ##############################
634 ALL_UNITTESTS := logfs math lednotification
636 # Build the directory for the unit tests
637 UT_OUT_DIR := $(BUILD_DIR)/unit_tests
638 DIRS += $(UT_OUT_DIR)
640 .PHONY: all_ut
641 all_ut: $(addsuffix _elf, $(addprefix ut_, $(ALL_UNITTESTS)))
643 .PHONY: all_ut_xml
644 all_ut_xml: $(addsuffix _xml, $(addprefix ut_, $(ALL_UNITTESTS)))
646 .PHONY: all_ut_run
647 all_ut_run: $(addsuffix _run, $(addprefix ut_, $(ALL_UNITTESTS)))
649 .PHONY: all_ut_clean
650 all_ut_clean:
651 @$(ECHO) " CLEAN $(call toprel, $(UT_OUT_DIR))"
652 $(V1) [ ! -d "$(UT_OUT_DIR)" ] || $(RM) -r "$(UT_OUT_DIR)"
654 # $(1) = Unit test name
655 define UT_TEMPLATE
656 .PHONY: ut_$(1)
657 ut_$(1): ut_$(1)_run
659 ut_$(1)_%: $$(UT_OUT_DIR)
660 $(V1) $(MKDIR) -p $(UT_OUT_DIR)/$(1)
661 $(V1) cd $(ROOT_DIR)/flight/tests/$(1) && \
662 $$(MAKE) -r --no-print-directory \
663 BUILD_TYPE=ut \
664 BOARD_SHORT_NAME=$(1) \
665 TOPDIR=$(ROOT_DIR)/flight/tests/$(1) \
666 OUTDIR="$(UT_OUT_DIR)/$(1)" \
667 TARGET=$(1) \
670 .PHONY: ut_$(1)_clean
671 ut_$(1)_clean:
672 @$(ECHO) " CLEAN $(call toprel, $(UT_OUT_DIR)/$(1))"
673 $(V1) [ ! -d "$(UT_OUT_DIR)/$(1)" ] || $(RM) -r "$(UT_OUT_DIR)/$(1)"
674 endef
676 # Expand the unittest rules
677 $(foreach ut, $(ALL_UNITTESTS), $(eval $(call UT_TEMPLATE,$(ut))))
679 # Disable parallel make when the all_ut_run target is requested otherwise the TAP
680 # output is interleaved with the rest of the make output.
681 ifneq ($(strip $(filter all_ut_run,$(MAKECMDGOALS))),)
682 .NOTPARALLEL:
683 $(info $(EMPTY) NOTE Parallel make disabled by all_ut_run target so we have sane console output)
684 endif
686 ##############################
688 # Packaging components
690 ##############################
692 # Firmware files to package
693 PACKAGE_FW_EXCLUDE := fw_simposix $(if $(PACKAGE_FW_INCLUDE_DISCOVERYF4BARE),,fw_discoveryf4bare)
694 PACKAGE_FW_TARGETS := $(filter-out $(PACKAGE_FW_EXCLUDE), $(FW_TARGETS))
695 PACKAGE_ELF_TARGETS := $(filter fw_simposix, $(FW_TARGETS))
697 # Rules to generate GCS resources used to embed firmware binaries into the GCS.
698 # They are used later by the vehicle setup wizard to update board firmware.
699 # To open a firmware image use ":/firmware/fw_coptercontrol.opfw"
700 OPFW_RESOURCE := $(OPGCSSYNTHDIR)/opfw_resource.qrc
701 OPFW_RESOURCE_PREFIX := ../../
702 OPFW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(call toprel, $(BUILD_DIR)/$(fw_targ)/$(fw_targ).opfw))
703 OPFW_CONTENTS := \
704 <!DOCTYPE RCC><RCC version="1.0"> \
705 <qresource prefix="/firmware"> \
706 $(foreach fw_file, $(OPFW_FILES), <file alias="$(notdir $(fw_file))">$(OPFW_RESOURCE_PREFIX)$(fw_file)</file>) \
707 </qresource> \
708 </RCC>
710 .PHONY: opfw_resource
711 opfw_resource: $(OPFW_RESOURCE)
713 $(OPFW_RESOURCE): $(FW_TARGETS) | $(OPGCSSYNTHDIR)
714 @$(ECHO) Generating OPFW resource file $(call toprel, $@)
715 $(V1) $(ECHO) $(QUOTE)$(OPFW_CONTENTS)$(QUOTE) > $@
717 # If opfw_resource or all firmware are requested, GCS should depend on the resource
718 ifneq ($(strip $(filter opfw_resource all all_fw all_flight package,$(MAKECMDGOALS))),)
719 $(OPENPILOTGCS_MAKEFILE): $(OPFW_RESOURCE)
720 endif
722 # Packaging targets: package
723 # - builds all firmware, opfw_resource, gcs
724 # - copies firmware into a package directory
725 # - calls paltform-specific packaging script
727 # Define some variables
728 PACKAGE_LBL := $(shell $(VERSION_INFO) --format=\$${LABEL})
729 PACKAGE_NAME := OpenPilot
730 PACKAGE_SEP := -
731 PACKAGE_FULL_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(PACKAGE_LBL)
733 include $(ROOT_DIR)/package/$(UNAME).mk
735 # Source distribution is never dirty because it uses git archive
736 DIST_NAME := $(DIST_DIR)/$(subst dirty-,,$(PACKAGE_FULL_NAME)).tar
738 ##############################
740 # Source code formatting
742 ##############################
744 UNCRUSTIFY_TARGETS := flight ground
746 # $(1) = Uncrustify target (e.g flight or ground)
747 # $(2) = Target root directory
748 define UNCRUSTIFY_TEMPLATE
750 .PHONY: uncrustify_$(1)
751 uncrustify_$(1):
752 @$(ECHO) "Auto-formatting $(1) source code"
753 $(V1) UNCRUSTIFY_CONFIG="$(ROOT_DIR)/make/uncrustify/uncrustify.cfg" $(SHELL) make/scripts/uncrustify.sh $(call toprel, $(2))
754 endef
756 $(foreach uncrustify_targ, $(UNCRUSTIFY_TARGETS), $(eval $(call UNCRUSTIFY_TEMPLATE,$(uncrustify_targ),$(ROOT_DIR)/$(uncrustify_targ))))
758 .PHONY: uncrustify_all
759 uncrustify_all: $(addprefix uncrustify_,$(UNCRUSTIFY_TARGETS))
761 ##############################
763 # Doxygen documentation
765 # Each target should have own Doxyfile.$(target) with build directory build/docs/$(target),
766 # proper source directory (e.g. $(target)) and appropriate other doxygen options.
768 ##############################
770 DOCS_TARGETS := flight ground uavobjects
772 # $(1) = Doxygen target (e.g flight or ground)
773 define DOXYGEN_TEMPLATE
775 .PHONY: docs_$(1)
776 docs_$(1): docs_$(1)_clean
777 @$(ECHO) "Generating $(1) documentation"
778 $(V1) $(MKDIR) -p $(BUILD_DIR)/docs/$(1)
779 $(V1) $(DOXYGEN) $(ROOT_DIR)/make/doxygen/Doxyfile.$(1)
781 .PHONY: docs_$(1)_clean
782 docs_$(1)_clean:
783 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/docs/$(1))"
784 $(V1) [ ! -d "$(BUILD_DIR)/docs/$(1)" ] || $(RM) -r "$(BUILD_DIR)/docs/$(1)"
786 endef
788 $(foreach docs_targ, $(DOCS_TARGETS), $(eval $(call DOXYGEN_TEMPLATE,$(docs_targ))))
790 .PHONY: docs_all
791 docs_all: $(addprefix docs_,$(DOCS_TARGETS))
793 .PHONY: docs_all_clean
794 docs_all_clean:
795 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/docs)"
796 $(V1) [ ! -d "$(BUILD_DIR)/docs" ] || $(RM) -rf "$(BUILD_DIR)/docs"
798 ##############################
800 # Build info
802 ##############################
804 .PHONY: build-info
805 build-info: | $(BUILD_DIR)
806 @$(ECHO) " BUILD-INFO $(call toprel, $(BUILD_DIR)/$@.txt)"
807 $(V1) $(VERSION_INFO) \
808 --uavodir=$(ROOT_DIR)/shared/uavobjectdefinition \
809 --template="make/templates/$@.txt" \
810 --outfile="$(BUILD_DIR)/$@.txt"
812 ##############################
814 # Source for distribution
816 ##############################
818 DIST_VER_INFO := $(DIST_DIR)/version-info.json
820 $(DIST_VER_INFO): .git/index | $(DIST_DIR)
821 $(V1) $(VERSION_INFO) --jsonpath="$(DIST_DIR)"
824 $(DIST_NAME).gz: $(DIST_VER_INFO) .git/index | $(DIST_DIR)
825 @$(ECHO) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_NAME).gz)"
826 $(V1) git archive --prefix="$(PACKAGE_NAME)/" -o "$(DIST_NAME)" HEAD
827 $(V1) tar --append --file="$(DIST_NAME)" \
828 --transform='s,.*version-info.json,$(PACKAGE_NAME)/version-info.json,' \
829 $(call toprel, "$(DIST_VER_INFO)")
830 $(V1) gzip -f "$(DIST_NAME)"
832 .PHONY: dist
833 dist: $(DIST_NAME).gz
836 ##############################
838 # Directories
840 ##############################
842 $(DIRS):
843 $(V1) $(MKDIR) -p $@
846 ##############################
848 # Help message, the default Makefile goal
850 ##############################
852 .DEFAULT_GOAL := help
854 .PHONY: help
855 help:
856 @$(ECHO)
857 @$(ECHO) " This Makefile is known to work on Linux and Mac in a standard shell environment."
858 @$(ECHO) " It also works on Windows by following the instructions given on this wiki page:"
859 @$(ECHO) " http://wiki.openpilot.org/display/Doc/Windows%3A+Building+and+Packaging"
860 @$(ECHO)
861 @$(ECHO) " Here is a summary of the available targets:"
862 @$(ECHO)
863 @$(ECHO) " [Source tree preparation]"
864 @$(ECHO) " prepare - Install GIT commit message template"
865 @$(ECHO) " [Tool Installers]"
866 @$(ECHO) " arm_sdk_install - Install the GNU ARM gcc toolchain"
867 @$(ECHO) " qt_sdk_install - Install the QT development tools"
868 @$(ECHO) " nsis_install - Install the NSIS Unicode (Windows only)"
869 @$(ECHO) " sdl_install - Install the SDL library (Windows only)"
870 @$(ECHO) " mesawin_install - Install the OpenGL32 DLL (Windows only)"
871 @$(ECHO) " openssl_install - Install the OpenSSL libraries (Windows only)"
872 @$(ECHO) " uncrustify_install - Install the Uncrustify source code beautifier"
873 @$(ECHO) " doxygen_install - Install the Doxygen documentation generator"
874 @$(ECHO) " gtest_install - Install the GoogleTest framework"
875 @$(ECHO) " These targets are not updated yet and are probably broken:"
876 @$(ECHO) " openocd_install - Install the OpenOCD JTAG daemon"
877 @$(ECHO) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards"
878 @$(ECHO) " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards"
879 @$(ECHO) " Install all available tools:"
880 @$(ECHO) " all_sdk_install - Install all of above (platform-dependent)"
881 @$(ECHO) " build_sdk_install - Install only essential for build tools (platform-dependent)"
882 @$(ECHO)
883 @$(ECHO) " Other tool options are:"
884 @$(ECHO) " <tool>_version - Display <tool> version"
885 @$(ECHO) " <tool>_clean - Remove installed <tool>"
886 @$(ECHO) " <tool>_distclean - Remove downloaded <tool> distribution file(s)"
887 @$(ECHO)
888 @$(ECHO) " [Big Hammer]"
889 @$(ECHO) " all - Generate UAVObjects, build openpilot firmware and gcs"
890 @$(ECHO) " all_flight - Build all firmware, bootloaders and bootloader updaters"
891 @$(ECHO) " all_fw - Build only firmware for all boards"
892 @$(ECHO) " all_bl - Build only bootloaders for all boards"
893 @$(ECHO) " all_bu - Build only bootloader updaters for all boards"
894 @$(ECHO)
895 @$(ECHO) " all_clean - Remove your build directory ($(BUILD_DIR))"
896 @$(ECHO) " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
897 @$(ECHO) " all_fw_clean - Remove firmware for all boards"
898 @$(ECHO) " all_bl_clean - Remove bootloaders for all boards"
899 @$(ECHO) " all_bu_clean - Remove bootloader updaters for all boards"
900 @$(ECHO)
901 @$(ECHO) " all_<board> - Build all available images for <board>"
902 @$(ECHO) " all_<board>_clean - Remove all available images for <board>"
903 @$(ECHO)
904 @$(ECHO) " all_ut - Build all unit tests"
905 @$(ECHO) " all_ut_tap - Run all unit tests and capture all TAP output to files"
906 @$(ECHO) " all_ut_run - Run all unit tests and dump TAP output to console"
907 @$(ECHO)
908 @$(ECHO) " [Firmware]"
909 @$(ECHO) " <board> - Build firmware for <board>"
910 @$(ECHO) " Supported boards are ($(ALL_BOARDS))"
911 @$(ECHO) " fw_<board> - Build firmware for <board>"
912 @$(ECHO) " Supported boards are ($(FW_BOARDS))"
913 @$(ECHO) " fw_<board>_clean - Remove firmware for <board>"
914 @$(ECHO) " fw_<board>_program - Use OpenOCD + JTAG to write firmware to <board>"
915 @$(ECHO)
916 @$(ECHO) " [Bootloader]"
917 @$(ECHO) " bl_<board> - Build bootloader for <board>"
918 @$(ECHO) " Supported boards are ($(BL_BOARDS))"
919 @$(ECHO) " bl_<board>_clean - Remove bootloader for <board>"
920 @$(ECHO) " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
921 @$(ECHO)
922 @$(ECHO) " [Entire Flash]"
923 @$(ECHO) " ef_<board> - Build entire flash image for <board>"
924 @$(ECHO) " Supported boards are ($(EF_BOARDS))"
925 @$(ECHO) " ef_<board>_clean - Remove entire flash image for <board>"
926 @$(ECHO) " ef_<board>_program - Use OpenOCD + JTAG to write entire flash image to <board>"
927 @$(ECHO)
928 @$(ECHO) " [Bootloader Updater]"
929 @$(ECHO) " bu_<board> - Build bootloader updater for <board>"
930 @$(ECHO) " Supported boards are ($(BU_BOARDS))"
931 @$(ECHO) " bu_<board>_clean - Remove bootloader updater for <board>"
932 @$(ECHO)
933 @$(ECHO) " [Unbrick a board]"
934 @$(ECHO) " unbrick_<board> - Use the STM32's built in boot ROM to write a bootloader to <board>"
935 @$(ECHO) " Supported boards are ($(BL_BOARDS))"
936 @$(ECHO) " [Unittests]"
937 @$(ECHO) " ut_<test> - Build unit test <test>"
938 @$(ECHO) " ut_<test>_xml - Run test and capture XML output into a file"
939 @$(ECHO) " ut_<test>_run - Run test and dump output to console"
940 @$(ECHO)
941 @$(ECHO) " [Simulation]"
942 @$(ECHO) " sim_osx - Build OpenPilot simulation firmware for OSX"
943 @$(ECHO) " sim_osx_clean - Delete all build output for the osx simulation"
944 @$(ECHO) " sim_win32 - Build OpenPilot simulation firmware for Windows"
945 @$(ECHO) " using mingw and msys"
946 @$(ECHO) " sim_win32_clean - Delete all build output for the win32 simulation"
947 @$(ECHO)
948 @$(ECHO) " [GCS]"
949 @$(ECHO) " gcs - Build the Ground Control System (GCS) application (debug|release)"
950 @$(ECHO) " Compile specific directory: MAKE_DIR=<dir>"
951 @$(ECHO) " Example: make gcs MAKE_DIR=src/plugins/coreplugin"
952 @$(ECHO) " gcs_qmake - Run qmake for the Ground Control System (GCS) application (debug|release)"
953 @$(ECHO) " gcs_clean - Remove the Ground Control System (GCS) application (debug|release)"
954 @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
955 @$(ECHO)
956 @$(ECHO) " [Uploader Tool]"
957 @$(ECHO) " uploader - Build the serial uploader tool (debug|release)"
958 @$(ECHO) " uploader_qmake - Run qmake for the serial uploader tool (debug|release)"
959 @$(ECHO) " uploader_clean - Remove the serial uploader tool (debug|release)"
960 @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
961 @$(ECHO)
962 @$(ECHO)
963 @$(ECHO) " [UAVObjects]"
964 @$(ECHO) " uavobjects - Generate source files from the UAVObject definition XML files"
965 @$(ECHO) " uavobjects_test - Parse xml-files - check for valid, duplicate ObjId's, ..."
966 @$(ECHO) " uavobjects_<group> - Generate source files from a subset of the UAVObject definition XML files"
967 @$(ECHO) " Supported groups are ($(UAVOBJ_TARGETS))"
968 @$(ECHO)
969 @$(ECHO) " [Packaging]"
970 @$(ECHO) " package - Build and package the OpenPilot platform-dependent package (no clean)"
971 @$(ECHO) " opfw_resource - Generate resources to embed firmware binaries into the GCS"
972 @$(ECHO) " dist - Generate source archive for distribution"
973 @$(ECHO) " install - Install GCS to \"DESTDIR\" with prefix \"prefix\" (Linux only)"
974 @$(ECHO)
975 @$(ECHO) " [Code Formatting]"
976 @$(ECHO) " uncrustify_<source> - Reformat <source> code according to the project's standards"
977 @$(ECHO) " Supported sources are ($(UNCRUSTIFY_TARGETS))"
978 @$(ECHO) " uncrustify_all - Reformat all source code"
979 @$(ECHO)
980 @$(ECHO) " [Code Documentation]"
981 @$(ECHO) " docs_<source> - Generate HTML documentation for <source>"
982 @$(ECHO) " Supported sources are ($(DOCS_TARGETS))"
983 @$(ECHO) " docs_all - Generate HTML documentation for all"
984 @$(ECHO) " docs_<source>_clean - Delete generated documentation for <source>"
985 @$(ECHO) " docs_all_clean - Delete all generated documentation"
986 @$(ECHO)
987 @$(ECHO) " Hint: Add V=1 to your command line to see verbose build output."
988 @$(ECHO)
989 @$(ECHO) " Notes: All tool distribution files will be downloaded into $(DL_DIR)"
990 @$(ECHO) " All tools will be installed into $(TOOLS_DIR)"
991 @$(ECHO) " All build output will be placed in $(BUILD_DIR)"
992 @$(ECHO)
993 @$(ECHO) " Tool download and install directories can be changed using environment variables:"
994 @$(ECHO) " OPENPILOT_DL_DIR full path to downloads directory [downloads if not set]"
995 @$(ECHO) " OPENPILOT_TOOLS_DIR full path to installed tools directory [tools if not set]"
996 @$(ECHO) " More info: http://wiki.openpilot.org/display/Doc/OpenPilot+Build+System+Overview"
997 @$(ECHO)