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