LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / Makefile
blob21c7b55ebd08f0453331c77187a1cc8fdc7e755d
2 # Top level Makefile for the LibrePilot Project build system.
3 # Copyright (c) 2015, The LibrePilot Project, http://www.librepilot.org
4 # Copyright (c) 2010-2013, The OpenPilot Team, http://www.openpilot.org
5 # Use 'make help' for instructions.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # This top level Makefile passes down some variables to sub-makes through
23 # the environment. They are explicitly exported using the export keyword.
24 # Lower level makefiles assume that these variables are defined. To ensure
25 # that a special magic variable is exported here. It must be checked for
26 # existance by each sub-make.
27 export TOP_LEVEL_MAKEFILE := TRUE
29 # The root directory that this makefile resides in
30 export ROOT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
32 # Include some helper functions
33 include $(ROOT_DIR)/make/functions.mk
35 # This file can be used to override default options using the "override" keyword
36 CONFIG_FILE := config
37 -include $(CONFIG_FILE)
39 ##############################
40 # It is possible to set DL_DIR and/or TOOLS_DIR environment
41 # variables to override local tools download and installation directorys. So the
42 # same toolchains can be used for all working copies. Particularly useful for CI
43 # server build agents, but also for local installations.
44 override DL_DIR := $(if $(DL_DIR),$(call slashfix,$(DL_DIR)),$(ROOT_DIR)/downloads)
45 override TOOLS_DIR := $(if $(TOOLS_DIR),$(call slashfix,$(TOOLS_DIR)),$(ROOT_DIR)/tools)
46 export DL_DIR
47 export TOOLS_DIR
49 # Set up some macros for common directories within the tree
50 export BUILD_DIR := $(CURDIR)/build
51 export PACKAGE_DIR := $(BUILD_DIR)/package
52 export DIST_DIR := $(BUILD_DIR)/dist
53 export OPGCSSYNTHDIR := $(BUILD_DIR)/gcs-synthetics
55 DIRS := $(DL_DIR) $(TOOLS_DIR) $(BUILD_DIR) $(PACKAGE_DIR) $(DIST_DIR) $(OPGCSSYNTHDIR)
57 # Naming for binaries and packaging etc,.
58 export ORG_BIG_NAME := LibrePilot
59 GCS_LABEL := GCS
60 GCS_BIG_NAME := $(ORG_BIG_NAME) $(GCS_LABEL)
61 # These should be lowercase with no spaces
62 export ORG_SMALL_NAME := $(call smallify,$(ORG_BIG_NAME))
63 GCS_SMALL_NAME := $(call smallify,$(GCS_BIG_NAME))
65 WEBSITE_URL := http://librepilot.org
66 GIT_URL := https://bitbucket.org/librepilot/librepilot.git
67 GITWEB_URL := https://bitbucket.org/librepilot/librepilot
68 # Change this once the DNS is set to http://wiki.librepilot.org/
69 WIKI_URL_ROOT := https://librepilot.atlassian.net/wiki/display/LPDOC/
70 USAGETRACKER_URL := https://usagetracker.librepilot.org/
72 PACKAGING_EMAIL_ADDRESS := packaging@librepilot.org
74 define DESCRIPTION_SHORT :=
75 A ground control station and firmware for UAV flight controllers
76 endef
78 define DESCRIPTION_LONG :=
79 The LibrePilot open source project was founded in July 2015.
80 It focuses on research and development of software and hardware to be used in a variety of applications including vehicle control and stabilization, unmanned autonomous vehicles and robotics.
81 One of the project's primary goals is to provide an open and collaborative environment making it the ideal home for development of innovative ideas.
82 endef
85 # Clean out undesirable variables from the environment and command-line
86 # to remove the chance that they will cause problems with our build
87 define SANITIZE_VAR
88 $(if $(filter-out undefined,$(origin $(1))),
89 $(info $(EMPTY) NOTE Sanitized $(2) variable '$(1)' from $(origin $(1)))
90 MAKEOVERRIDES = $(filter-out $(1)=%,$(MAKEOVERRIDES))
91 override $(1) :=
92 unexport $(1)
94 endef
96 # These specific variables can influence compilation in unexpected (and undesirable) ways
97 # gcc flags
98 SANITIZE_GCC_VARS := TMPDIR GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH
99 # preprocessor flags
100 SANITIZE_GCC_VARS += CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH DEPENDENCIES_OUTPUT
101 # make flags
102 SANITIZE_GCC_VARS += CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LDLIBS
103 $(foreach var, $(SANITIZE_GCC_VARS), $(eval $(call SANITIZE_VAR,$(var),disallowed)))
105 # These specific variables used to be valid but now they make no sense
106 SANITIZE_DEPRECATED_VARS := USE_BOOTLOADER CLEAN_BUILD
107 $(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),deprecated)))
109 # Make sure this isn't being run as root unless installing (no whoami on Windows, but that is ok here)
110 ifeq ($(shell whoami 2>/dev/null),root)
111 ifeq ($(filter install uninstall,$(MAKECMDGOALS)),)
112 ifndef FAKEROOTKEY
113 $(error You should not be running this as root)
114 endif
115 endif
116 endif
118 # Decide on a verbosity level based on the V= parameter
119 export AT := @
120 ifndef V
121 export V0 :=
122 export V1 := $(AT)
123 else ifeq ($(V), 0)
124 export V0 := $(AT)
125 export V1 := $(AT)
126 else ifeq ($(V), 1)
127 endif
129 ARCH := $(call get_arch)
131 # Include tools installers
132 include $(ROOT_DIR)/make/tools.mk
134 # Include third party builders if available
135 -include $(ROOT_DIR)/make/3rdparty/3rdparty.mk
137 # We almost need to consider autoconf/automake instead of this
138 ifeq ($(UNAME), Linux)
139 UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
140 else ifeq ($(UNAME), Darwin)
141 UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator
142 else ifeq ($(UNAME), Windows)
143 UAVOBJGENERATOR := $(BUILD_DIR)/uavobjgenerator/uavobjgenerator.exe
144 endif
146 export UAVOBJGENERATOR
148 # Set up default build configurations (debug | release)
149 GCS_BUILD_CONF := release
151 # Set extra configuration
152 GCS_EXTRA_CONF += osg copy_osg
153 ifeq ($(UNAME), Windows)
154 GCS_EXTRA_CONF += osgearth
155 endif
157 ##############################
159 # All targets
161 ##############################
163 .PHONY: all
164 all: uavobjects all_ground all_flight
166 .PHONY: all_clean
167 all_clean:
168 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR))"
169 $(V1) [ ! -d "$(BUILD_DIR)" ] || $(RM) -rf "$(BUILD_DIR)"
171 .PHONY: clean
172 clean: all_clean
175 ##############################
177 # UAVObjects
179 ##############################
181 UAVOBJGENERATOR_DIR := $(BUILD_DIR)/uavobjgenerator
182 DIRS += $(UAVOBJGENERATOR_DIR)
184 .PHONY: uavobjgenerator
185 uavobjgenerator: $(UAVOBJGENERATOR)
187 $(UAVOBJGENERATOR): | $(UAVOBJGENERATOR_DIR)
188 $(V1) cd $(UAVOBJGENERATOR_DIR) && \
189 ( [ -f Makefile ] || $(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro \
190 CONFIG+='$(GCS_BUILD_CONF) $(GCS_EXTRA_CONF)' ) && \
191 $(MAKE) --no-print-directory -w
193 UAVOBJ_TARGETS := gcs flight python matlab java wireshark
195 .PHONY: uavobjects
196 uavobjects: $(addprefix uavobjects_, $(UAVOBJ_TARGETS))
198 UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
199 UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
201 uavobjects_%: $(UAVOBJGENERATOR)
202 @$(MKDIR) -p $(UAVOBJ_OUT_DIR)/$*
203 $(V1) ( cd $(UAVOBJ_OUT_DIR)/$* && \
204 $(UAVOBJGENERATOR) -$* $(UAVOBJ_XML_DIR) $(ROOT_DIR) ; \
207 uavobjects_test: $(UAVOBJGENERATOR)
208 $(V1) $(UAVOBJGENERATOR) -v $(UAVOBJ_XML_DIR) $(ROOT_DIR)
210 uavobjects_clean:
211 @$(ECHO) " CLEAN $(call toprel, $(UAVOBJ_OUT_DIR))"
212 $(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)"
214 ##############################
216 # Flight related components
218 ##############################
221 # When building any of the "all_*" targets, tell all sub makefiles to display
222 # additional details on each line of output to describe which build and target
223 # that each line applies to. The same applies also to all, opfw_resource,
224 # package targets
225 ifneq ($(strip $(filter all_% all opfw_resource package,$(MAKECMDGOALS))),)
226 export ENABLE_MSG_EXTRA := yes
227 endif
229 # When building more than one goal in a single make invocation, also
230 # enable the extra context for each output line
231 ifneq ($(word 2,$(MAKECMDGOALS)),)
232 export ENABLE_MSG_EXTRA := yes
233 endif
235 FLIGHT_OUT_DIR := $(BUILD_DIR)/firmware
236 DIRS += $(FLIGHT_OUT_DIR)
238 include $(ROOT_DIR)/flight/Makefile
240 ##############################
242 # GCS related components
244 ##############################
246 .PHONY: all_ground
247 all_ground: gcs uploader
249 ifneq ($(V), 1)
250 GCS_EXTRA_CONF += silent
251 endif
253 GCS_DIR := $(BUILD_DIR)/$(GCS_SMALL_NAME)_$(GCS_BUILD_CONF)
254 DIRS += $(GCS_DIR)
256 GCS_MAKEFILE := $(GCS_DIR)/Makefile
258 .PHONY: gcs_qmake
259 gcs_qmake $(GCS_MAKEFILE): | $(GCS_DIR)
260 $(V1) cd $(GCS_DIR) && \
261 $(QMAKE) $(ROOT_DIR)/ground/gcs/gcs.pro \
262 -r CONFIG+='$(GCS_BUILD_CONF) $(GCS_EXTRA_CONF)' \
263 'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME=$(GCS_SMALL_NAME) \
264 'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME=$(ORG_SMALL_NAME) \
265 'WIKI_URL_ROOT="$(WIKI_URL_ROOT)"' \
266 'USAGETRACKER_URL="$(USAGETRACKER_URL)"' \
267 'GCS_LIBRARY_BASENAME=$(libbasename)' \
268 $(GCS_QMAKE_OPTS)
270 .PHONY: gcs
271 gcs: $(UAVOBJGENERATOR) $(GCS_MAKEFILE)
272 $(V1) $(MAKE) -w -C $(GCS_DIR)/$(MAKE_DIR);
274 .PHONY: gcs_clean
275 gcs_clean:
276 @$(ECHO) " CLEAN $(call toprel, $(GCS_DIR))"
277 $(V1) [ ! -d "$(GCS_DIR)" ] || $(RM) -r "$(GCS_DIR)"
281 ################################
283 # Serial Uploader tool
285 ################################
287 UPLOADER_DIR := $(BUILD_DIR)/uploader_$(GCS_BUILD_CONF)
288 DIRS += $(UPLOADER_DIR)
290 UPLOADER_MAKEFILE := $(UPLOADER_DIR)/Makefile
292 .PHONY: uploader_qmake
293 uploader_qmake $(UPLOADER_MAKEFILE): | $(UPLOADER_DIR)
294 $(V1) cd $(UPLOADER_DIR) && \
295 $(QMAKE) $(ROOT_DIR)/ground/gcs/src/experimental/USB_UPLOAD_TOOL/upload.pro \
296 -r CONFIG+='$(GCS_BUILD_CONF) $(GCS_EXTRA_CONF)' $(GCS_QMAKE_OPTS)
298 .PHONY: uploader
299 uploader: $(UPLOADER_MAKEFILE)
300 $(V1) $(MAKE) -w -C $(UPLOADER_DIR)
302 .PHONY: uploader_clean
303 uploader_clean:
304 @$(ECHO) " CLEAN $(call toprel, $(UPLOADER_DIR))"
305 $(V1) [ ! -d "$(UPLOADER_DIR)" ] || $(RM) -r "$(UPLOADER_DIR)"
309 ##############################
311 # Packaging components
313 ##############################
314 # Firmware files to package
315 PACKAGE_FW_TARGETS := fw_coptercontrol fw_oplinkmini fw_revolution fw_osd fw_revoproto fw_gpsplatinum fw_revonano
317 # Rules to generate GCS resources used to embed firmware binaries into the GCS.
318 # They are used later by the vehicle setup wizard to update board firmware.
319 # To open a firmware image use ":/firmware/fw_coptercontrol.opfw"
320 OPFW_RESOURCE := $(OPGCSSYNTHDIR)/opfw_resource.qrc
322 ifeq ($(WITH_PREBUILT_FW),)
323 FIRMWARE_DIR := $(FLIGHT_OUT_DIR)
324 # We need to build the FW targets
325 $(OPFW_RESOURCE): $(PACKAGE_FW_TARGETS)
326 else
327 FIRMWARE_DIR := $(WITH_PREBUILT_FW)
328 endif
330 OPFW_FILES := $(foreach fw_targ, $(PACKAGE_FW_TARGETS), $(FIRMWARE_DIR)/$(fw_targ)/$(fw_targ).opfw)
331 OPFW_CONTENTS := \
332 <!DOCTYPE RCC><RCC version="1.0"> \
333 <qresource prefix="/firmware"> \
334 $(foreach fw_file, $(OPFW_FILES), <file alias="$(notdir $(fw_file))">$(call system_path,$(fw_file))</file>) \
335 </qresource> \
336 </RCC>
338 .PHONY: opfw_resource
339 opfw_resource: $(OPFW_RESOURCE)
341 $(OPFW_RESOURCE): | $(OPGCSSYNTHDIR)
342 @$(ECHO) Generating OPFW resource file $(call toprel, $@)
343 $(V1) $(ECHO) $(QUOTE)$(OPFW_CONTENTS)$(QUOTE) > $@
345 # If opfw_resource or all firmware are requested, GCS should depend on the resource
346 ifneq ($(strip $(filter opfw_resource all all_fw all_flight package,$(MAKECMDGOALS))),)
347 $(GCS_MAKEFILE): $(OPFW_RESOURCE)
348 endif
350 # Packaging targets: package
351 # - builds all firmware, opfw_resource, gcs
352 # - copies firmware into a package directory
353 # - calls paltform-specific packaging script
355 # Define some variables
356 PACKAGE_LBL := $(shell $(VERSION_INFO) --format=\$${LABEL})
357 PACKAGE_NAME := $(subst $(SPACE),,$(ORG_BIG_NAME))
358 PACKAGE_SEP := -
359 PACKAGE_FULL_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(PACKAGE_LBL)
361 # Source distribution is never dirty because it uses git archive
362 DIST_LBL := $(subst -dirty,,$(PACKAGE_LBL))
363 DIST_NAME := $(PACKAGE_NAME)$(PACKAGE_SEP)$(DIST_LBL)
364 DIST_TAR := $(DIST_DIR)/$(DIST_NAME).tar
365 DIST_TAR_GZ := $(DIST_TAR).gz
366 FW_DIST_NAME := $(DIST_NAME)_firmware
367 FW_DIST_TAR := $(DIST_DIR)/$(FW_DIST_NAME).tar
368 FW_DIST_TAR_GZ := $(FW_DIST_TAR).gz
369 DIST_VER_INFO := $(DIST_DIR)/version-info.json
371 include $(ROOT_DIR)/package/$(UNAME).mk
373 ##############################
375 # Source for distribution
377 ##############################
378 $(DIST_VER_INFO): .git/index | $(DIST_DIR)
379 $(V1) $(VERSION_INFO) --jsonpath="$(DIST_DIR)"
381 $(DIST_TAR): $(DIST_VER_INFO) .git/index | $(DIST_DIR)
382 @$(ECHO) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_TAR))"
383 $(V1) git archive --prefix="$(PACKAGE_NAME)/" -o "$(DIST_TAR)" HEAD
384 $(V1) tar --append --file="$(DIST_TAR)" \
385 --transform='s,.*version-info.json,$(PACKAGE_NAME)/version-info.json,' \
386 $(call toprel, "$(DIST_VER_INFO)")
388 $(DIST_TAR_GZ): $(DIST_TAR)
389 @$(ECHO) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_TAR_GZ))"
390 $(V1) gzip -kf "$(DIST_TAR)"
392 .PHONY: dist_tar_gz
393 dist_tar_gz: $(DIST_TAR_GZ)
395 .PHONY: dist
396 dist: dist_tar_gz
399 $(FW_DIST_TAR): $(PACKAGE_FW_TARGETS) | $(DIST_DIR)
400 @$(ECHO) " FIRMWARE FOR DISTRIBUTION $(call toprel, $(FW_DIST_TAR))"
401 $(V1) tar -c --file="$(FW_DIST_TAR)" --directory=$(FLIGHT_OUT_DIR) \
402 --transform='s,^,firmware/,' \
403 $(foreach fw_targ,$(PACKAGE_FW_TARGETS),$(fw_targ)/$(fw_targ).opfw)
405 $(FW_DIST_TAR_GZ): $(FW_DIST_TAR)
406 @$(ECHO) " FIRMWARE FOR DISTRIBUTION $(call toprel, $(FW_DIST_TAR_GZ))"
407 $(V1) gzip -kf "$(FW_DIST_TAR)"
409 .PHONY: fw_dist_tar_gz
410 fw_dist_tar_gz: $(FW_DIST_TAR_GZ)
412 .PHONY: fw_dist
413 fw_dist: fw_dist_tar_gz
416 ##############################
418 # Source code formatting
420 ##############################
422 UNCRUSTIFY_TARGETS := flight ground
424 # $(1) = Uncrustify target (e.g flight or ground)
425 # $(2) = Target root directory
426 define UNCRUSTIFY_TEMPLATE
428 .PHONY: uncrustify_$(1)
429 uncrustify_$(1):
430 @$(ECHO) "Auto-formatting $(1) source code"
431 $(V1) UNCRUSTIFY_CONFIG="$(ROOT_DIR)/make/uncrustify/uncrustify.cfg" $(SHELL) make/scripts/uncrustify.sh $(call toprel, $(2))
432 endef
434 $(foreach uncrustify_targ, $(UNCRUSTIFY_TARGETS), $(eval $(call UNCRUSTIFY_TEMPLATE,$(uncrustify_targ),$(ROOT_DIR)/$(uncrustify_targ))))
436 .PHONY: uncrustify_all
437 uncrustify_all: $(addprefix uncrustify_,$(UNCRUSTIFY_TARGETS))
439 ##############################
441 # Doxygen documentation
443 # Each target should have own Doxyfile.$(target) with build directory build/docs/$(target),
444 # proper source directory (e.g. $(target)) and appropriate other doxygen options.
446 ##############################
448 DOCS_TARGETS := flight ground uavobjects
450 # $(1) = Doxygen target (e.g flight or ground)
451 define DOXYGEN_TEMPLATE
453 .PHONY: docs_$(1)
454 docs_$(1): docs_$(1)_clean
455 @$(ECHO) "Generating $(1) documentation"
456 $(V1) $(MKDIR) -p $(BUILD_DIR)/docs/$(1)
457 $(V1) $(DOXYGEN) $(ROOT_DIR)/make/doxygen/Doxyfile.$(1)
459 .PHONY: docs_$(1)_clean
460 docs_$(1)_clean:
461 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/docs/$(1))"
462 $(V1) [ ! -d "$(BUILD_DIR)/docs/$(1)" ] || $(RM) -r "$(BUILD_DIR)/docs/$(1)"
464 endef
466 $(foreach docs_targ, $(DOCS_TARGETS), $(eval $(call DOXYGEN_TEMPLATE,$(docs_targ))))
468 .PHONY: docs_all
469 docs_all: $(addprefix docs_,$(DOCS_TARGETS))
471 .PHONY: docs_all_clean
472 docs_all_clean:
473 @$(ECHO) " CLEAN $(call toprel, $(BUILD_DIR)/docs)"
474 $(V1) [ ! -d "$(BUILD_DIR)/docs" ] || $(RM) -rf "$(BUILD_DIR)/docs"
476 ##############################
478 # Build info
480 ##############################
482 .PHONY: build-info
483 build-info: | $(BUILD_DIR)
484 @$(ECHO) " BUILD-INFO $(call toprel, $(BUILD_DIR)/$@.txt)"
485 $(V1) $(VERSION_INFO) \
486 --uavodir=$(ROOT_DIR)/shared/uavobjectdefinition \
487 --template="make/templates/$@.txt" \
488 --outfile="$(BUILD_DIR)/$@.txt"
490 ##############################
492 # Config
494 ##############################
496 CONFIG_OPTS := $(addsuffix \n,$(MAKEOVERRIDES))
497 CONFIG_OPTS := $(addprefix override$(SPACE),$(CONFIG_OPTS))
499 .PHONY: config_new
500 config_new:
501 @printf '$(CONFIG_OPTS)' > $(CONFIG_FILE)
503 .PHONY: config_append
504 config_append:
505 @printf '$(CONFIG_OPTS)' >> $(CONFIG_FILE)
507 .PHONY: config_show
508 config_show:
509 @cat $(CONFIG_FILE)
511 .PHONY: config_clean
512 config_clean:
513 rm -f $(CONFIG_FILE)
516 ##############################
518 # Directories
520 ##############################
522 $(DIRS):
523 $(V1) $(MKDIR) -p $@
526 ##############################
528 # Help message, the default Makefile goal
530 ##############################
532 .DEFAULT_GOAL := help
534 .PHONY: help
535 help:
536 @$(ECHO)
537 @$(ECHO) " This Makefile is known to work on Linux and Mac in a standard shell environment."
538 @$(ECHO) " It also works on Windows by following the instructions given on this wiki page:"
539 @$(ECHO) " $(WIKI_ROOT_URL)Windows+Building+and+Packaging"
540 @$(ECHO)
541 @$(ECHO) " Here is a summary of the available targets:"
542 @$(ECHO)
543 @$(ECHO) " [Source tree preparation]"
544 @$(ECHO) " prepare - Install GIT commit message template"
545 @$(ECHO) " [Tool Installers]"
546 @$(ECHO) " arm_sdk_install - Install the GNU ARM gcc toolchain"
547 @$(ECHO) " qt_sdk_install - Install the QT development tools"
548 @$(ECHO) " nsis_install - Install the NSIS Unicode (Windows only)"
549 @$(ECHO) " mesawin_install - Install the OpenGL32 DLL (Windows only)"
550 @$(ECHO) " uncrustify_install - Install the Uncrustify source code beautifier"
551 @$(ECHO) " doxygen_install - Install the Doxygen documentation generator"
552 @$(ECHO) " gtest_install - Install the GoogleTest framework"
553 @$(ECHO) " ccache_install - Install ccache"
554 @$(ECHO) " These targets are not updated yet and are probably broken:"
555 @$(ECHO) " openocd_install - Install the OpenOCD JTAG daemon"
556 @$(ECHO) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards"
557 @$(ECHO) " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards"
558 @$(ECHO) " Install all available tools:"
559 @$(ECHO) " all_sdk_install - Install all of above (platform-dependent)"
560 @$(ECHO) " build_sdk_install - Install only essential for build tools (platform-dependent)"
561 @$(ECHO)
562 @$(ECHO) " Other tool options are:"
563 @$(ECHO) " <tool>_version - Display <tool> version"
564 @$(ECHO) " <tool>_clean - Remove installed <tool>"
565 @$(ECHO) " <tool>_distclean - Remove downloaded <tool> distribution file(s)"
566 @$(ECHO)
567 @$(ECHO) " [Big Hammer]"
568 @$(ECHO) " all - Generate UAVObjects, build $(ORG_BIG_NAME) firmware and gcs"
569 @$(ECHO) " all_flight - Build all firmware, bootloaders and bootloader updaters"
570 @$(ECHO) " all_fw - Build only firmware for all boards"
571 @$(ECHO) " all_bl - Build only bootloaders for all boards"
572 @$(ECHO) " all_bu - Build only bootloader updaters for all boards"
573 @$(ECHO)
574 @$(ECHO) " all_clean - Remove your build directory ($(BUILD_DIR))"
575 @$(ECHO) " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
576 @$(ECHO) " all_fw_clean - Remove firmware for all boards"
577 @$(ECHO) " all_bl_clean - Remove bootloaders for all boards"
578 @$(ECHO) " all_bu_clean - Remove bootloader updaters for all boards"
579 @$(ECHO)
580 @$(ECHO) " all_<board> - Build all available images for <board>"
581 @$(ECHO) " all_<board>_clean - Remove all available images for <board>"
582 @$(ECHO)
583 @$(ECHO) " all_ut - Build all unit tests"
584 @$(ECHO) " all_ut_tap - Run all unit tests and capture all TAP output to files"
585 @$(ECHO) " all_ut_run - Run all unit tests and dump TAP output to console"
586 @$(ECHO)
587 @$(ECHO) " [Firmware]"
588 @$(ECHO) " <board> - Build firmware for <board>"
589 @$(ECHO) " Supported boards are ($(ALL_BOARDS))"
590 @$(ECHO) " fw_<board> - Build firmware for <board>"
591 @$(ECHO) " Supported boards are ($(FW_BOARDS))"
592 @$(ECHO) " fw_<board>_clean - Remove firmware for <board>"
593 @$(ECHO) " fw_<board>_program - Use OpenOCD + JTAG to write firmware to <board>"
594 @$(ECHO)
595 @$(ECHO) " [Bootloader]"
596 @$(ECHO) " bl_<board> - Build bootloader for <board>"
597 @$(ECHO) " Supported boards are ($(BL_BOARDS))"
598 @$(ECHO) " bl_<board>_clean - Remove bootloader for <board>"
599 @$(ECHO) " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
600 @$(ECHO)
601 @$(ECHO) " [Entire Flash]"
602 @$(ECHO) " ef_<board> - Build entire flash image for <board>"
603 @$(ECHO) " Supported boards are ($(EF_BOARDS))"
604 @$(ECHO) " ef_<board>_clean - Remove entire flash image for <board>"
605 @$(ECHO) " ef_<board>_program - Use OpenOCD + JTAG to write entire flash image to <board>"
606 @$(ECHO)
607 @$(ECHO) " [Bootloader Updater]"
608 @$(ECHO) " bu_<board> - Build bootloader updater for <board>"
609 @$(ECHO) " Supported boards are ($(BU_BOARDS))"
610 @$(ECHO) " bu_<board>_clean - Remove bootloader updater for <board>"
611 @$(ECHO)
612 @$(ECHO) " [Unbrick a board]"
613 @$(ECHO) " unbrick_<board> - Use the STM32's built in boot ROM to write a bootloader to <board>"
614 @$(ECHO) " Supported boards are ($(BL_BOARDS))"
615 @$(ECHO) " [Unittests]"
616 @$(ECHO) " ut_<test> - Build unit test <test>"
617 @$(ECHO) " ut_<test>_xml - Run test and capture XML output into a file"
618 @$(ECHO) " ut_<test>_run - Run test and dump output to console"
619 @$(ECHO)
620 @$(ECHO) " [Simulation]"
621 @$(ECHO) " sim_osx - Build $(ORG_BIG_NAME) simulation firmware for OSX"
622 @$(ECHO) " sim_osx_clean - Delete all build output for the osx simulation"
623 @$(ECHO) " sim_win32 - Build $(ORG_BIG_NAME) simulation firmware for Windows"
624 @$(ECHO) " using mingw and msys"
625 @$(ECHO) " sim_win32_clean - Delete all build output for the win32 simulation"
626 @$(ECHO)
627 @$(ECHO) " [GCS]"
628 @$(ECHO) " gcs - Build the Ground Control System (GCS) application (debug|release)"
629 @$(ECHO) " Compile specific directory: MAKE_DIR=<dir>"
630 @$(ECHO) " Example: make gcs MAKE_DIR=src/plugins/coreplugin"
631 @$(ECHO) " gcs_qmake - Run qmake for the Ground Control System (GCS) application (debug|release)"
632 @$(ECHO) " gcs_clean - Remove the Ground Control System (GCS) application (debug|release)"
633 @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
634 @$(ECHO)
635 @$(ECHO) " [Uploader Tool]"
636 @$(ECHO) " uploader - Build the serial uploader tool (debug|release)"
637 @$(ECHO) " uploader_qmake - Run qmake for the serial uploader tool (debug|release)"
638 @$(ECHO) " uploader_clean - Remove the serial uploader tool (debug|release)"
639 @$(ECHO) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
640 @$(ECHO)
641 @$(ECHO)
642 @$(ECHO) " [UAVObjects]"
643 @$(ECHO) " uavobjects - Generate source files from the UAVObject definition XML files"
644 @$(ECHO) " uavobjects_test - Parse xml-files - check for valid, duplicate ObjId's, ..."
645 @$(ECHO) " uavobjects_<group> - Generate source files from a subset of the UAVObject definition XML files"
646 @$(ECHO) " Supported groups are ($(UAVOBJ_TARGETS))"
647 @$(ECHO)
648 @$(ECHO) " [Packaging]"
649 @$(ECHO) " package - Build and package the platform-dependent package (no clean)"
650 @$(ECHO) " opfw_resource - Generate resources to embed firmware binaries into the GCS"
651 @$(ECHO) " dist - Generate source archive for distribution"
652 @$(ECHO) " fw_dist - Generate archive of firmware"
653 @$(ECHO) " install - Install GCS to \"DESTDIR\" with prefix \"prefix\" (Linux only)"
654 @$(ECHO)
655 @$(ECHO) " [Code Formatting]"
656 @$(ECHO) " uncrustify_<source> - Reformat <source> code according to the project's standards"
657 @$(ECHO) " Supported sources are ($(UNCRUSTIFY_TARGETS))"
658 @$(ECHO) " uncrustify_all - Reformat all source code"
659 @$(ECHO)
660 @$(ECHO) " [Code Documentation]"
661 @$(ECHO) " docs_<source> - Generate HTML documentation for <source>"
662 @$(ECHO) " Supported sources are ($(DOCS_TARGETS))"
663 @$(ECHO) " docs_all - Generate HTML documentation for all"
664 @$(ECHO) " docs_<source>_clean - Delete generated documentation for <source>"
665 @$(ECHO) " docs_all_clean - Delete all generated documentation"
666 @$(ECHO)
667 @$(ECHO) " [Configuration]"
668 @$(ECHO) " config_new - Place your make arguments in the config file"
669 @$(ECHO) " config_append - Place your make arguments in the config file but append"
670 @$(ECHO) " config_clean - Removes the config file"
671 @$(ECHO)
672 @$(ECHO) " Hint: Add V=1 to your command line to see verbose build output."
673 @$(ECHO)
674 @$(ECHO) " Notes: All tool distribution files will be downloaded into $(DL_DIR)"
675 @$(ECHO) " All tools will be installed into $(TOOLS_DIR)"
676 @$(ECHO) " All build output will be placed in $(BUILD_DIR)"
677 @$(ECHO)
678 @$(ECHO) " Tool download and install directories can be changed using environment variables:"
679 @$(ECHO) " DL_DIR full path to downloads directory [downloads if not set]"
680 @$(ECHO) " TOOLS_DIR full path to installed tools directory [tools if not set]"
681 @$(ECHO) " More info: $(WIKI_URL_ROOT)LibrePilot+Build+System+Overview"
682 @$(ECHO)