From 702db3468dd80263980340e7060609873fd8db2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 24 Jan 2019 14:30:57 +0100 Subject: [PATCH] msba2: compile 'lpc2k_pgm' when flashing Add a rule to build `lpc2k_pgm` when flashing. It is only compiled if it is using the one in `tools`. If overwritten to `lpc2k_pgm` if it should be taken from the path, it is not compiled. The compilation is still done in `boards/common/msba2/tools` as it was the case before and this commit does not address this. --- boards/common/msba2/Makefile.include | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/boards/common/msba2/Makefile.include b/boards/common/msba2/Makefile.include index db624de2b4ed..fd5f5d39e198 100644 --- a/boards/common/msba2/Makefile.include +++ b/boards/common/msba2/Makefile.include @@ -1,7 +1,18 @@ +BOARDS_COMMON_MSBA2_DIR := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) + ## the cpu to build for export CPU = lpc2387 -FLASHER = lpc2k_pgm +# Compile `lpc2k_pgm` when required +# It is still compiling in `boards` as it was the case before introducing the +# rule to autobuild +MSBA2_TOOLS = $(BOARDS_COMMON_MSBA2_DIR)/tools +LPC2K_PGM = $(MSBA2_TOOLS)/bin/lpc2k_pgm +$(LPC2K_PGM): FORCE + env -i PATH=$(PATH) make -C $(MSBA2_TOOLS) +FLASHDEPS += $(if $(findstring $(LPC2K_PGM),$(FLASHER)),$(LPC2K_PGM)) + +FLASHER ?= $(LPC2K_PGM) # configure serial interface PORT_LINUX ?= /dev/ttyUSB0