Skip to content

Commit

Permalink
build: remove Linux boards from make
Browse files Browse the repository at this point in the history
This way people don't copy and paste to add a new board: make build
system is deprecated for Linux boards for a long time and is now
unsupported.

qflight remains as the only Linux board since it's not buildable
with waf. When it is, more files and pieces can be removed from mk/.
  • Loading branch information
lucasdemarchi committed Sep 11, 2017
1 parent 697131e commit c09c56b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 174 deletions.
66 changes: 0 additions & 66 deletions mk/environ.mk
Original file line number Diff line number Diff line change
Expand Up @@ -136,57 +136,6 @@ HAL_BOARD = HAL_BOARD_SITL
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_NONE
endif

ifneq ($(findstring linux, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_NONE
endif

ifneq ($(findstring erleboard, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_ERLEBOARD
endif

ifneq ($(findstring zynq, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_ZYNQ
endif

ifneq ($(findstring pxf, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_PXF
endif

ifneq ($(findstring bebop, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_BEBOP
endif


ifneq ($(findstring navio, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_NAVIO
endif

ifneq ($(findstring raspilot, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_RASPILOT
endif

ifneq ($(findstring erlebrain2, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_ERLEBRAIN2
endif

ifneq ($(findstring bbbmini, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_BBBMINI
endif

ifneq ($(findstring minlure, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_MINLURE
endif

ifneq ($(findstring vrbrain, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_VRBRAIN
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_NONE
Expand All @@ -202,11 +151,6 @@ HAL_BOARD = HAL_BOARD_VRBRAIN
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_NONE
endif

ifneq ($(findstring bhat, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_BH
endif

ifneq ($(findstring qflight, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_QFLIGHT
Expand All @@ -217,18 +161,8 @@ HAL_BOARD = HAL_BOARD_QURT
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_NONE
endif

ifneq ($(findstring pxfmini, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_PXFMINI
endif

# default to SITL
ifeq ($(HAL_BOARD),)
HAL_BOARD = HAL_BOARD_SITL
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_NONE
endif

ifneq ($(findstring navio2, $(MAKECMDGOALS)),)
HAL_BOARD = HAL_BOARD_LINUX
HAL_BOARD_SUBTYPE = HAL_BOARD_SUBTYPE_LINUX_NAVIO2
endif
26 changes: 4 additions & 22 deletions mk/find_tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@ NATIVE_OBJCOPY := objcopy

AVARICE := $(call FIND_TOOL,avarice)

# toolchains for beagleboneblack
BBONE_CXX := arm-linux-gnueabihf-g++
BBONE_CC := arm-linux-gnueabihf-gcc
BBONE_AS := arm-linux-gnueabihf-gcc
BBONE_AR := ar
BBONE_LD := arm-linux-gnueabihf-g++
BBONE_GDB := gdb
BBONE_OBJCOPY := objcopy
# enable ccache if installed
CCACHE := $(call FIND_TOOL,ccache)
export CCACHE

# toolchains for Raspberry Pi
# toolchain used for sitl-arm
RPI_CXX := arm-linux-gnueabihf-g++
RPI_CC := arm-linux-gnueabihf-gcc
RPI_AS := arm-linux-gnueabihf-gcc
Expand All @@ -54,19 +49,6 @@ RPI_LD := arm-linux-gnueabihf-g++
RPI_GDB := arm-linux-gnueabihf-gdb
RPI_OBJCOPY := arm-linux-gnueabihf-obj

# toolchains for zynq
ZYNQ_CXX := arm-xilinx-linux-gnueabi-g++
ZYNQ_CC := arm-xilinx-linux-gnueabi-gcc
ZYNQ_AS := arm-xilinx-linux-gnueabi-gcc
ZYNQ_AR := arm-xilinx-linux-gnueabi-ar
ZYNQ_LD := arm-xilinx-linux-gnueabi-g++
ZYNQ_GDB := arm-xilinx-linux-gnueabi-gdb
ZYNQ_OBJCOPY := arm-xilinx-linux-gnueabi-objcopy

# enable ccache if installed
CCACHE := $(call FIND_TOOL,ccache)
export CCACHE

CXX = $(CCACHE) $($(TOOLCHAIN)_CXX)
CC = $(CCACHE) $($(TOOLCHAIN)_CC)
AS = $($(TOOLCHAIN)_AS)
Expand Down
15 changes: 3 additions & 12 deletions mk/help.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ help:
@echo " The following web page has detailed information on building the code"
@echo " http://dev.ardupilot.org/wiki/building-the-code/"
@echo ""
@echo " Linux boards should use waf build system"
@echo ""
@echo " Before building a target you need to be in the target vehicle type directory"
@echo " e.g. ArduPlane, ArduCopter, APMrover2, AntennaTracker"
@echo ""
Expand All @@ -17,25 +19,14 @@ help:
@echo ""
@echo " Note that the px4 builds are NOT parallel safe, NO -j flag"
@echo ""
@echo ""
@echo " Targets"
@echo " -------"
@echo ""
@echo " px4-v1 - the PX4v1 board"
@echo " px4-v2 - the Pixhawk"
@echo " px4-v3 - the Pixhawk with 2M flash"
@echo " px4-v4 - the XRacer"
@echo " pxf - the Beagle Bone Black (BBB) + PXF cape combination"
@echo " navio - the RaspberryPi + NavIO cape combination"
@echo " linux - a generic Linux build"
@echo " vrbrain - the VRBrain boards"
@echo " sitl - the SITL Software In The Loop simulation"
@echo " bbbmini - the Beagle Bone Black mini"
@echo " bebop - the Parrot Bebop"
@echo " raspilot - the RaspberryPi + pilot cape combination"
@echo " erleboard - the ErleBoard legacy design"
@echo " minlure - the drone lure for MinnowBoard and others"
@echo " qflight - qualcomm flight board"
@echo " erlebrain2 - the Erle-Brain 2 board"
@echo " bhat - the RaspberryPi + BH HAT combination"
@echo " pxfmini - the RaspberryPi Zero + PXFmini cape combination"
@echo " navio2 - the RaspberryPi + NavIO2 cape combination"
76 changes: 2 additions & 74 deletions mk/targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,81 +15,10 @@ apm1 apm1-1280 apm2 apm2beta:
flymaple flymaple-hil:
$(error $@ is deprecated on master branch; use master-AVR)

linux: HAL_BOARD = HAL_BOARD_LINUX
linux: TOOLCHAIN = NATIVE
linux: BUILDSYS_DEPRECATED = 1
linux: all

erleboard: HAL_BOARD = HAL_BOARD_LINUX
erleboard: TOOLCHAIN = BBONE
erleboard: BUILDSYS_DEPRECATED = 1
erleboard: all

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

pxf: HAL_BOARD = HAL_BOARD_LINUX
pxf: TOOLCHAIN = BBONE
pxf: BUILDSYS_DEPRECATED = 1
pxf: all

bebop: HAL_BOARD = HAL_BOARD_LINUX
bebop: TOOLCHAIN = BBONE
bebop: LDFLAGS += "-static"
bebop: BUILDSYS_DEPRECATED = 1
bebop: all

minlure: HAL_BOARD = HAL_BOARD_LINUX
minlure: TOOLCHAIN = NATIVE
minlure: BUILDSYS_DEPRECATED = 1
minlure: all

navio: HAL_BOARD = HAL_BOARD_LINUX
navio: TOOLCHAIN = RPI
navio: BUILDSYS_DEPRECATED = 1
navio: all

navio2: HAL_BOARD = HAL_BOARD_LINUX
navio2: TOOLCHAIN = RPI
navio2: BUILDSYS_DEPRECATED = 1
navio2: all

raspilot: HAL_BOARD = HAL_BOARD_LINUX
raspilot: TOOLCHAIN = RPI
raspilot: BUILDSYS_DEPRECATED = 1
raspilot: all

erlebrain2: HAL_BOARD = HAL_BOARD_LINUX
erlebrain2: TOOLCHAIN = RPI
erlebrain2: BUILDSYS_DEPRECATED = 1
erlebrain2: all

bbbmini: HAL_BOARD = HAL_BOARD_LINUX
bbbmini: TOOLCHAIN = BBONE
bbbmini: BUILDSYS_DEPRECATED = 1
bbbmini: all

bhat: HAL_BOARD = HAL_BOARD_LINUX
bhat: TOOLCHAIN = RPI
bhat: BUILDSYS_DEPRECATED = 1
bhat: all

pxfmini: HAL_BOARD = HAL_BOARD_LINUX
pxfmini: TOOLCHAIN = RPI
pxfmini: BUILDSYS_DEPRECATED = 1
pxfmini: all

qflight: HAL_BOARD = HAL_BOARD_LINUX
qflight: TOOLCHAIN = QFLIGHT
qflight: all

empty: HAL_BOARD = HAL_BOARD_EMPTY
empty: TOOLCHAIN = AVR
empty: all

qurt: HAL_BOARD = HAL_BOARD_QURT
qurt: TOOLCHAIN = QURT
qurt: all
Expand All @@ -110,7 +39,7 @@ qurt: all

# cope with copter and hil targets
FRAMES = heli
BOARDS = apm1 apm2 apm2beta apm1-1280 px4-v1 px4-v2 px4-v3 px4-v4 px4-v4pro sitl flymaple linux erle pxf navio navio2 raspilot bbbmini minlure erlebrain2 bhat qflight pxfmini
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-v54
BOARDS += vrcore-v10
Expand Down Expand Up @@ -139,8 +68,7 @@ endef

USED_BOARDS := $(foreach board,$(BOARDS), $(findstring $(board), $(MAKECMDGOALS)))
USED_FRAMES := $(foreach frame,$(FRAMES), $(findstring $(frame), $(MAKECMDGOALS)))
#$(warning $(USED_BOARDS))
#$(warning $(USED_FRAMES))

# 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)))))
Expand Down

0 comments on commit c09c56b

Please sign in to comment.