ardupilot/mk/targets.mk

95 lines
2.6 KiB
Makefile
Raw Normal View History

default: help
# convenient targets for our supported boards
2015-05-04 03:18:15 -03:00
sitl: HAL_BOARD = HAL_BOARD_SITL
sitl: TOOLCHAIN = NATIVE
sitl: all
2015-05-04 03:18:15 -03:00
sitl-arm: HAL_BOARD = HAL_BOARD_SITL
2015-05-03 19:11:04 -03:00
sitl-arm: TOOLCHAIN = RPI
sitl-arm: all
2015-11-03 10:10:19 -04:00
apm1 apm1-1280 apm2 apm2beta:
$(error $@ is deprecated on master branch; use master-AVR)
2016-05-23 09:50:58 -03:00
flymaple flymaple-hil:
$(error $@ is deprecated on master branch; use master-AVR)
2018-02-02 16:35:19 -04:00
f4light: HAL_BOARD = HAL_BOARD_F4LIGHT
f4light: TOOLCHAIN = ARM
f4light: all
2015-12-13 23:18:37 -04:00
qflight: HAL_BOARD = HAL_BOARD_LINUX
qflight: TOOLCHAIN = QFLIGHT
qflight: all
2015-03-24 20:28:59 -03:00
qurt: HAL_BOARD = HAL_BOARD_QURT
qurt: TOOLCHAIN = QURT
qurt: all
# cope with HIL targets
2014-01-02 01:29:36 -04:00
%-hil: EXTRAFLAGS += "-DHIL_MODE=HIL_MODE_SENSORS "
%-hilsensors: EXTRAFLAGS += "-DHIL_MODE=HIL_MODE_SENSORS "
2014-04-06 18:28:50 -03:00
# cope with OBC targets
%-obc: EXTRAFLAGS += "-DOBC_FAILSAFE=ENABLED "
# support debug build
%-debug: OPTFLAGS = -g -O0
# support address sanitiser
%-asan: OPTFLAGS = -g -O0 -fsanitize=address -fno-omit-frame-pointer
%-asan: LDFLAGS += -fsanitize=address
# cope with copter and hil targets
2017-01-09 06:17:02 -04:00
FRAMES = heli
BOARDS = apm1 apm2 apm2beta apm1-1280 px4-v1 px4-v2 px4-v3 px4-v4 px4-v4pro sitl flymaple
BOARDS += vrbrain
BOARDS += vrbrain-v51 vrbrain-v52 vrbrain-v52E vrbrain-v54
BOARDS += vrcore-v10
BOARDS += vrubrain-v51 vrubrain-v52
define frame_template
$(1)-$(2) : EXTRAFLAGS += "-DFRAME_CONFIG=$(shell echo $(2) | tr a-z A-Z | sed s/-/_/g)_FRAME "
$(1)-$(2) : $(1)
$(1)-$(2)-hil : $(1)-$(2)
$(1)-$(2)-debug : $(1)-$(2)
$(1)-$(2)-mavlink1 : $(1)-$(2)
$(1)-$(2)-debug-mavlink1 : $(1)-$(2)
$(1)-$(2)-hilsensors : $(1)-$(2)
$(1)-$(2)-upload : $(1)-$(2)
$(1)-$(2)-upload : $(1)-upload
endef
define board_template
$(1)-hil : $(1)
$(1)-debug : $(1)
$(1)-mavlink1 : $(1)
$(1)-debug-mavlink1 : $(1)-debug
$(1)-asan : $(1)
$(1)-hilsensors : $(1)
endef
USED_BOARDS := $(foreach board,$(BOARDS), $(findstring $(board), $(MAKECMDGOALS)))
USED_FRAMES := $(foreach frame,$(FRAMES), $(findstring $(frame), $(MAKECMDGOALS)))
# generate targets of the form BOARD-FRAME and BOARD-FRAME-HIL
$(foreach board,$(USED_BOARDS),$(eval $(call board_template,$(board))))
$(foreach board,$(USED_BOARDS),$(foreach frame,$(USED_FRAMES),$(eval $(call frame_template,$(board),$(frame)))))
2012-12-18 17:53:44 -04:00
2012-12-18 20:33:23 -04:00
sitl-mount: EXTRAFLAGS += "-DMOUNT=ENABLED"
sitl-mount: sitl
.PHONY: etags
2012-12-18 17:53:44 -04:00
etags:
2013-02-10 22:52:37 -04:00
cd .. && etags -f ArduCopter/TAGS --lang=c++ $$(git ls-files ArduCopter libraries)
cd .. && etags -f ArduPlane/TAGS --lang=c++ $$(git ls-files ArduPlane libraries)
cd .. && etags -f APMrover2/TAGS --lang=c++ $$(git ls-files APMrover2 libraries)
clean:
@rm -fr $(BUILDROOT)
include $(MK_DIR)/modules.mk
include $(MK_DIR)/uavcangen.mk
include $(MK_DIR)/mavgen.mk