2015-05-20 21:11:20 -03:00
|
|
|
default: help
|
2013-02-21 00:43:25 -04:00
|
|
|
|
|
|
|
# convenient targets for our supported boards
|
2015-05-04 03:18:15 -03:00
|
|
|
sitl: HAL_BOARD = HAL_BOARD_SITL
|
2013-02-21 00:43:25 -04:00
|
|
|
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)
|
2013-02-21 00:43:25 -04:00
|
|
|
|
2013-09-23 00:01:42 -03:00
|
|
|
flymaple: HAL_BOARD = HAL_BOARD_FLYMAPLE
|
|
|
|
flymaple: TOOLCHAIN = ARM
|
|
|
|
flymaple: all
|
2013-12-01 20:17:29 -04:00
|
|
|
flymaple-hil: EXTRAFLAGS += "-DHIL_MODE=HIL_MODE_ATTITUDE "
|
|
|
|
flymaple-hil: flymaple
|
2013-09-23 00:01:42 -03:00
|
|
|
|
2013-09-22 03:04:08 -03:00
|
|
|
linux: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
linux: TOOLCHAIN = NATIVE
|
2016-05-06 11:29:36 -03:00
|
|
|
linux: BUILDSYS_DEPRECATED = 1
|
2013-09-22 03:04:08 -03:00
|
|
|
linux: all
|
|
|
|
|
2015-09-21 07:34:54 -03:00
|
|
|
erleboard: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
erleboard: TOOLCHAIN = BBONE
|
2016-05-06 11:29:36 -03:00
|
|
|
erleboard: BUILDSYS_DEPRECATED = 1
|
2015-09-21 07:34:54 -03:00
|
|
|
erleboard: all
|
2014-07-13 19:52:43 -03:00
|
|
|
|
2014-11-13 19:18:14 -04:00
|
|
|
zynq: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
zynq: TOOLCHAIN = ZYNQ
|
|
|
|
zynq: all
|
|
|
|
zynq-hil: EXTRAFLAGS += "-DHILMODE=HIL_MODE_ATTITUDE -DHIL_MODE=HIL_MODE_SENSORS "
|
|
|
|
zynq-hil : zynq
|
|
|
|
|
2014-07-06 23:04:54 -03:00
|
|
|
pxf: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
pxf: TOOLCHAIN = BBONE
|
2016-05-06 11:29:36 -03:00
|
|
|
pxf: BUILDSYS_DEPRECATED = 1
|
2014-07-06 23:04:54 -03:00
|
|
|
pxf: all
|
2014-07-06 20:37:27 -03:00
|
|
|
|
2015-07-09 21:23:12 -03:00
|
|
|
bebop: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
bebop: TOOLCHAIN = BBONE
|
2015-11-09 14:50:03 -04:00
|
|
|
bebop: LDFLAGS += "-static"
|
2016-05-06 11:29:36 -03:00
|
|
|
bebop: BUILDSYS_DEPRECATED = 1
|
2015-07-09 21:23:12 -03:00
|
|
|
bebop: all
|
|
|
|
|
2015-08-11 18:45:42 -03:00
|
|
|
minlure: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
minlure: TOOLCHAIN = NATIVE
|
2016-05-06 11:29:36 -03:00
|
|
|
minlure: BUILDSYS_DEPRECATED = 1
|
2015-08-11 18:45:42 -03:00
|
|
|
minlure: all
|
|
|
|
|
2014-07-23 07:13:55 -03:00
|
|
|
navio: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
navio: TOOLCHAIN = RPI
|
2016-05-06 11:29:36 -03:00
|
|
|
navio: BUILDSYS_DEPRECATED = 1
|
2014-07-23 07:13:55 -03:00
|
|
|
navio: all
|
|
|
|
|
2016-01-20 08:30:00 -04:00
|
|
|
navio2: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
navio2: TOOLCHAIN = RPI
|
2016-05-06 11:29:36 -03:00
|
|
|
navio2: BUILDSYS_DEPRECATED = 1
|
2016-01-20 08:30:00 -04:00
|
|
|
navio2: all
|
|
|
|
|
2015-08-17 23:25:02 -03:00
|
|
|
raspilot: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
raspilot: TOOLCHAIN = RPI
|
2016-05-06 11:29:36 -03:00
|
|
|
raspilot: BUILDSYS_DEPRECATED = 1
|
2015-08-17 23:25:02 -03:00
|
|
|
raspilot: all
|
2015-12-13 23:18:37 -04:00
|
|
|
|
2015-11-01 07:29:23 -04:00
|
|
|
erlebrain2: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
erlebrain2: TOOLCHAIN = RPI
|
2016-05-06 11:29:36 -03:00
|
|
|
erlebrain2: BUILDSYS_DEPRECATED = 1
|
2015-11-01 07:29:23 -04:00
|
|
|
erlebrain2: all
|
2015-08-17 23:25:02 -03:00
|
|
|
|
2015-01-10 19:21:52 -04:00
|
|
|
bbbmini: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
bbbmini: TOOLCHAIN = BBONE
|
2016-05-06 11:29:36 -03:00
|
|
|
bbbmini: BUILDSYS_DEPRECATED = 1
|
2015-01-10 19:21:52 -04:00
|
|
|
bbbmini: all
|
|
|
|
|
2015-11-28 05:17:26 -04:00
|
|
|
bhat: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
bhat: TOOLCHAIN = RPI
|
2016-05-06 11:29:36 -03:00
|
|
|
bhat: BUILDSYS_DEPRECATED = 1
|
2015-11-28 05:17:26 -04:00
|
|
|
bhat: all
|
|
|
|
|
2016-05-06 11:29:36 -03:00
|
|
|
pxfmini: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
pxfmini: TOOLCHAIN = RPI
|
|
|
|
pxfmini: BUILDSYS_DEPRECATED = 1
|
|
|
|
pxfmini: all
|
|
|
|
|
2015-12-13 23:18:37 -04:00
|
|
|
qflight: HAL_BOARD = HAL_BOARD_LINUX
|
|
|
|
qflight: TOOLCHAIN = QFLIGHT
|
|
|
|
qflight: all
|
|
|
|
|
2013-02-21 00:43:25 -04:00
|
|
|
empty: HAL_BOARD = HAL_BOARD_EMPTY
|
|
|
|
empty: TOOLCHAIN = AVR
|
|
|
|
empty: all
|
|
|
|
|
2015-03-24 20:28:59 -03:00
|
|
|
qurt: HAL_BOARD = HAL_BOARD_QURT
|
|
|
|
qurt: TOOLCHAIN = QURT
|
|
|
|
qurt: all
|
|
|
|
|
2013-11-12 18:06:20 -04:00
|
|
|
# cope with HIL targets
|
2014-01-02 01:29:36 -04:00
|
|
|
%-hil: EXTRAFLAGS += "-DHIL_MODE=HIL_MODE_SENSORS "
|
2013-11-12 18:06:20 -04:00
|
|
|
%-hilsensors: EXTRAFLAGS += "-DHIL_MODE=HIL_MODE_SENSORS "
|
|
|
|
|
2014-04-06 18:28:50 -03:00
|
|
|
# cope with OBC targets
|
|
|
|
%-obc: EXTRAFLAGS += "-DOBC_FAILSAFE=ENABLED "
|
|
|
|
|
2015-05-17 18:13:07 -03:00
|
|
|
# support debug build
|
|
|
|
%-debug: OPTFLAGS = -g -O0
|
|
|
|
|
2015-11-10 01:21:41 -04:00
|
|
|
# support address sanitiser
|
|
|
|
%-asan: OPTFLAGS = -g -O0 -fsanitize=address -fno-omit-frame-pointer
|
|
|
|
%-asan: LDFLAGS += -fsanitize=address
|
|
|
|
|
2015-01-16 17:45:02 -04:00
|
|
|
# cope with -nologging
|
|
|
|
%-nologging: EXTRAFLAGS += "-DLOGGING_ENABLED=DISABLED "
|
|
|
|
|
2013-11-12 18:06:20 -04:00
|
|
|
# cope with copter and hil targets
|
2015-04-02 18:26:16 -03:00
|
|
|
FRAMES = quad tri hexa y6 octa octa-quad heli single coax obc nologging
|
2016-01-20 08:30:00 -04:00
|
|
|
BOARDS = apm1 apm2 apm2beta apm1-1280 px4 px4-v1 px4-v2 px4-v4 sitl flymaple linux vrbrain vrbrain-v40 vrbrain-v45 vrbrainv-50 vrbrain-v51 vrbrain-v52 vrubrain-v51 vrubrain-v52 vrhero-v10 erle pxf navio navio2 raspilot bbbmini minlure erlebrain2 bhat qflight pxfmini
|
2013-11-12 18:06:20 -04:00
|
|
|
|
|
|
|
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)
|
2015-05-17 18:13:07 -03:00
|
|
|
$(1)-$(2)-debug : $(1)-$(2)
|
2013-11-12 18:06:20 -04:00
|
|
|
$(1)-$(2)-hilsensors : $(1)-$(2)
|
2014-07-31 17:54:03 -03:00
|
|
|
$(1)-$(2)-upload : $(1)-$(2)
|
|
|
|
$(1)-$(2)-upload : $(1)-upload
|
2015-05-25 18:44:38 -03:00
|
|
|
endef
|
|
|
|
|
|
|
|
define board_template
|
2013-11-12 18:06:20 -04:00
|
|
|
$(1)-hil : $(1)
|
2015-05-17 18:13:07 -03:00
|
|
|
$(1)-debug : $(1)
|
2015-11-10 01:21:41 -04:00
|
|
|
$(1)-asan : $(1)
|
2013-11-12 18:06:20 -04:00
|
|
|
$(1)-hilsensors : $(1)
|
|
|
|
endef
|
|
|
|
|
2015-05-25 18:44:38 -03:00
|
|
|
USED_BOARDS := $(foreach board,$(BOARDS), $(findstring $(board), $(MAKECMDGOALS)))
|
|
|
|
USED_FRAMES := $(foreach frame,$(FRAMES), $(findstring $(frame), $(MAKECMDGOALS)))
|
|
|
|
#$(warning $(USED_BOARDS))
|
|
|
|
#$(warning $(USED_FRAMES))
|
2013-11-12 18:06:20 -04:00
|
|
|
# generate targets of the form BOARD-FRAME and BOARD-FRAME-HIL
|
2015-05-25 18:44:38 -03:00
|
|
|
$(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
|
|
|
|
|
2013-01-09 15:27:59 -04:00
|
|
|
.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)
|
2013-02-21 00:43:25 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -fr $(BUILDROOT)
|
2015-06-08 20:18:51 -03:00
|
|
|
|
|
|
|
include $(MK_DIR)/modules.mk
|
2016-01-02 01:03:59 -04:00
|
|
|
include $(MK_DIR)/mavgen.mk
|