Merge branch 'rel-nano-15.05' into corvuscorax/fixedwingautotakeofftest
[librepilot.git] / Makefile
blobbeb06ec3c6d825c9e912e1cbee6a9c8e82dc99f0
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 GOOGLE_API_VERSION := 14
58 # Clean out undesirable variables from the environment and command-line
59 # to remove the chance that they will cause problems with our build
60 define SANITIZE_VAR
61 $(if $(filter-out undefined,$(origin $(1))),
62 $(info $(EMPTY) NOTE Sanitized $(2) variable '$(1)' from $(origin $(1)))
63 MAKEOVERRIDES = $(filter-out $(1)=%,$(MAKEOVERRIDES))
64 override $(1) :=
65 unexport $(1)
67 endef
69 # These specific variables can influence compilation in unexpected (and undesirable) ways
70 # gcc flags
71 SANITIZE_GCC_VARS := TMPDIR GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH
72 # preprocessor flags
73 SANITIZE_GCC_VARS += CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH DEPENDENCIES_OUTPUT
74 # make flags
75 SANITIZE_GCC_VARS += CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LDLIBS
76 $(foreach var, $(SANITIZE_GCC_VARS), $(eval $(call SANITIZE_VAR,$(var),disallowed)))
78 # These specific variables used to be valid but now they make no sense
79 SANITIZE_DEPRECATED_VARS := USE_BOOTLOADER CLEAN_BUILD
80 $(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),deprecated)))
82 # Make sure this isn't being run as root unless installing (no whoami on Windows, but that is ok here)
83 ifeq ($(shell whoami 2>/dev/null),root)
84 ifeq ($(filter install,$(MAKECMDGOALS)),)
85 ifndef FAKEROOTKEY
86 $(error You should not be running this as root)
87 endif
88 endif
89 endif
91 # Decide on a verbosity level based on the V= parameter
92 export AT := @
93 ifndef V
94 export V0 :=
95 export V1 := $(AT)
96 else ifeq ($(V), 0)
97 export V0 := $(AT)
98 export V1 := $(AT)
99 else ifeq ($(V), 1)
100 endif
102 # Make sure we know few things about the architecture before including
103 # the tools.mk to ensure that we download/install the right tools.
104 UNAME := $(shell uname)
105 ARCH := $(shell uname -m)
106 # Here and everywhere if not Linux or Mac then assume Windows
107 ifeq ($(filter Linux Darwin, $(UNAME)), )
108 UNAME := Windows
109 endif
111 # Include tools installers
112 include $(ROOT_DIR)/make/tools.mk
114 # Include third party builders if available
115 -include $(ROOT_DIR)/make/3rdparty/3rdparty.mk
117 # We almost need to consider autoconf/automake instead of this
118 ifeq ($(UNAME), Linux)
119 QT_SPEC = linux-g++
120 UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
121 else ifeq ($(UNAME), Darwin)
122 QT_SPEC = macx-g++
123 UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
124 else ifeq ($(UNAME), Windows)
125 QT_SPEC = win32-g++
126 UAVOBJGENERATOR = $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe
127 endif
129 ##############################
131 # All targets
133 ##############################
135 .PHONY: all
136 all: uavobjects all_ground all_flight
138 .PHONY: all_clean
139 all_clean:
140 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR))"
141 $(V1) [ ! -d "$(BUILD_DIR)" ] || $(RM) -rf "$(BUILD_DIR)"
143 .PONY: clean
144 clean: all_clean
147 ##############################
149 # UAVObjects
151 ##############################
153 UAVOBJGENERATOR_DIR = $(BUILD_DIR)/uavobjgenerator
154 DIRS += $(UAVOBJGENERATOR_DIR)
156 .PHONY: uavobjgenerator
157 uavobjgenerator $(UAVOBJGENERATOR): | $(UAVOBJGENERATOR_DIR)
158 $(V1) cd $(UAVOBJGENERATOR_DIR) && \
159 ( [ -f Makefile ] || $(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro \
160 -spec $(QT_SPEC) CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) ) && \
161 $(MAKE) --no-print-directory -w
163 UAVOBJ_TARGETS := gcs flight python matlab java wireshark
165 .PHONY: uavobjects
166 uavobjects: $(addprefix uavobjects_, $(UAVOBJ_TARGETS))
168 UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
169 UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
171 uavobjects_%: uavobjgenerator
172 @$(MKDIR) -p $(UAVOBJ_OUT_DIR)/$*
173 $(V1) ( cd $(UAVOBJ_OUT_DIR)/$* && \
174 $(UAVOBJGENERATOR) -$* $(UAVOBJ_XML_DIR) $(ROOT_DIR) ; \
177 uavobjects_test: uavobjgenerator
178 $(V1) $(UAVOBJGENERATOR) -v $(UAVOBJ_XML_DIR) $(ROOT_DIR)
180 uavobjects_clean:
181 @$(ECHO) " CLEAN $(call toprel, $(UAVOBJ_OUT_DIR))"
182 $(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)"
184 ##############################
186 # Flight related components
188 ##############################
190 # Define some pointers to the various important pieces of the flight code
191 # to prevent these being repeated in every sub makefile
192 export PIOS := $(ROOT_DIR)/flight/pios
193 export FLIGHTLIB := $(ROOT_DIR)/flight/libraries
194 export OPMODULEDIR := $(ROOT_DIR)/flight/modules
195 export OPUAVOBJ := $(ROOT_DIR)/flight/uavobjects
196 export OPUAVTALK := $(ROOT_DIR)/flight/uavtalk
197 export OPUAVSYNTHDIR := $(BUILD_DIR)/uavobject-synthetics/flight
198 export OPGCSSYNTHDIR := $(BUILD_DIR)/openpilotgcs-synthetics
200 DIRS += $(OPGCSSYNTHDIR)
202 # Define supported board lists
203 ALL_BOARDS := oplinkmini revolution osd revoproto simposix discoveryf4bare gpsplatinum revonano
205 # Short names of each board (used to display board name in parallel builds)
206 oplinkmini_short := 'oplm'
207 revolution_short := 'revo'
208 osd_short := 'osd '
209 revoproto_short := 'revp'
210 revonano_short := 'revn'
211 simposix_short := 'posx'
212 discoveryf4bare_short := 'df4b'
213 gpsplatinum_short := 'gps9'
215 # SimPosix only builds on Linux so drop it from the list for
216 # all other platforms.
217 ifneq ($(UNAME), Linux)
218 ALL_BOARDS := $(filter-out simposix, $(ALL_BOARDS))
219 endif
221 # Start out assuming that we'll build fw, bl and bu for all boards
222 FW_BOARDS := $(ALL_BOARDS)
223 BL_BOARDS := $(ALL_BOARDS)
224 BU_BOARDS := $(ALL_BOARDS)
225 EF_BOARDS := $(ALL_BOARDS)
227 # SimPosix doesn't have a BL, BU or EF target so we need to
228 # filter them out to prevent errors on the all_flight target.
229 BL_BOARDS := $(filter-out simposix, $(BL_BOARDS))
230 BU_BOARDS := $(filter-out simposix gpsplatinum, $(BU_BOARDS))
231 EF_BOARDS := $(filter-out simposix, $(EF_BOARDS))
233 # Generate the targets for whatever boards are left in each list
234 FW_TARGETS := $(addprefix fw_, $(FW_BOARDS))
235 BL_TARGETS := $(addprefix bl_, $(BL_BOARDS))
236 BU_TARGETS := $(addprefix bu_, $(BU_BOARDS))
237 EF_TARGETS := $(addprefix ef_, $(EF_BOARDS))
239 # When building any of the "all_*" targets, tell all sub makefiles to display
240 # additional details on each line of output to describe which build and target
241 # that each line applies to. The same applies also to all, opfw_resource,
242 # package targets
243 ifneq ($(strip $(filter all_% all opfw_resource package,$(MAKECMDGOALS))),)
244 export ENABLE_MSG_EXTRA := yes
245 endif
247 # When building more than one goal in a single make invocation, also
248 # enable the extra context for each output line
249 ifneq ($(word 2,$(MAKECMDGOALS)),)
250 export ENABLE_MSG_EXTRA := yes
251 endif
253 # TEMPLATES (used to generate build rules)
255 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
256 # $(2) = Short name for board (e.g cc)
257 define FW_TEMPLATE
258 .PHONY: $(1) fw_$(1)
259 $(1): fw_$(1)_opfw
260 fw_$(1): fw_$(1)_opfw
262 fw_$(1)_%: uavobjects_flight
263 $(V1) $$(ARM_GCC_VERSION_CHECK_TEMPLATE)
264 $(V1) $(MKDIR) -p $(BUILD_DIR)/fw_$(1)/dep
265 $(V1) cd $(ROOT_DIR)/flight/targets/boards/$(1)/firmware && \
266 $$(MAKE) -r --no-print-directory \
267 BUILD_TYPE=fw \
268 BOARD_NAME=$(1) \
269 BOARD_SHORT_NAME=$(2) \
270 TOPDIR=$(ROOT_DIR)/flight/targets/boards/$(1)/firmware \
271 OUTDIR=$(BUILD_DIR)/fw_$(1) \
272 TARGET=fw_$(1) \
275 .PHONY: $(1)_clean
276 $(1)_clean: fw_$(1)_clean
277 fw_$(1)_clean:
278 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/fw_$(1))"
279 $(V1) $(RM) -fr $(BUILD_DIR)/fw_$(1)
280 endef
282 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
283 # $(2) = Short name for board (e.g cc)
284 define BL_TEMPLATE
285 .PHONY: bl_$(1)
286 bl_$(1): bl_$(1)_bin
287 bl_$(1)_bino: bl_$(1)_bin
289 bl_$(1)_%:
290 $(V1) $$(ARM_GCC_VERSION_CHECK_TEMPLATE)
291 $(V1) $(MKDIR) -p $(BUILD_DIR)/bl_$(1)/dep
292 $(V1) cd $(ROOT_DIR)/flight/targets/boards/$(1)/bootloader && \
293 $$(MAKE) -r --no-print-directory \
294 BUILD_TYPE=bl \
295 BOARD_NAME=$(1) \
296 BOARD_SHORT_NAME=$(2) \
297 TOPDIR=$(ROOT_DIR)/flight/targets/boards/$(1)/bootloader \
298 OUTDIR=$(BUILD_DIR)/bl_$(1) \
299 TARGET=bl_$(1) \
302 .PHONY: unbrick_$(1)
303 unbrick_$(1): bl_$(1)_hex
304 $(if $(filter-out undefined,$(origin UNBRICK_TTY)),
305 $(V0) @$(ECHO) " UNBRICK $(1) via $$(UNBRICK_TTY)"
306 $(V1) $(STM32FLASH_DIR)/stm32flash \
307 -w $(BUILD_DIR)/bl_$(1)/bl_$(1).hex \
308 -g 0x0 \
309 $$(UNBRICK_TTY)
311 $(V0) @$(ECHO)
312 $(V0) @$(ECHO) "ERROR: You must specify UNBRICK_TTY=<serial-device> to use for unbricking."
313 $(V0) @$(ECHO) " eg. $$(MAKE) $$@ UNBRICK_TTY=/dev/ttyUSB0"
316 .PHONY: bl_$(1)_clean
317 bl_$(1)_clean:
318 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/bl_$(1))"
319 $(V1) $(RM) -fr $(BUILD_DIR)/bl_$(1)
320 endef
322 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
323 # $(2) = Short name for board (e.g cc)
324 define BU_TEMPLATE
325 .PHONY: bu_$(1)
326 bu_$(1): bu_$(1)_opfw
328 bu_$(1)_%: bl_$(1)_bino
329 $(V1) $(MKDIR) -p $(BUILD_DIR)/bu_$(1)/dep
330 $(V1) cd $(ROOT_DIR)/flight/targets/common/bootloader_updater && \
331 $$(MAKE) -r --no-print-directory \
332 BUILD_TYPE=bu \
333 BOARD_NAME=$(1) \
334 BOARD_SHORT_NAME=$(2) \
335 TOPDIR=$(ROOT_DIR)/flight/targets/common/bootloader_updater \
336 OUTDIR=$(BUILD_DIR)/bu_$(1) \
337 TARGET=bu_$(1) \
340 .PHONY: bu_$(1)_clean
341 bu_$(1)_clean:
342 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/bu_$(1))"
343 $(V1) $(RM) -fr $(BUILD_DIR)/bu_$(1)
344 endef
346 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
347 # $(2) = Short name for board (e.g cc)
348 define EF_TEMPLATE
349 .PHONY: ef_$(1)
350 ef_$(1): ef_$(1)_bin
352 ef_$(1)_%: bl_$(1)_bin fw_$(1)_opfw
353 $(V1) $(MKDIR) -p $(BUILD_DIR)/ef_$(1)
354 $(V1) cd $(ROOT_DIR)/flight/targets/common/entire_flash && \
355 $$(MAKE) -r --no-print-directory \
356 BUILD_TYPE=ef \
357 BOARD_NAME=$(1) \
358 BOARD_SHORT_NAME=$(2) \
359 DFU_CMD="$(DFUUTIL_DIR)/bin/dfu-util" \
360 TOPDIR=$(ROOT_DIR)/flight/targets/common/entire_flash \
361 OUTDIR=$(BUILD_DIR)/ef_$(1) \
362 TARGET=ef_$(1) \
365 .PHONY: ef_$(1)_clean
366 ef_$(1)_clean:
367 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/ef_$(1))"
368 $(V1) $(RM) -fr $(BUILD_DIR)/ef_$(1)
369 endef
371 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
372 define BOARD_PHONY_TEMPLATE
373 .PHONY: all_$(1)
374 all_$(1): $$(filter fw_$(1), $$(FW_TARGETS))
375 all_$(1): $$(filter bl_$(1), $$(BL_TARGETS))
376 all_$(1): $$(filter bu_$(1), $$(BU_TARGETS))
377 all_$(1): $$(filter ef_$(1), $$(EF_TARGETS))
379 .PHONY: all_$(1)_clean
380 all_$(1)_clean: $$(addsuffix _clean, $$(filter fw_$(1), $$(FW_TARGETS)))
381 all_$(1)_clean: $$(addsuffix _clean, $$(filter bl_$(1), $$(BL_TARGETS)))
382 all_$(1)_clean: $$(addsuffix _clean, $$(filter bu_$(1), $$(BU_TARGETS)))
383 all_$(1)_clean: $$(addsuffix _clean, $$(filter ef_$(1), $$(EF_TARGETS)))
384 endef
386 # Generate flight build rules
387 .PHONY: all_fw all_fw_clean
388 all_fw: $(addsuffix _opfw, $(FW_TARGETS))
389 all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
391 .PHONY: all_bl all_bl_clean
392 all_bl: $(addsuffix _bin, $(BL_TARGETS))
393 all_bl_clean: $(addsuffix _clean, $(BL_TARGETS))
395 .PHONY: all_bu all_bu_clean
396 all_bu: $(addsuffix _opfw, $(BU_TARGETS))
397 all_bu_clean: $(addsuffix _clean, $(BU_TARGETS))
399 .PHONY: all_ef all_ef_clean
400 all_ef: $(EF_TARGETS)
401 all_ef_clean: $(addsuffix _clean, $(EF_TARGETS))
403 .PHONY: all_flight all_flight_clean
404 all_flight: all_fw all_bl all_bu all_ef
405 all_flight_clean: all_fw_clean all_bl_clean all_bu_clean all_ef_clean
407 # Expand the groups of targets for each board
408 $(foreach board, $(ALL_BOARDS), $(eval $(call BOARD_PHONY_TEMPLATE,$(board))))
410 # Expand the firmware rules
411 $(foreach board, $(ALL_BOARDS), $(eval $(call FW_TEMPLATE,$(board),$($(board)_short))))
413 # Expand the bootloader rules
414 $(foreach board, $(ALL_BOARDS), $(eval $(call BL_TEMPLATE,$(board),$($(board)_short))))
416 # Expand the bootloader updater rules
417 $(foreach board, $(ALL_BOARDS), $(eval $(call BU_TEMPLATE,$(board),$($(board)_short))))
419 # Expand the entire-flash rules
420 $(foreach board, $(ALL_BOARDS), $(eval $(call EF_TEMPLATE,$(board),$($(board)_short))))
422 .PHONY: sim_win32
423 sim_win32: sim_win32_exe
425 sim_win32_%: uavobjects_flight
426 $(V1) $(MKDIR) -p $(BUILD_DIR)/sitl_win32
427 $(V1) $(MAKE) --no-print-directory \
428 -C $(ROOT_DIR)/flight/targets/OpenPilot --file=$(ROOT_DIR)/flight/targets/OpenPilot/Makefile.win32 $*
430 .PHONY: sim_osx
431 sim_osx: sim_osx_elf
433 sim_osx_%: uavobjects_flight
434 $(V1) $(MKDIR) -p $(BUILD_DIR)/sim_osx
435 $(V1) $(MAKE) --no-print-directory \
436 -C $(ROOT_DIR)/flight/targets/SensorTest --file=$(ROOT_DIR)/flight/targets/SensorTest/Makefile.osx $*
438 ##############################
440 # GCS related components
442 ##############################
444 .PHONY: all_ground
445 all_ground: openpilotgcs uploader
447 # Convenience target for the GCS
448 .PHONY: gcs gcs_qmake gcs_clean
449 gcs: openpilotgcs
450 gcs_qmake: openpilotgcs_qmake
451 gcs_clean: openpilotgcs_clean
453 ifeq ($(V), 1)
454 GCS_SILENT :=
455 else
456 GCS_SILENT := silent
457 endif
459 OPENPILOTGCS_DIR := $(BUILD_DIR)/openpilotgcs_$(GCS_BUILD_CONF)
460 DIRS += $(OPENPILOTGCS_DIR)
462 OPENPILOTGCS_MAKEFILE := $(OPENPILOTGCS_DIR)/Makefile
464 .PHONY: openpilotgcs_qmake
465 openpilotgcs_qmake $(OPENPILOTGCS_MAKEFILE): | $(OPENPILOTGCS_DIR)
466 $(V1) cd $(OPENPILOTGCS_DIR) && \
467 $(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro \
468 -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS)
470 .PHONY: openpilotgcs
471 openpilotgcs: uavobjgenerator $(OPENPILOTGCS_MAKEFILE)
472 $(V1) $(MAKE) -w -C $(OPENPILOTGCS_DIR)/$(MAKE_DIR);
474 .PHONY: openpilotgcs_clean
475 openpilotgcs_clean:
476 @$(ECHO) " CLEAN $(call toprel, $(OPENPILOTGCS_DIR))"
477 $(V1) [ ! -d "$(OPENPILOTGCS_DIR)" ] || $(RM) -r "$(OPENPILOTGCS_DIR)"
481 ################################
483 # Serial Uploader tool
485 ################################
487 UPLOADER_DIR := $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)
488 DIRS += $(UPLOADER_DIR)
490 UPLOADER_MAKEFILE := $(UPLOADER_DIR)/Makefile
492 .PHONY: uploader_qmake
493 uploader_qmake $(UPLOADER_MAKEFILE): | $(UPLOADER_DIR)
494 $(V1) cd $(UPLOADER_DIR) && \
495 $(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/src/experimental/USB_UPLOAD_TOOL/upload.pro \
496 -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) CONFIG+=$(GCS_SILENT) $(GCS_QMAKE_OPTS)
498 .PHONY: uploader
499 uploader: $(UPLOADER_MAKEFILE)
500 $(V1) $(MAKE) -w -C $(UPLOADER_DIR)
502 .PHONY: uploader_clean
503 uploader_clean:
504 @$(ECHO) " CLEAN $(call toprel, $(UPLOADER_DIR))"
505 $(V1) [ ! -d "$(UPLOADER_DIR)" ] || $(RM) -r "$(UPLOADER_DIR)"
508 # We want to take snapshots of the UAVOs at each point that they change
509 # to allow the GCS to be compatible with as many versions as possible.
510 # We always include a pseudo collection called "srctree" which represents
511 # the UAVOs in the source tree. So not necessary to add current tree UAVO
512 # hash here, it is always included.
514 # Find the git hashes of each commit that changes uavobjects with:
515 # git log --format=%h -- shared/uavobjectdefinition/ | head -n 2
516 # List only UAVO hashes of past releases, do not list current hash.
517 # Past compatible versions are so far: RELEASE-12.10.2
518 UAVO_GIT_VERSIONS := 5e14f53
520 # All versions includes also the current source tree UAVO hash
521 UAVO_ALL_VERSIONS := $(UAVO_GIT_VERSIONS) srctree
523 # This is where the UAVO collections are stored
524 UAVO_COLLECTION_DIR := $(BUILD_DIR)/uavo-collections
526 # $(1) git hash of a UAVO snapshot
527 define UAVO_COLLECTION_GIT_TEMPLATE
529 # Make the output directory that will contain all of the synthetics for the
530 # uavo collection referenced by the git hash $(1)
531 $$(UAVO_COLLECTION_DIR)/$(1):
532 $$(V1) $(MKDIR) -p $$(UAVO_COLLECTION_DIR)/$(1)
534 # Extract the snapshot of shared/uavobjectdefinition from git hash $(1)
535 $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar: | $$(UAVO_COLLECTION_DIR)/$(1)
536 $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar:
537 $$(V0) @$(ECHO) " UAVOTAR $(1)"
538 $$(V1) $(GIT) archive $(1) -o $$@ -- shared/uavobjectdefinition/
540 # Extract the uavo xml files from our snapshot
541 $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar
542 $$(V0) @$(ECHO) " UAVOUNTAR $(1)"
543 $$(V1) $(RM) -rf $$@
544 $$(V1) $(MKDIR) -p $$@
545 $$(V1) $(TAR) -C $$(call toprel, $$@) -xf $$(call toprel, $$<) || $(RM) -rf $$@
546 endef
548 # Map the current working directory into the set of UAVO collections
549 $(UAVO_COLLECTION_DIR)/srctree:
550 $(V1) $(MKDIR) -p $@
552 $(UAVO_COLLECTION_DIR)/srctree/uavo-xml: | $(UAVO_COLLECTION_DIR)/srctree
553 $(UAVO_COLLECTION_DIR)/srctree/uavo-xml: $(UAVOBJ_XML_DIR)
554 $(V1) $(LN) -sf $(ROOT_DIR) $(UAVO_COLLECTION_DIR)/srctree/uavo-xml
556 # $(1) git hash (or symbolic name) of a UAVO snapshot
557 define UAVO_COLLECTION_BUILD_TEMPLATE
559 # This leaves us with a (broken) symlink that points to the full sha1sum of the collection
560 $$(UAVO_COLLECTION_DIR)/$(1)/uavohash: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml
561 # Compute the sha1 hash for this UAVO collection
562 # The sed bit truncates the UAVO hash to 16 hex digits
563 $$(V1) $$(VERSION_INFO) \
564 --uavodir=$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition \
565 --format='$$$${UAVO_HASH}' | \
566 $(SED) -e 's|\(................\).*|\1|' > $$@
568 $$(V0) @$(ECHO) " UAVOHASH $(1) ->" $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
570 # Generate the java uavobjects for this UAVO collection
571 $$(UAVO_COLLECTION_DIR)/$(1)/java-build/java: $$(UAVO_COLLECTION_DIR)/$(1)/uavohash
572 $$(V0) @$(ECHO) " UAVOJAVA $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
573 $$(V1) $(MKDIR) -p $$@
574 $$(V1) ( \
575 cd $$(UAVO_COLLECTION_DIR)/$(1)/java-build && \
576 $$(UAVOBJGENERATOR) -java $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition $$(ROOT_DIR) ; \
579 # Build a jar file for this UAVO collection
580 $$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: | $$(ANDROIDGCS_ASSETS_DIR)/uavos
581 $$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: $$(UAVO_COLLECTION_DIR)/$(1)/java-build/java
582 $$(V0) @$(ECHO) " UAVOJAR $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
583 $$(V1) ( \
584 HASH=$$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) && \
585 cd $$(UAVO_COLLECTION_DIR)/$(1)/java-build && \
586 $(JAVAC) java/*.java \
587 $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVDataObject.java \
588 $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVObject*.java \
589 $$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVMetaObject.java \
590 -d . && \
591 find ./org/openpilot/uavtalk/uavobjects -type f -name '*.class' > classlist.txt && \
592 $(JAR) cf tmp_uavobjects.jar @classlist.txt && \
593 $$(ANDROID_DX) \
594 --dex \
595 --output $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar \
596 tmp_uavobjects.jar && \
597 $(LN) -sf $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar uavobjects.jar \
600 endef
602 # One of these for each element of UAVO_GIT_VERSIONS so we can extract the UAVOs from git
603 $(foreach githash, $(UAVO_GIT_VERSIONS), $(eval $(call UAVO_COLLECTION_GIT_TEMPLATE,$(githash))))
605 # One of these for each UAVO_ALL_VERSIONS which includes the ones in the srctree
606 $(foreach githash, $(UAVO_ALL_VERSIONS), $(eval $(call UAVO_COLLECTION_BUILD_TEMPLATE,$(githash))))
608 .PHONY: uavo-collections_java
609 uavo-collections_java: $(foreach githash, $(UAVO_ALL_VERSIONS), $(UAVO_COLLECTION_DIR)/$(githash)/java-build/uavobjects.jar)
611 .PHONY: uavo-collections
612 uavo-collections: uavo-collections_java
614 .PHONY: uavo-collections_clean
615 uavo-collections_clean:
616 @$(ECHO) " CLEAN $(call toprel, $(UAVO_COLLECTION_DIR))"
617 $(V1) [ ! -d "$(UAVO_COLLECTION_DIR)" ] || $(RM) -r $(UAVO_COLLECTION_DIR)
619 ##############################
621 # Unit Tests
623 ##############################
625 ALL_UNITTESTS := logfs math lednotification
627 # Build the directory for the unit tests
628 UT_OUT_DIR := $(BUILD_DIR)/unit_tests
629 DIRS += $(UT_OUT_DIR)
631 .PHONY: all_ut
632 all_ut: $(addsuffix _elf, $(addprefix ut_, $(ALL_UNITTESTS)))
634 .PHONY: all_ut_xml
635 all_ut_xml: $(addsuffix _xml, $(addprefix ut_, $(ALL_UNITTESTS)))
637 .PHONY: all_ut_run
638 all_ut_run: $(addsuffix _run, $(addprefix ut_, $(ALL_UNITTESTS)))
640 .PHONY: all_ut_clean
641 all_ut_clean:
642 @$(ECHO) " CLEAN $(call toprel, $(UT_OUT_DIR))"
643 $(V1) [ ! -d "$(UT_OUT_DIR)" ] || $(RM) -r "$(UT_OUT_DIR)"
645 # $(1) = Unit test name
646 define UT_TEMPLATE
647 .PHONY: ut_$(1)
648 ut_$(1): ut_$(1)_run
650 ut_$(1)_%: $$(UT_OUT_DIR)
651 $(V1) $(MKDIR) -p $(UT_OUT_DIR)/$(1)
652 $(V1) cd $(ROOT_DIR)/flight/tests/$(1) && \
653 $$(MAKE) -r --no-print-directory \
654 BUILD_TYPE=ut \
655 BOARD_SHORT_NAME=$(1) \
656 TOPDIR=$(ROOT_DIR)/flight/tests/$(1) \
657 OUTDIR="$(UT_OUT_DIR)/$(1)" \
658 TARGET=$(1) \
661 .PHONY: ut_$(1)_clean
662 ut_$(1)_clean:
663 @$(ECHO) " CLEAN $(call toprel, $(UT_OUT_DIR)/$(1))"
664 $(V1) [ ! -d "$(UT_OUT_DIR)/$(1)" ] || $(RM) -r "$(UT_OUT_DIR)/$(1)"
665 endef
667 # Expand the unittest rules
668 $(foreach ut, $(ALL_UNITTESTS), $(eval $(call UT_TEMPLATE,$(ut))))
670 # Disable parallel make when the all_ut_run target is requested otherwise the TAP
671 # output is interleaved with the rest of the make output.
672 ifneq ($(strip $(filter all_ut_run,$(MAKECMDGOALS))),)
673 .NOTPARALLEL:
674 $(info $(EMPTY) NOTE Parallel make disabled by all_ut_run target so we have sane console output)
675 endif
677 ##############################
679 # Packaging components
681 ##############################
683 # Firmware files to package
684 PACKAGE_FW_EXCLUDE := fw_simposix $(if $(PACKAGE_FW_INCLUDE_DISCOVERYF4BARE),,fw_discoveryf4bare)
685 PACKAGE_FW_TARGETS := $(filter-out $(PACKAGE_FW_EXCLUDE), $(FW_TARGETS))
686 PACKAGE_ELF_TARGETS := $(filter fw_simposix, $(FW_TARGETS))
688 # Rules to generate GCS resources used to embed firmware binaries into the GCS.
689 # They are used later by the vehicle setup wizard to update board firmware.
690 # To open a firmware image use ":/firmware/fw_coptercontrol.opfw"
691 OPFW_RESOURCE := $(OPGCSSYNTHDIR)/opfw_resource.qrc
692 OPFW_RESOURCE_PREFIX := ../../
693 OPFW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(call toprel, $(BUILD_DIR)/$(fw_targ)/$(fw_targ).opfw))
694 OPFW_CONTENTS := \
695 <!DOCTYPE RCC><RCC version="1.0"> \
696 <qresource prefix="/firmware"> \
697 $(foreach fw_file, $(OPFW_FILES), <file alias="$(notdir $(fw_file))">$(OPFW_RESOURCE_PREFIX)$(fw_file)</file>) \
698 </qresource> \
699 </RCC>
701 .PHONY: opfw_resource
702 opfw_resource: $(OPFW_RESOURCE)
704 $(OPFW_RESOURCE): $(FW_TARGETS) | $(OPGCSSYNTHDIR)
705 @$(ECHO) Generating OPFW resource file $(call toprel, $@)
706 $(V1) $(ECHO) $(QUOTE)$(OPFW_CONTENTS)$(QUOTE) > $@
708 # If opfw_resource or all firmware are requested, GCS should depend on the resource
709 ifneq ($(strip $(filter opfw_resource all all_fw all_flight package,$(MAKECMDGOALS))),)
710 $(OPENPILOTGCS_MAKEFILE): $(OPFW_RESOURCE)
711 endif
713 # Packaging targets: package
714 # - builds all firmware, opfw_resource, gcs
715 # - copies firmware into a package directory
716 # - calls paltform-specific packaging script
718 # Define some variables
719 PACKAGE_LBL := $(shell $(VERSION_INFO) --format=\$${LABEL})
720 PACKAGE_NAME := OpenPilot
721 PACKAGE_SEP := -
722 PACKAGE_FULL_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(PACKAGE_LBL)
724 include $(ROOT_DIR)/package/$(UNAME).mk
726 # Source distribution is never dirty because it uses git archive
727 DIST_NAME := $(DIST_DIR)/$(subst dirty-,,$(PACKAGE_FULL_NAME)).tar
729 ##############################
731 # Source code formatting
733 ##############################
735 UNCRUSTIFY_TARGETS := flight ground
737 # $(1) = Uncrustify target (e.g flight or ground)
738 # $(2) = Target root directory
739 define UNCRUSTIFY_TEMPLATE
741 .PHONY: uncrustify_$(1)
742 uncrustify_$(1):
743 @$(ECHO) "Auto-formatting $(1) source code"
744 $(V1) UNCRUSTIFY_CONFIG="$(ROOT_DIR)/make/uncrustify/uncrustify.cfg" $(SHELL) make/scripts/uncrustify.sh $(call toprel, $(2))
745 endef
747 $(foreach uncrustify_targ, $(UNCRUSTIFY_TARGETS), $(eval $(call UNCRUSTIFY_TEMPLATE,$(uncrustify_targ),$(ROOT_DIR)/$(uncrustify_targ))))
749 .PHONY: uncrustify_all
750 uncrustify_all: $(addprefix uncrustify_,$(UNCRUSTIFY_TARGETS))
752 ##############################
754 # Doxygen documentation
756 # Each target should have own Doxyfile.$(target) with build directory build/docs/$(target),
757 # proper source directory (e.g. $(target)) and appropriate other doxygen options.
759 ##############################
761 DOCS_TARGETS := flight ground uavobjects
763 # $(1) = Doxygen target (e.g flight or ground)
764 define DOXYGEN_TEMPLATE
766 .PHONY: docs_$(1)
767 docs_$(1): docs_$(1)_clean
768 @$(ECHO) "Generating $(1) documentation"
769 $(V1) $(MKDIR) -p $(BUILD_DIR)/docs/$(1)
770 $(V1) $(DOXYGEN) $(ROOT_DIR)/make/doxygen/Doxyfile.$(1)
772 .PHONY: docs_$(1)_clean
773 docs_$(1)_clean:
774 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/docs/$(1))"
775 $(V1) [ ! -d "$(BUILD_DIR)/docs/$(1)" ] || $(RM) -r "$(BUILD_DIR)/docs/$(1)"
777 endef
779 $(foreach docs_targ, $(DOCS_TARGETS), $(eval $(call DOXYGEN_TEMPLATE,$(docs_targ))))
781 .PHONY: docs_all
782 docs_all: $(addprefix docs_,$(DOCS_TARGETS))
784 .PHONY: docs_all_clean
785 docs_all_clean:
786 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/docs)"
787 $(V1) [ ! -d "$(BUILD_DIR)/docs" ] || $(RM) -rf "$(BUILD_DIR)/docs"
789 ##############################
791 # Build info
793 ##############################
795 .PHONY: build-info
796 build-info: | $(BUILD_DIR)
797 @$(ECHO) " BUILD-INFO $(call toprel, $(BUILD_DIR)/$@.txt)"
798 $(V1) $(VERSION_INFO) \
799 --uavodir=$(ROOT_DIR)/shared/uavobjectdefinition \
800 --template="make/templates/$@.txt" \
801 --outfile="$(BUILD_DIR)/$@.txt"
803 ##############################
805 # Source for distribution
807 ##############################
809 DIST_VER_INFO := $(DIST_DIR)/version-info.json
811 $(DIST_VER_INFO): .git/index | $(DIST_DIR)
812 $(V1) $(VERSION_INFO) --jsonpath="$(DIST_DIR)"
815 $(DIST_NAME).gz: $(DIST_VER_INFO) .git/index | $(DIST_DIR)
816 @$(ECHO) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_NAME).gz)"
817 $(V1) git archive --prefix="$(PACKAGE_NAME)/" -o "$(DIST_NAME)" HEAD
818 $(V1) tar --append --file="$(DIST_NAME)" \
819 --transform='s,.*version-info.json,$(PACKAGE_NAME)/version-info.json,' \
820 $(call toprel, "$(DIST_VER_INFO)")
821 $(V1) gzip -f "$(DIST_NAME)"
823 .PHONY: dist
824 dist: $(DIST_NAME).gz
827 ##############################
829 # Directories
831 ##############################
833 $(DIRS):
834 $(V1) $(MKDIR) -p $@
837 ##############################
839 # Help message, the default Makefile goal
841 ##############################
843 .DEFAULT_GOAL := help
845 .PHONY: help
846 help:
847 @$(ECHO)
848 @$(ECHO) " This Makefile is known to work on Linux and Mac in a standard shell environment."
849 @$(ECHO) " It also works on Windows by following the instructions given on this wiki page:"
850 @$(ECHO) " http://wiki.openpilot.org/display/Doc/Windows%3A+Building+and+Packaging"
851 @$(ECHO)
852 @$(ECHO) " Here is a summary of the available targets:"
853 @$(ECHO)
854 @$(ECHO) " [Source tree preparation]"
855 @$(ECHO) " prepare - Install GIT commit message template"
856 @$(ECHO) " [Tool Installers]"
857 @$(ECHO) " arm_sdk_install - Install the GNU ARM gcc toolchain"
858 @$(ECHO) " qt_sdk_install - Install the QT development tools"
859 @$(ECHO) " nsis_install - Install the NSIS Unicode (Windows only)"
860 @$(ECHO) " sdl_install - Install the SDL library (Windows only)"
861 @$(ECHO) " mesawin_install - Install the OpenGL32 DLL (Windows only)"
862 @$(ECHO) " openssl_install - Install the OpenSSL libraries (Windows only)"
863 @$(ECHO) " uncrustify_install - Install the Uncrustify source code beautifier"
864 @$(ECHO) " doxygen_install - Install the Doxygen documentation generator"
865 @$(ECHO) " gtest_install - Install the GoogleTest framework"
866 @$(ECHO) " These targets are not updated yet and are probably broken:"
867 @$(ECHO) " openocd_install - Install the OpenOCD JTAG daemon"
868 @$(ECHO) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards"
869 @$(ECHO) " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards"
870 @$(ECHO) " Install all available tools:"
871 @$(ECHO) " all_sdk_install - Install all of above (platform-dependent)"
872 @$(ECHO) " build_sdk_install - Install only essential for build tools (platform-dependent)"
873 @$(ECHO)
874 @$(ECHO) " Other tool options are:"
875 @$(ECHO) " <tool>_version - Display <tool> version"
876 @$(ECHO) " <tool>_clean - Remove installed <tool>"
877 @$(ECHO) " <tool>_distclean - Remove downloaded <tool> distribution file(s)"
878 @$(ECHO)
879 @$(ECHO) " [Big Hammer]"
880 @$(ECHO) " all - Generate UAVObjects, build openpilot firmware and gcs"
881 @$(ECHO) " all_flight - Build all firmware, bootloaders and bootloader updaters"
882 @$(ECHO) " all_fw - Build only firmware for all boards"
883 @$(ECHO) " all_bl - Build only bootloaders for all boards"
884 @$(ECHO) " all_bu - Build only bootloader updaters for all boards"
885 @$(ECHO)
886 @$(ECHO) " all_clean - Remove your build directory ($(BUILD_DIR))"
887 @$(ECHO) " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
888 @$(ECHO) " all_fw_clean - Remove firmware for all boards"
889 @$(ECHO) " all_bl_clean - Remove bootloaders for all boards"
890 @$(ECHO) " all_bu_clean - Remove bootloader updaters for all boards"
891 @$(ECHO)
892 @$(ECHO) " all_<board> - Build all available images for <board>"
893 @$(ECHO) " all_<board>_clean - Remove all available images for <board>"
894 @$(ECHO)
895 @$(ECHO) " all_ut - Build all unit tests"
896 @$(ECHO) " all_ut_tap - Run all unit tests and capture all TAP output to files"
897 @$(ECHO) " all_ut_run - Run all unit tests and dump TAP output to console"
898 @$(ECHO)
899 @$(ECHO) " [Firmware]"
900 @$(ECHO) " <board> - Build firmware for <board>"
901 @$(ECHO) " Supported boards are ($(ALL_BOARDS))"
902 @$(ECHO) " fw_<board> - Build firmware for <board>"
903 @$(ECHO) " Supported boards are ($(FW_BOARDS))"
904 @$(ECHO) " fw_<board>_clean - Remove firmware for <board>"
905 @$(ECHO) " fw_<board>_program - Use OpenOCD + JTAG to write firmware to <board>"
906 @$(ECHO)
907 @$(ECHO) " [Bootloader]"
908 @$(ECHO) " bl_<board> - Build bootloader for <board>"
909 @$(ECHO) " Supported boards are ($(BL_BOARDS))"
910 @$(ECHO) " bl_<board>_clean - Remove bootloader for <board>"
911 @$(ECHO) " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
912 @$(ECHO)
913 @$(ECHO) " [Entire Flash]"
914 @$(ECHO) " ef_<board> - Build entire flash image for <board>"
915 @$(ECHO) " Supported boards are ($(EF_BOARDS))"
916 @$(ECHO) " ef_<board>_clean - Remove entire flash image for <board>"
917 @$(ECHO) " ef_<board>_program - Use OpenOCD + JTAG to write entire flash image to <board>"
918 @$(ECHO)
919 @$(ECHO) " [Bootloader Updater]"
920 @$(ECHO) " bu_<board> - Build bootloader updater for <board>"
921 @$(ECHO) " Supported boards are ($(BU_BOARDS))"
922 @$(ECHO) " bu_<board>_clean - Remove bootloader updater for <board>"
923 @$(ECHO)
924 @$(ECHO) " [Unbrick a board]"
925 @$(ECHO) " unbrick_<board> - Use the STM32's built in boot ROM to write a bootloader to <board>"
926 @$(ECHO) " Supported boards are ($(BL_BOARDS))"
927 @$(ECHO) " [Unittests]"
928 @$(ECHO) " ut_<test> - Build unit test <test>"
929 @$(ECHO) " ut_<test>_xml - Run test and capture XML output into a file"
930 @$(ECHO) " ut_<test>_run - Run test and dump output to console"
931 @$(ECHO)
932 @$(ECHO) " [Simulation]"
933 @$(ECHO) " sim_osx - Build OpenPilot simulation firmware for OSX"
934 @$(ECHO) " sim_osx_clean - Delete all build output for the osx simulation"
935 @$(ECHO) " sim_win32 - Build OpenPilot simulation firmware for Windows"
936 @$(ECHO) " using mingw and msys"
937 @$(ECHO) " sim_win32_clean - Delete all build output for the win32 simulation"
938 @$(ECHO)
939 @$(ECHO) " [GCS]"
940 @$(ECHO) " gcs - Build the Ground Control System (GCS) application (debug|release)"
941 @$(ECHO) " Compile specific directory: MAKE_DIR=<dir>"
942 @$(ECHO) " Example: make gcs MAKE_DIR=src/plugins/coreplugin"
943 @$(ECHO) " gcs_qmake - Run qmake for the Ground Control System (GCS) application (debug|release)"
944 @$(ECHO) " gcs_clean - Remove the Ground Control System (GCS) application (debug|release)"
945 @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
946 @$(ECHO)
947 @$(ECHO) " [Uploader Tool]"
948 @$(ECHO) " uploader - Build the serial uploader tool (debug|release)"
949 @$(ECHO) " uploader_qmake - Run qmake for the serial uploader tool (debug|release)"
950 @$(ECHO) " uploader_clean - Remove the serial uploader tool (debug|release)"
951 @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
952 @$(ECHO)
953 @$(ECHO)
954 @$(ECHO) " [UAVObjects]"
955 @$(ECHO) " uavobjects - Generate source files from the UAVObject definition XML files"
956 @$(ECHO) " uavobjects_test - Parse xml-files - check for valid, duplicate ObjId's, ..."
957 @$(ECHO) " uavobjects_<group> - Generate source files from a subset of the UAVObject definition XML files"
958 @$(ECHO) " Supported groups are ($(UAVOBJ_TARGETS))"
959 @$(ECHO)
960 @$(ECHO) " [Packaging]"
961 @$(ECHO) " package - Build and package the OpenPilot platform-dependent package (no clean)"
962 @$(ECHO) " opfw_resource - Generate resources to embed firmware binaries into the GCS"
963 @$(ECHO) " dist - Generate source archive for distribution"
964 @$(ECHO) " install - Install GCS to \"DESTDIR\" with prefix \"prefix\" (Linux only)"
965 @$(ECHO)
966 @$(ECHO) " [Code Formatting]"
967 @$(ECHO) " uncrustify_<source> - Reformat <source> code according to the project's standards"
968 @$(ECHO) " Supported sources are ($(UNCRUSTIFY_TARGETS))"
969 @$(ECHO) " uncrustify_all - Reformat all source code"
970 @$(ECHO)
971 @$(ECHO) " [Code Documentation]"
972 @$(ECHO) " docs_<source> - Generate HTML documentation for <source>"
973 @$(ECHO) " Supported sources are ($(DOCS_TARGETS))"
974 @$(ECHO) " docs_all - Generate HTML documentation for all"
975 @$(ECHO) " docs_<source>_clean - Delete generated documentation for <source>"
976 @$(ECHO) " docs_all_clean - Delete all generated documentation"
977 @$(ECHO)
978 @$(ECHO) " Hint: Add V=1 to your command line to see verbose build output."
979 @$(ECHO)
980 @$(ECHO) " Notes: All tool distribution files will be downloaded into $(DL_DIR)"
981 @$(ECHO) " All tools will be installed into $(TOOLS_DIR)"
982 @$(ECHO) " All build output will be placed in $(BUILD_DIR)"
983 @$(ECHO)
984 @$(ECHO) " Tool download and install directories can be changed using environment variables:"
985 @$(ECHO) " OPENPILOT_DL_DIR full path to downloads directory [downloads if not set]"
986 @$(ECHO) " OPENPILOT_TOOLS_DIR full path to installed tools directory [tools if not set]"
987 @$(ECHO) " More info: http://wiki.openpilot.org/display/Doc/OpenPilot+Build+System+Overview"
988 @$(ECHO)