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
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
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
)
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
54 DIRS
:= $(DL_DIR
) $(TOOLS_DIR
) $(BUILD_DIR
) $(PACKAGE_DIR
) $(DIST_DIR
)
56 # Naming for binaries and packaging etc,.
57 ORG_BIG_NAME
:= LibrePilot
58 GCS_BIG_NAME
:= ${ORG_BIG_NAME} GCS
59 # These should be lowercase with no spaces
60 ORG_SMALL_NAME
:= $(call smallify
,$(ORG_BIG_NAME
))
61 GCS_SMALL_NAME
:= $(call smallify
,$(GCS_BIG_NAME
))
63 # Set up default build configurations (debug | release)
64 GCS_BUILD_CONF
:= release
65 GOOGLE_API_VERSION
:= 14
67 # Clean out undesirable variables from the environment and command-line
68 # to remove the chance that they will cause problems with our build
70 $(if
$(filter-out undefined
,$(origin $(1))),
71 $(info $(EMPTY
) NOTE Sanitized
$(2) variable
'$(1)' from
$(origin $(1)))
72 MAKEOVERRIDES
= $(filter-out $(1)=%,$(MAKEOVERRIDES
))
78 # These specific variables can influence compilation in unexpected (and undesirable) ways
80 SANITIZE_GCC_VARS
:= TMPDIR GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH
82 SANITIZE_GCC_VARS
+= CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH DEPENDENCIES_OUTPUT
84 SANITIZE_GCC_VARS
+= CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LDLIBS
85 $(foreach var
, $(SANITIZE_GCC_VARS
), $(eval
$(call SANITIZE_VAR
,$(var
),disallowed
)))
87 # These specific variables used to be valid but now they make no sense
88 SANITIZE_DEPRECATED_VARS
:= USE_BOOTLOADER CLEAN_BUILD
89 $(foreach var
, $(SANITIZE_DEPRECATED_VARS
), $(eval
$(call SANITIZE_VAR
,$(var
),deprecated
)))
91 # Make sure this isn't being run as root unless installing (no whoami on Windows, but that is ok here)
92 ifeq ($(shell whoami
2>/dev
/null
),root
)
93 ifeq ($(filter install,$(MAKECMDGOALS
)),)
95 $(error You should not be running this
as root
)
100 # Decide on a verbosity level based on the V= parameter
111 # Make sure we know few things about the architecture before including
112 # the tools.mk to ensure that we download/install the right tools.
113 UNAME
:= $(shell uname
)
114 ARCH
:= $(shell uname
-m
)
115 # Here and everywhere if not Linux or Mac then assume Windows
116 ifeq ($(filter Linux Darwin
, $(UNAME
)), )
120 # Include tools installers
121 include $(ROOT_DIR
)/make
/tools.mk
123 # Include third party builders if available
124 -include $(ROOT_DIR
)/make
/3rdparty
/3rdparty.mk
126 # We almost need to consider autoconf/automake instead of this
127 ifeq ($(UNAME
), Linux
)
129 UAVOBJGENERATOR
:= $(BUILD_DIR
)/uavobjgenerator
/uavobjgenerator
130 else ifeq ($(UNAME
), Darwin
)
132 UAVOBJGENERATOR
:= $(BUILD_DIR
)/uavobjgenerator
/uavobjgenerator
133 else ifeq ($(UNAME
), Windows
)
135 UAVOBJGENERATOR
:= $(BUILD_DIR
)/uavobjgenerator
/uavobjgenerator.exe
141 ##############################
144 all: uavobjects all_ground all_flight
148 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR))"
149 $(V1
) [ ! -d
"$(BUILD_DIR)" ] ||
$(RM
) -rf
"$(BUILD_DIR)"
155 ##############################
159 ##############################
161 UAVOBJGENERATOR_DIR
:= $(BUILD_DIR
)/uavobjgenerator
162 DIRS
+= $(UAVOBJGENERATOR_DIR
)
164 .PHONY
: uavobjgenerator
165 uavobjgenerator
$(UAVOBJGENERATOR
): |
$(UAVOBJGENERATOR_DIR
)
166 $(V1
) cd
$(UAVOBJGENERATOR_DIR
) && \
167 ( [ -f Makefile
] ||
$(QMAKE
) $(ROOT_DIR
)/ground
/uavobjgenerator
/uavobjgenerator.pro \
168 -spec
$(QT_SPEC
) CONFIG
+=$(GCS_BUILD_CONF
) CONFIG
+=$(GCS_SILENT
) ) && \
169 $(MAKE
) --no-print-directory
-w
171 UAVOBJ_TARGETS
:= gcs flight python matlab java wireshark
174 uavobjects
: $(addprefix uavobjects_
, $(UAVOBJ_TARGETS
))
176 UAVOBJ_XML_DIR
:= $(ROOT_DIR
)/shared
/uavobjectdefinition
177 UAVOBJ_OUT_DIR
:= $(BUILD_DIR
)/uavobject-synthetics
179 uavobjects_
%: uavobjgenerator
180 @
$(MKDIR
) -p
$(UAVOBJ_OUT_DIR
)/$*
181 $(V1
) ( cd
$(UAVOBJ_OUT_DIR
)/$* && \
182 $(UAVOBJGENERATOR
) -$* $(UAVOBJ_XML_DIR
) $(ROOT_DIR
) ; \
185 uavobjects_test
: uavobjgenerator
186 $(V1
) $(UAVOBJGENERATOR
) -v
$(UAVOBJ_XML_DIR
) $(ROOT_DIR
)
189 @
$(ECHO
) " CLEAN $(call toprel, $(UAVOBJ_OUT_DIR))"
190 $(V1
) [ ! -d
"$(UAVOBJ_OUT_DIR)" ] ||
$(RM
) -r
"$(UAVOBJ_OUT_DIR)"
192 ##############################
194 # Flight related components
196 ##############################
198 # Define some pointers to the various important pieces of the flight code
199 # to prevent these being repeated in every sub makefile
200 export PIOS
:= $(ROOT_DIR
)/flight
/pios
201 export FLIGHTLIB
:= $(ROOT_DIR
)/flight
/libraries
202 export OPMODULEDIR
:= $(ROOT_DIR
)/flight
/modules
203 export OPUAVOBJ
:= $(ROOT_DIR
)/flight
/uavobjects
204 export OPUAVTALK
:= $(ROOT_DIR
)/flight
/uavtalk
205 export OPUAVSYNTHDIR
:= $(BUILD_DIR
)/uavobject-synthetics
/flight
206 export OPGCSSYNTHDIR
:= $(BUILD_DIR
)/openpilotgcs-synthetics
208 DIRS
+= $(OPGCSSYNTHDIR
)
210 # Define supported board lists
211 ALL_BOARDS
:= coptercontrol oplinkmini revolution osd revoproto simposix discoveryf4bare gpsplatinum revonano
213 # Short names of each board (used to display board name in parallel builds)
214 coptercontrol_short
:= 'cc '
215 oplinkmini_short
:= 'oplm'
216 revolution_short
:= 'revo'
218 revoproto_short
:= 'revp'
219 revonano_short
:= 'revn'
220 simposix_short
:= 'posx'
221 discoveryf4bare_short
:= 'df4b'
222 gpsplatinum_short
:= 'gps9'
224 # SimPosix only builds on Linux so drop it from the list for
225 # all other platforms.
226 ifneq ($(UNAME
), Linux
)
227 ALL_BOARDS
:= $(filter-out simposix
, $(ALL_BOARDS
))
230 # Start out assuming that we'll build fw, bl and bu for all boards
231 FW_BOARDS
:= $(ALL_BOARDS
)
232 BL_BOARDS
:= $(ALL_BOARDS
)
233 BU_BOARDS
:= $(ALL_BOARDS
)
234 EF_BOARDS
:= $(ALL_BOARDS
)
236 # SimPosix doesn't have a BL, BU or EF target so we need to
237 # filter them out to prevent errors on the all_flight target.
238 BL_BOARDS
:= $(filter-out simposix
, $(BL_BOARDS
))
239 BU_BOARDS
:= $(filter-out simposix gpsplatinum
, $(BU_BOARDS
))
240 EF_BOARDS
:= $(filter-out simposix
, $(EF_BOARDS
))
242 # Generate the targets for whatever boards are left in each list
243 FW_TARGETS
:= $(addprefix fw_
, $(FW_BOARDS
))
244 BL_TARGETS
:= $(addprefix bl_
, $(BL_BOARDS
))
245 BU_TARGETS
:= $(addprefix bu_
, $(BU_BOARDS
))
246 EF_TARGETS
:= $(addprefix ef_
, $(EF_BOARDS
))
248 # When building any of the "all_*" targets, tell all sub makefiles to display
249 # additional details on each line of output to describe which build and target
250 # that each line applies to. The same applies also to all, opfw_resource,
252 ifneq ($(strip $(filter all_
% all opfw_resource package
,$(MAKECMDGOALS
))),)
253 export ENABLE_MSG_EXTRA
:= yes
256 # When building more than one goal in a single make invocation, also
257 # enable the extra context for each output line
258 ifneq ($(word 2,$(MAKECMDGOALS
)),)
259 export ENABLE_MSG_EXTRA
:= yes
262 # TEMPLATES (used to generate build rules)
264 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
265 # $(2) = Short name for board (e.g cc)
269 fw_
$(1): fw_
$(1)_opfw
271 fw_
$(1)_
%: uavobjects_flight
272 $(V1
) $$(ARM_GCC_VERSION_CHECK_TEMPLATE
)
273 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/fw_
$(1)/dep
274 $(V1
) cd
$(ROOT_DIR
)/flight
/targets
/boards
/$(1)/firmware
&& \
275 $$(MAKE
) -r
--no-print-directory \
278 BOARD_SHORT_NAME
=$(2) \
279 TOPDIR
=$(ROOT_DIR
)/flight
/targets
/boards
/$(1)/firmware \
280 OUTDIR
=$(BUILD_DIR
)/fw_
$(1) \
285 $(1)_clean
: fw_
$(1)_clean
287 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR)/fw_$(1))"
288 $(V1
) $(RM
) -fr
$(BUILD_DIR
)/fw_
$(1)
291 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
292 # $(2) = Short name for board (e.g cc)
296 bl_
$(1)_bino
: bl_
$(1)_bin
299 $(V1
) $$(ARM_GCC_VERSION_CHECK_TEMPLATE
)
300 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/bl_
$(1)/dep
301 $(V1
) cd
$(ROOT_DIR
)/flight
/targets
/boards
/$(1)/bootloader
&& \
302 $$(MAKE
) -r
--no-print-directory \
305 BOARD_SHORT_NAME
=$(2) \
306 TOPDIR
=$(ROOT_DIR
)/flight
/targets
/boards
/$(1)/bootloader \
307 OUTDIR
=$(BUILD_DIR
)/bl_
$(1) \
312 unbrick_
$(1): bl_
$(1)_hex
313 $(if
$(filter-out undefined
,$(origin UNBRICK_TTY
)),
314 $(V0
) @
$(ECHO
) " UNBRICK $(1) via $$(UNBRICK_TTY)"
315 $(V1
) $(STM32FLASH_DIR
)/stm32flash \
316 -w
$(BUILD_DIR
)/bl_
$(1)/bl_
$(1).hex \
321 $(V0
) @
$(ECHO
) "ERROR: You must specify UNBRICK_TTY=<serial-device> to use for unbricking."
322 $(V0
) @
$(ECHO
) " eg. $$(MAKE) $$@ UNBRICK_TTY=/dev/ttyUSB0"
325 .PHONY
: bl_
$(1)_clean
327 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR)/bl_$(1))"
328 $(V1
) $(RM
) -fr
$(BUILD_DIR
)/bl_
$(1)
331 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
332 # $(2) = Short name for board (e.g cc)
335 bu_
$(1): bu_
$(1)_opfw
337 bu_
$(1)_
%: bl_
$(1)_bino
338 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/bu_
$(1)/dep
339 $(V1
) cd
$(ROOT_DIR
)/flight
/targets
/common
/bootloader_updater
&& \
340 $$(MAKE
) -r
--no-print-directory \
343 BOARD_SHORT_NAME
=$(2) \
344 TOPDIR
=$(ROOT_DIR
)/flight
/targets
/common
/bootloader_updater \
345 OUTDIR
=$(BUILD_DIR
)/bu_
$(1) \
349 .PHONY
: bu_
$(1)_clean
351 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR)/bu_$(1))"
352 $(V1
) $(RM
) -fr
$(BUILD_DIR
)/bu_
$(1)
355 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
356 # $(2) = Short name for board (e.g cc)
361 ef_
$(1)_
%: bl_
$(1)_bin fw_
$(1)_opfw
362 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/ef_
$(1)
363 $(V1
) cd
$(ROOT_DIR
)/flight
/targets
/common
/entire_flash
&& \
364 $$(MAKE
) -r
--no-print-directory \
367 BOARD_SHORT_NAME
=$(2) \
368 DFU_CMD
="$(DFUUTIL_DIR)/bin/dfu-util" \
369 TOPDIR
=$(ROOT_DIR
)/flight
/targets
/common
/entire_flash \
370 OUTDIR
=$(BUILD_DIR
)/ef_
$(1) \
374 .PHONY
: ef_
$(1)_clean
376 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR)/ef_$(1))"
377 $(V1
) $(RM
) -fr
$(BUILD_DIR
)/ef_
$(1)
380 # $(1) = Canonical board name all in lower case (e.g. coptercontrol)
381 define BOARD_PHONY_TEMPLATE
383 all_
$(1): $$(filter fw_
$(1), $$(FW_TARGETS
))
384 all_
$(1): $$(filter bl_
$(1), $$(BL_TARGETS
))
385 all_
$(1): $$(filter bu_
$(1), $$(BU_TARGETS
))
386 all_
$(1): $$(filter ef_
$(1), $$(EF_TARGETS
))
388 .PHONY
: all_
$(1)_clean
389 all_
$(1)_clean
: $$(addsuffix _clean
, $$(filter fw_
$(1), $$(FW_TARGETS
)))
390 all_
$(1)_clean
: $$(addsuffix _clean
, $$(filter bl_
$(1), $$(BL_TARGETS
)))
391 all_
$(1)_clean
: $$(addsuffix _clean
, $$(filter bu_
$(1), $$(BU_TARGETS
)))
392 all_
$(1)_clean
: $$(addsuffix _clean
, $$(filter ef_
$(1), $$(EF_TARGETS
)))
395 # Generate flight build rules
396 .PHONY
: all_fw all_fw_clean
397 all_fw
: $(addsuffix _opfw
, $(FW_TARGETS
))
398 all_fw_clean
: $(addsuffix _clean
, $(FW_TARGETS
))
400 .PHONY
: all_bl all_bl_clean
401 all_bl
: $(addsuffix _bin
, $(BL_TARGETS
))
402 all_bl_clean
: $(addsuffix _clean
, $(BL_TARGETS
))
404 .PHONY
: all_bu all_bu_clean
405 all_bu
: $(addsuffix _opfw
, $(BU_TARGETS
))
406 all_bu_clean
: $(addsuffix _clean
, $(BU_TARGETS
))
408 .PHONY
: all_ef all_ef_clean
409 all_ef
: $(EF_TARGETS
)
410 all_ef_clean
: $(addsuffix _clean
, $(EF_TARGETS
))
412 .PHONY
: all_flight all_flight_clean
413 all_flight
: all_fw all_bl all_bu all_ef
414 all_flight_clean
: all_fw_clean all_bl_clean all_bu_clean all_ef_clean
416 # Expand the groups of targets for each board
417 $(foreach board
, $(ALL_BOARDS
), $(eval
$(call BOARD_PHONY_TEMPLATE
,$(board
))))
419 # Expand the firmware rules
420 $(foreach board
, $(ALL_BOARDS
), $(eval
$(call FW_TEMPLATE
,$(board
),$($(board
)_short
))))
422 # Expand the bootloader rules
423 $(foreach board
, $(ALL_BOARDS
), $(eval
$(call BL_TEMPLATE
,$(board
),$($(board
)_short
))))
425 # Expand the bootloader updater rules
426 $(foreach board
, $(ALL_BOARDS
), $(eval
$(call BU_TEMPLATE
,$(board
),$($(board
)_short
))))
428 # Expand the entire-flash rules
429 $(foreach board
, $(ALL_BOARDS
), $(eval
$(call EF_TEMPLATE
,$(board
),$($(board
)_short
))))
432 sim_win32
: sim_win32_exe
434 sim_win32_
%: uavobjects_flight
435 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/sitl_win32
436 $(V1
) $(MAKE
) --no-print-directory \
437 -C
$(ROOT_DIR
)/flight
/targets
/OpenPilot
--file
=$(ROOT_DIR
)/flight
/targets
/OpenPilot
/Makefile.win32
$*
442 sim_osx_
%: uavobjects_flight
443 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/sim_osx
444 $(V1
) $(MAKE
) --no-print-directory \
445 -C
$(ROOT_DIR
)/flight
/targets
/SensorTest
--file
=$(ROOT_DIR
)/flight
/targets
/SensorTest
/Makefile.osx
$*
447 ##############################
449 # GCS related components
451 ##############################
454 all_ground
: gcs uploader
462 GCS_DIR
:= $(BUILD_DIR
)/$(GCS_SMALL_NAME
)_
$(GCS_BUILD_CONF
)
465 GCS_MAKEFILE
:= $(GCS_DIR
)/Makefile
468 gcs_qmake
$(GCS_MAKEFILE
): |
$(GCS_DIR
)
469 $(V1
) cd
$(GCS_DIR
) && \
470 $(QMAKE
) $(ROOT_DIR
)/ground
/gcs
/gcs.pro \
471 -spec
$(QT_SPEC
) -r CONFIG
+=$(GCS_BUILD_CONF
) CONFIG
+=$(GCS_SILENT
) \
472 'GCS_BIG_NAME="$(GCS_BIG_NAME)"' GCS_SMALL_NAME
=$(GCS_SMALL_NAME
) \
473 'ORG_BIG_NAME="$(ORG_BIG_NAME)"' ORG_SMALL_NAME
=$(ORG_SMALL_NAME
) \
474 'GCS_LIBRARY_BASENAME=$(libbasename)' \
478 gcs
: uavobjgenerator
$(GCS_MAKEFILE
)
479 $(V1
) $(MAKE
) -w
-C
$(GCS_DIR
)/$(MAKE_DIR
);
483 @
$(ECHO
) " CLEAN $(call toprel, $(GCS_DIR))"
484 $(V1
) [ ! -d
"$(GCS_DIR)" ] ||
$(RM
) -r
"$(GCS_DIR)"
488 ################################
490 # Serial Uploader tool
492 ################################
494 UPLOADER_DIR
:= $(BUILD_DIR
)/uploader_
$(GCS_BUILD_CONF
)
495 DIRS
+= $(UPLOADER_DIR
)
497 UPLOADER_MAKEFILE
:= $(UPLOADER_DIR
)/Makefile
499 .PHONY
: uploader_qmake
500 uploader_qmake
$(UPLOADER_MAKEFILE
): |
$(UPLOADER_DIR
)
501 $(V1
) cd
$(UPLOADER_DIR
) && \
502 $(QMAKE
) $(ROOT_DIR
)/ground
/gcs
/src
/experimental
/USB_UPLOAD_TOOL
/upload.pro \
503 -spec
$(QT_SPEC
) -r CONFIG
+=$(GCS_BUILD_CONF
) CONFIG
+=$(GCS_SILENT
) $(GCS_QMAKE_OPTS
)
506 uploader
: $(UPLOADER_MAKEFILE
)
507 $(V1
) $(MAKE
) -w
-C
$(UPLOADER_DIR
)
509 .PHONY
: uploader_clean
511 @
$(ECHO
) " CLEAN $(call toprel, $(UPLOADER_DIR))"
512 $(V1
) [ ! -d
"$(UPLOADER_DIR)" ] ||
$(RM
) -r
"$(UPLOADER_DIR)"
515 # We want to take snapshots of the UAVOs at each point that they change
516 # to allow the GCS to be compatible with as many versions as possible.
517 # We always include a pseudo collection called "srctree" which represents
518 # the UAVOs in the source tree. So not necessary to add current tree UAVO
519 # hash here, it is always included.
521 # Find the git hashes of each commit that changes uavobjects with:
522 # git log --format=%h -- shared/uavobjectdefinition/ | head -n 2
523 # List only UAVO hashes of past releases, do not list current hash.
524 # Past compatible versions are so far: RELEASE-12.10.2
525 UAVO_GIT_VERSIONS
:= 5e14f53
527 # All versions includes also the current source tree UAVO hash
528 UAVO_ALL_VERSIONS
:= $(UAVO_GIT_VERSIONS
) srctree
530 # This is where the UAVO collections are stored
531 UAVO_COLLECTION_DIR
:= $(BUILD_DIR
)/uavo-collections
533 # $(1) git hash of a UAVO snapshot
534 define UAVO_COLLECTION_GIT_TEMPLATE
536 # Make the output directory that will contain all of the synthetics for the
537 # uavo collection referenced by the git hash $(1)
538 $$(UAVO_COLLECTION_DIR
)/$(1):
539 $$(V1
) $(MKDIR
) -p
$$(UAVO_COLLECTION_DIR
)/$(1)
541 # Extract the snapshot of shared/uavobjectdefinition from git hash $(1)
542 $$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml.
tar: |
$$(UAVO_COLLECTION_DIR
)/$(1)
543 $$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml.
tar:
544 $$(V0
) @
$(ECHO
) " UAVOTAR $(1)"
545 $$(V1
) $(GIT
) archive
$(1) -o
$$@
-- shared
/uavobjectdefinition
/
547 # Extract the uavo xml files from our snapshot
548 $$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml
: $$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml.
tar
549 $$(V0
) @
$(ECHO
) " UAVOUNTAR $(1)"
551 $$(V1
) $(MKDIR
) -p
$$@
552 $$(V1
) $(TAR
) -C
$$(call toprel
, $$@
) -xf
$$(call toprel
, $$<) ||
$(RM
) -rf
$$@
555 # Map the current working directory into the set of UAVO collections
556 $(UAVO_COLLECTION_DIR
)/srctree
:
559 $(UAVO_COLLECTION_DIR
)/srctree
/uavo-xml
: |
$(UAVO_COLLECTION_DIR
)/srctree
560 $(UAVO_COLLECTION_DIR
)/srctree
/uavo-xml
: $(UAVOBJ_XML_DIR
)
561 $(V1
) $(LN
) -sf
$(ROOT_DIR
) $(UAVO_COLLECTION_DIR
)/srctree
/uavo-xml
563 # $(1) git hash (or symbolic name) of a UAVO snapshot
564 define UAVO_COLLECTION_BUILD_TEMPLATE
566 # This leaves us with a (broken) symlink that points to the full sha1sum of the collection
567 $$(UAVO_COLLECTION_DIR
)/$(1)/uavohash
: $$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml
568 # Compute the sha1 hash for this UAVO collection
569 # The sed bit truncates the UAVO hash to 16 hex digits
570 $$(V1
) $$(VERSION_INFO
) \
571 --uavodir
=$$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml
/shared
/uavobjectdefinition \
572 --format
='$$$${UAVO_HASH}' | \
573 $(SED
) -e
's|\(................\).*|\1|' > $$@
575 $$(V0
) @
$(ECHO
) " UAVOHASH $(1) ->" $$$$(cat
$$(UAVO_COLLECTION_DIR
)/$(1)/uavohash
)
577 # Generate the java uavobjects for this UAVO collection
578 $$(UAVO_COLLECTION_DIR
)/$(1)/java-build
/java
: $$(UAVO_COLLECTION_DIR
)/$(1)/uavohash
579 $$(V0
) @
$(ECHO
) " UAVOJAVA $(1) " $$$$(cat
$$(UAVO_COLLECTION_DIR
)/$(1)/uavohash
)
580 $$(V1
) $(MKDIR
) -p
$$@
582 cd
$$(UAVO_COLLECTION_DIR
)/$(1)/java-build
&& \
583 $$(UAVOBJGENERATOR
) -java
$$(UAVO_COLLECTION_DIR
)/$(1)/uavo-xml
/shared
/uavobjectdefinition
$$(ROOT_DIR
) ; \
586 # Build a jar file for this UAVO collection
587 $$(UAVO_COLLECTION_DIR
)/$(1)/java-build
/uavobjects.jar
: |
$$(ANDROIDGCS_ASSETS_DIR
)/uavos
588 $$(UAVO_COLLECTION_DIR
)/$(1)/java-build
/uavobjects.jar
: $$(UAVO_COLLECTION_DIR
)/$(1)/java-build
/java
589 $$(V0
) @
$(ECHO
) " UAVOJAR $(1) " $$$$(cat
$$(UAVO_COLLECTION_DIR
)/$(1)/uavohash
)
591 HASH
=$$$$(cat
$$(UAVO_COLLECTION_DIR
)/$(1)/uavohash
) && \
592 cd
$$(UAVO_COLLECTION_DIR
)/$(1)/java-build
&& \
593 $(JAVAC
) java
/*.java \
594 $$(ROOT_DIR
)/androidgcs
/src
/org
/openpilot
/uavtalk
/UAVDataObject.java \
595 $$(ROOT_DIR
)/androidgcs
/src
/org
/openpilot
/uavtalk
/UAVObject
*.java \
596 $$(ROOT_DIR
)/androidgcs
/src
/org
/openpilot
/uavtalk
/UAVMetaObject.java \
598 find .
/org
/openpilot
/uavtalk
/uavobjects
-type f
-name
'*.class' > classlist.txt
&& \
599 $(JAR
) cf tmp_uavobjects.jar @classlist.txt
&& \
602 --output
$$(ANDROIDGCS_ASSETS_DIR
)/uavos
/$$$${HASH}.jar \
603 tmp_uavobjects.jar
&& \
604 $(LN
) -sf
$$(ANDROIDGCS_ASSETS_DIR
)/uavos
/$$$${HASH}.jar uavobjects.jar \
609 # One of these for each element of UAVO_GIT_VERSIONS so we can extract the UAVOs from git
610 $(foreach githash
, $(UAVO_GIT_VERSIONS
), $(eval
$(call UAVO_COLLECTION_GIT_TEMPLATE
,$(githash
))))
612 # One of these for each UAVO_ALL_VERSIONS which includes the ones in the srctree
613 $(foreach githash
, $(UAVO_ALL_VERSIONS
), $(eval
$(call UAVO_COLLECTION_BUILD_TEMPLATE
,$(githash
))))
615 .PHONY
: uavo-collections_java
616 uavo-collections_java
: $(foreach githash
, $(UAVO_ALL_VERSIONS
), $(UAVO_COLLECTION_DIR
)/$(githash
)/java-build
/uavobjects.jar
)
618 .PHONY
: uavo-collections
619 uavo-collections
: uavo-collections_java
621 .PHONY
: uavo-collections_clean
622 uavo-collections_clean
:
623 @
$(ECHO
) " CLEAN $(call toprel, $(UAVO_COLLECTION_DIR))"
624 $(V1
) [ ! -d
"$(UAVO_COLLECTION_DIR)" ] ||
$(RM
) -r
$(UAVO_COLLECTION_DIR
)
626 ##############################
630 ##############################
632 ALL_UNITTESTS
:= logfs math lednotification
634 # Build the directory for the unit tests
635 UT_OUT_DIR
:= $(BUILD_DIR
)/unit_tests
636 DIRS
+= $(UT_OUT_DIR
)
639 all_ut
: $(addsuffix _elf
, $(addprefix ut_
, $(ALL_UNITTESTS
)))
642 all_ut_xml
: $(addsuffix _xml
, $(addprefix ut_
, $(ALL_UNITTESTS
)))
645 all_ut_run
: $(addsuffix _run
, $(addprefix ut_
, $(ALL_UNITTESTS
)))
649 @
$(ECHO
) " CLEAN $(call toprel, $(UT_OUT_DIR))"
650 $(V1
) [ ! -d
"$(UT_OUT_DIR)" ] ||
$(RM
) -r
"$(UT_OUT_DIR)"
652 # $(1) = Unit test name
657 ut_
$(1)_
%: $$(UT_OUT_DIR
)
658 $(V1
) $(MKDIR
) -p
$(UT_OUT_DIR
)/$(1)
659 $(V1
) cd
$(ROOT_DIR
)/flight
/tests
/$(1) && \
660 $$(MAKE
) -r
--no-print-directory \
662 BOARD_SHORT_NAME
=$(1) \
663 TOPDIR
=$(ROOT_DIR
)/flight
/tests
/$(1) \
664 OUTDIR
="$(UT_OUT_DIR)/$(1)" \
668 .PHONY
: ut_
$(1)_clean
670 @
$(ECHO
) " CLEAN $(call toprel, $(UT_OUT_DIR)/$(1))"
671 $(V1
) [ ! -d
"$(UT_OUT_DIR)/$(1)" ] ||
$(RM
) -r
"$(UT_OUT_DIR)/$(1)"
674 # Expand the unittest rules
675 $(foreach ut
, $(ALL_UNITTESTS
), $(eval
$(call UT_TEMPLATE
,$(ut
))))
677 # Disable parallel make when the all_ut_run target is requested otherwise the TAP
678 # output is interleaved with the rest of the make output.
679 ifneq ($(strip $(filter all_ut_run
,$(MAKECMDGOALS
))),)
681 $(info $(EMPTY
) NOTE Parallel make disabled by all_ut_run target so we have sane console output
)
684 ##############################
686 # Packaging components
688 ##############################
690 # Firmware files to package
691 PACKAGE_FW_EXCLUDE
:= fw_simposix
$(if
$(PACKAGE_FW_INCLUDE_DISCOVERYF4BARE
),,fw_discoveryf4bare
)
692 PACKAGE_FW_TARGETS
:= $(filter-out $(PACKAGE_FW_EXCLUDE
), $(FW_TARGETS
))
693 PACKAGE_ELF_TARGETS
:= $(filter fw_simposix
, $(FW_TARGETS
))
695 # Rules to generate GCS resources used to embed firmware binaries into the GCS.
696 # They are used later by the vehicle setup wizard to update board firmware.
697 # To open a firmware image use ":/firmware/fw_coptercontrol.opfw"
698 OPFW_RESOURCE
:= $(OPGCSSYNTHDIR
)/opfw_resource.qrc
699 OPFW_RESOURCE_PREFIX
:= ..
/..
/
700 OPFW_FILES
:= $(foreach fw_targ
, $(PACKAGE_FW_TARGETS
), $(call toprel
, $(BUILD_DIR
)/$(fw_targ
)/$(fw_targ
).opfw
))
702 <!DOCTYPE RCC
><RCC version
="1.0"> \
703 <qresource
prefix="/firmware"> \
704 $(foreach fw_file
, $(OPFW_FILES
), <file alias
="$(notdir $(fw_file))">$(OPFW_RESOURCE_PREFIX
)$(fw_file
)</file
>) \
708 .PHONY
: opfw_resource
709 opfw_resource
: $(OPFW_RESOURCE
)
711 $(OPFW_RESOURCE
): $(FW_TARGETS
) |
$(OPGCSSYNTHDIR
)
712 @
$(ECHO
) Generating OPFW resource file
$(call toprel
, $@
)
713 $(V1
) $(ECHO
) $(QUOTE
)$(OPFW_CONTENTS
)$(QUOTE
) > $@
715 # If opfw_resource or all firmware are requested, GCS should depend on the resource
716 ifneq ($(strip $(filter opfw_resource
all all_fw all_flight package
,$(MAKECMDGOALS
))),)
717 $(GCS_MAKEFILE
): $(OPFW_RESOURCE
)
720 # Packaging targets: package
721 # - builds all firmware, opfw_resource, gcs
722 # - copies firmware into a package directory
723 # - calls paltform-specific packaging script
725 # Define some variables
726 PACKAGE_LBL
:= $(shell $(VERSION_INFO
) --format
=\
$${LABEL})
727 PACKAGE_NAME
:= $(subst $(SPACE
),,$(ORG_BIG_NAME
))
729 PACKAGE_FULL_NAME
:= $(PACKAGE_NAME
)$(PACKAGE_SEP
)$(PACKAGE_LBL
)
731 # Source distribution is never dirty because it uses git archive
732 DIST_LBL
:= $(subst -dirty
,,$(PACKAGE_LBL
))
733 DIST_NAME
:= $(PACKAGE_NAME
)$(PACKAGE_SEP
)$(DIST_LBL
)
734 DIST_TAR
:= $(DIST_DIR
)/$(DIST_NAME
).
tar
735 DIST_TAR_GZ
:= $(DIST_TAR
).gz
736 DIST_VER_INFO
:= $(DIST_DIR
)/version-info.json
738 include $(ROOT_DIR
)/package
/$(UNAME
).mk
740 ##############################
742 # Source for distribution
744 ##############################
745 $(DIST_VER_INFO
): .git
/index |
$(DIST_DIR
)
746 $(V1
) $(VERSION_INFO
) --jsonpath
="$(DIST_DIR)"
748 $(DIST_TAR
): $(DIST_VER_INFO
) .git
/index |
$(DIST_DIR
)
749 @
$(ECHO
) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_TAR))"
750 $(V1
) git archive
--prefix="$(PACKAGE_NAME)/" -o
"$(DIST_TAR)" HEAD
751 $(V1
) tar --append
--file
="$(DIST_TAR)" \
752 --transform
='s,.*version-info.json,$(PACKAGE_NAME)/version-info.json,' \
753 $(call toprel
, "$(DIST_VER_INFO)")
755 $(DIST_TAR_GZ
): $(DIST_TAR
)
756 @
$(ECHO
) " SOURCE FOR DISTRIBUTION $(call toprel, $(DIST_TAR_GZ))"
757 $(V1
) gzip
-kf
"$(DIST_TAR)"
760 dist_tar_gz
: $(DIST_TAR_GZ
)
766 ##############################
768 # Source code formatting
770 ##############################
772 UNCRUSTIFY_TARGETS
:= flight ground
774 # $(1) = Uncrustify target (e.g flight or ground)
775 # $(2) = Target root directory
776 define UNCRUSTIFY_TEMPLATE
778 .PHONY
: uncrustify_
$(1)
780 @
$(ECHO
) "Auto-formatting $(1) source code"
781 $(V1
) UNCRUSTIFY_CONFIG
="$(ROOT_DIR)/make/uncrustify/uncrustify.cfg" $(SHELL
) make
/scripts
/uncrustify.sh
$(call toprel
, $(2))
784 $(foreach uncrustify_targ
, $(UNCRUSTIFY_TARGETS
), $(eval
$(call UNCRUSTIFY_TEMPLATE
,$(uncrustify_targ
),$(ROOT_DIR
)/$(uncrustify_targ
))))
786 .PHONY
: uncrustify_all
787 uncrustify_all
: $(addprefix uncrustify_
,$(UNCRUSTIFY_TARGETS
))
789 ##############################
791 # Doxygen documentation
793 # Each target should have own Doxyfile.$(target) with build directory build/docs/$(target),
794 # proper source directory (e.g. $(target)) and appropriate other doxygen options.
796 ##############################
798 DOCS_TARGETS
:= flight ground uavobjects
800 # $(1) = Doxygen target (e.g flight or ground)
801 define DOXYGEN_TEMPLATE
804 docs_
$(1): docs_
$(1)_clean
805 @
$(ECHO
) "Generating $(1) documentation"
806 $(V1
) $(MKDIR
) -p
$(BUILD_DIR
)/docs
/$(1)
807 $(V1
) $(DOXYGEN
) $(ROOT_DIR
)/make
/doxygen
/Doxyfile.
$(1)
809 .PHONY
: docs_
$(1)_clean
811 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR)/docs/$(1))"
812 $(V1
) [ ! -d
"$(BUILD_DIR)/docs/$(1)" ] ||
$(RM
) -r
"$(BUILD_DIR)/docs/$(1)"
816 $(foreach docs_targ
, $(DOCS_TARGETS
), $(eval
$(call DOXYGEN_TEMPLATE
,$(docs_targ
))))
819 docs_all
: $(addprefix docs_
,$(DOCS_TARGETS
))
821 .PHONY
: docs_all_clean
823 @
$(ECHO
) " CLEAN $(call toprel, $(BUILD_DIR)/docs)"
824 $(V1
) [ ! -d
"$(BUILD_DIR)/docs" ] ||
$(RM
) -rf
"$(BUILD_DIR)/docs"
826 ##############################
830 ##############################
833 build-info
: |
$(BUILD_DIR
)
834 @
$(ECHO
) " BUILD-INFO $(call toprel, $(BUILD_DIR)/$@.txt)"
835 $(V1
) $(VERSION_INFO
) \
836 --uavodir
=$(ROOT_DIR
)/shared
/uavobjectdefinition \
837 --template
="make/templates/$@.txt" \
838 --outfile
="$(BUILD_DIR)/$@.txt"
840 ##############################
844 ##############################
846 CONFIG_OPTS
:= $(addsuffix \n,$(MAKEOVERRIDES
))
847 CONFIG_OPTS
:= $(addprefix override$(SPACE
),$(CONFIG_OPTS
))
851 @printf
'$(CONFIG_OPTS)' > $(CONFIG_FILE
)
853 .PHONY
: config_append
855 @printf
'$(CONFIG_OPTS)' >> $(CONFIG_FILE
)
866 ##############################
870 ##############################
876 ##############################
878 # Help message, the default Makefile goal
880 ##############################
882 .DEFAULT_GOAL
:= help
887 @
$(ECHO
) " This Makefile is known to work on Linux and Mac in a standard shell environment."
888 @
$(ECHO
) " It also works on Windows by following the instructions given on this wiki page:"
889 @
$(ECHO
) " http://wiki.openpilot.org/display/Doc/Windows%3A+Building+and+Packaging"
891 @
$(ECHO
) " Here is a summary of the available targets:"
893 @
$(ECHO
) " [Source tree preparation]"
894 @
$(ECHO
) " prepare - Install GIT commit message template"
895 @
$(ECHO
) " [Tool Installers]"
896 @
$(ECHO
) " arm_sdk_install - Install the GNU ARM gcc toolchain"
897 @
$(ECHO
) " qt_sdk_install - Install the QT development tools"
898 @
$(ECHO
) " nsis_install - Install the NSIS Unicode (Windows only)"
899 @
$(ECHO
) " sdl_install - Install the SDL library (Windows only)"
900 @
$(ECHO
) " mesawin_install - Install the OpenGL32 DLL (Windows only)"
901 @
$(ECHO
) " openssl_install - Install the OpenSSL libraries (Windows only)"
902 @
$(ECHO
) " uncrustify_install - Install the Uncrustify source code beautifier"
903 @
$(ECHO
) " doxygen_install - Install the Doxygen documentation generator"
904 @
$(ECHO
) " gtest_install - Install the GoogleTest framework"
905 @
$(ECHO
) " ccache_install - Install ccache"
906 @
$(ECHO
) " These targets are not updated yet and are probably broken:"
907 @
$(ECHO
) " openocd_install - Install the OpenOCD JTAG daemon"
908 @
$(ECHO
) " stm32flash_install - Install the stm32flash tool for unbricking F1-based boards"
909 @
$(ECHO
) " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards"
910 @
$(ECHO
) " Install all available tools:"
911 @
$(ECHO
) " all_sdk_install - Install all of above (platform-dependent)"
912 @
$(ECHO
) " build_sdk_install - Install only essential for build tools (platform-dependent)"
914 @
$(ECHO
) " Other tool options are:"
915 @
$(ECHO
) " <tool>_version - Display <tool> version"
916 @
$(ECHO
) " <tool>_clean - Remove installed <tool>"
917 @
$(ECHO
) " <tool>_distclean - Remove downloaded <tool> distribution file(s)"
919 @
$(ECHO
) " [Big Hammer]"
920 @
$(ECHO
) " all - Generate UAVObjects, build openpilot firmware and gcs"
921 @
$(ECHO
) " all_flight - Build all firmware, bootloaders and bootloader updaters"
922 @
$(ECHO
) " all_fw - Build only firmware for all boards"
923 @
$(ECHO
) " all_bl - Build only bootloaders for all boards"
924 @
$(ECHO
) " all_bu - Build only bootloader updaters for all boards"
926 @
$(ECHO
) " all_clean - Remove your build directory ($(BUILD_DIR))"
927 @
$(ECHO
) " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
928 @
$(ECHO
) " all_fw_clean - Remove firmware for all boards"
929 @
$(ECHO
) " all_bl_clean - Remove bootloaders for all boards"
930 @
$(ECHO
) " all_bu_clean - Remove bootloader updaters for all boards"
932 @
$(ECHO
) " all_<board> - Build all available images for <board>"
933 @
$(ECHO
) " all_<board>_clean - Remove all available images for <board>"
935 @
$(ECHO
) " all_ut - Build all unit tests"
936 @
$(ECHO
) " all_ut_tap - Run all unit tests and capture all TAP output to files"
937 @
$(ECHO
) " all_ut_run - Run all unit tests and dump TAP output to console"
939 @
$(ECHO
) " [Firmware]"
940 @
$(ECHO
) " <board> - Build firmware for <board>"
941 @
$(ECHO
) " Supported boards are ($(ALL_BOARDS))"
942 @
$(ECHO
) " fw_<board> - Build firmware for <board>"
943 @
$(ECHO
) " Supported boards are ($(FW_BOARDS))"
944 @
$(ECHO
) " fw_<board>_clean - Remove firmware for <board>"
945 @
$(ECHO
) " fw_<board>_program - Use OpenOCD + JTAG to write firmware to <board>"
947 @
$(ECHO
) " [Bootloader]"
948 @
$(ECHO
) " bl_<board> - Build bootloader for <board>"
949 @
$(ECHO
) " Supported boards are ($(BL_BOARDS))"
950 @
$(ECHO
) " bl_<board>_clean - Remove bootloader for <board>"
951 @
$(ECHO
) " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
953 @
$(ECHO
) " [Entire Flash]"
954 @
$(ECHO
) " ef_<board> - Build entire flash image for <board>"
955 @
$(ECHO
) " Supported boards are ($(EF_BOARDS))"
956 @
$(ECHO
) " ef_<board>_clean - Remove entire flash image for <board>"
957 @
$(ECHO
) " ef_<board>_program - Use OpenOCD + JTAG to write entire flash image to <board>"
959 @
$(ECHO
) " [Bootloader Updater]"
960 @
$(ECHO
) " bu_<board> - Build bootloader updater for <board>"
961 @
$(ECHO
) " Supported boards are ($(BU_BOARDS))"
962 @
$(ECHO
) " bu_<board>_clean - Remove bootloader updater for <board>"
964 @
$(ECHO
) " [Unbrick a board]"
965 @
$(ECHO
) " unbrick_<board> - Use the STM32's built in boot ROM to write a bootloader to <board>"
966 @
$(ECHO
) " Supported boards are ($(BL_BOARDS))"
967 @
$(ECHO
) " [Unittests]"
968 @
$(ECHO
) " ut_<test> - Build unit test <test>"
969 @
$(ECHO
) " ut_<test>_xml - Run test and capture XML output into a file"
970 @
$(ECHO
) " ut_<test>_run - Run test and dump output to console"
972 @
$(ECHO
) " [Simulation]"
973 @
$(ECHO
) " sim_osx - Build OpenPilot simulation firmware for OSX"
974 @
$(ECHO
) " sim_osx_clean - Delete all build output for the osx simulation"
975 @
$(ECHO
) " sim_win32 - Build OpenPilot simulation firmware for Windows"
976 @
$(ECHO
) " using mingw and msys"
977 @
$(ECHO
) " sim_win32_clean - Delete all build output for the win32 simulation"
980 @
$(ECHO
) " gcs - Build the Ground Control System (GCS) application (debug|release)"
981 @
$(ECHO
) " Compile specific directory: MAKE_DIR=<dir>"
982 @
$(ECHO
) " Example: make gcs MAKE_DIR=src/plugins/coreplugin"
983 @
$(ECHO
) " gcs_qmake - Run qmake for the Ground Control System (GCS) application (debug|release)"
984 @
$(ECHO
) " gcs_clean - Remove the Ground Control System (GCS) application (debug|release)"
985 @
$(ECHO
) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
987 @
$(ECHO
) " [Uploader Tool]"
988 @
$(ECHO
) " uploader - Build the serial uploader tool (debug|release)"
989 @
$(ECHO
) " uploader_qmake - Run qmake for the serial uploader tool (debug|release)"
990 @
$(ECHO
) " uploader_clean - Remove the serial uploader tool (debug|release)"
991 @
$(ECHO
) " Supported build configurations: GCS_BUILD_CONF=debug|release (default is $(GCS_BUILD_CONF))"
994 @
$(ECHO
) " [UAVObjects]"
995 @
$(ECHO
) " uavobjects - Generate source files from the UAVObject definition XML files"
996 @
$(ECHO
) " uavobjects_test - Parse xml-files - check for valid, duplicate ObjId's, ..."
997 @
$(ECHO
) " uavobjects_<group> - Generate source files from a subset of the UAVObject definition XML files"
998 @
$(ECHO
) " Supported groups are ($(UAVOBJ_TARGETS))"
1000 @
$(ECHO
) " [Packaging]"
1001 @
$(ECHO
) " package - Build and package the OpenPilot platform-dependent package (no clean)"
1002 @
$(ECHO
) " opfw_resource - Generate resources to embed firmware binaries into the GCS"
1003 @
$(ECHO
) " dist - Generate source archive for distribution"
1004 @
$(ECHO
) " install - Install GCS to \"DESTDIR\" with prefix \"prefix\" (Linux only)"
1006 @
$(ECHO
) " [Code Formatting]"
1007 @
$(ECHO
) " uncrustify_<source> - Reformat <source> code according to the project's standards"
1008 @
$(ECHO
) " Supported sources are ($(UNCRUSTIFY_TARGETS))"
1009 @
$(ECHO
) " uncrustify_all - Reformat all source code"
1011 @
$(ECHO
) " [Code Documentation]"
1012 @
$(ECHO
) " docs_<source> - Generate HTML documentation for <source>"
1013 @
$(ECHO
) " Supported sources are ($(DOCS_TARGETS))"
1014 @
$(ECHO
) " docs_all - Generate HTML documentation for all"
1015 @
$(ECHO
) " docs_<source>_clean - Delete generated documentation for <source>"
1016 @
$(ECHO
) " docs_all_clean - Delete all generated documentation"
1018 @
$(ECHO
) " [Configuration]"
1019 @
$(ECHO
) " config_new - Place your make arguments in the config file"
1020 @
$(ECHO
) " config_append - Place your make arguments in the config file but append"
1021 @
$(ECHO
) " config_clean - Removes the config file"
1023 @
$(ECHO
) " Hint: Add V=1 to your command line to see verbose build output."
1025 @
$(ECHO
) " Notes: All tool distribution files will be downloaded into $(DL_DIR)"
1026 @
$(ECHO
) " All tools will be installed into $(TOOLS_DIR)"
1027 @
$(ECHO
) " All build output will be placed in $(BUILD_DIR)"
1029 @
$(ECHO
) " Tool download and install directories can be changed using environment variables:"
1030 @
$(ECHO
) " DL_DIR full path to downloads directory [downloads if not set]"
1031 @
$(ECHO
) " TOOLS_DIR full path to installed tools directory [tools if not set]"
1032 @
$(ECHO
) " More info: http://wiki.openpilot.org/display/Doc/OpenPilot+Build+System+Overview"