1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

Merge pull request #10548 from jcarrano/flash-canned-recipe

Makefile.include: flash: do not peek into MAKECMDGOALS.
This commit is contained in:
Gaëtan Harter 2018-12-18 14:09:55 +01:00 committed by GitHub
commit 321dc5292f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 14 deletions

View File

@ -512,16 +512,19 @@ distclean:
-@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i distclean ; done
-@rm -rf $(BINDIRBASE)
# if make target != 'flash-only', add target 'all' to ensure build before flash
ifeq (,$(filter flash-only, $(MAKECMDGOALS)))
BUILD_BEFORE_FLASH = all
endif
define flash-recipe
$(call check_cmd,$(FLASHER),Flash program)
$(FLASHER) $(FFLAGS)
endef
flash: $(BUILD_BEFORE_FLASH) $(FLASHDEPS)
$(call check_cmd,$(FLASHER),Flash program)
$(FLASHER) $(FFLAGS)
# Do not add dependencies to "flash" directly, use FLASHDEPS, as this is shared
# with flash-only too
flash-only: flash
flash: all $(FLASHDEPS)
$(flash-recipe)
flash-only: $(FLASHDEPS)
$(flash-recipe)
preflash: $(BUILD_BEFORE_FLASH)
$(PREFLASHER) $(PREFFLAGS)

View File

@ -23,8 +23,7 @@ export OPENOCD_PRE_VERIFY_CMDS += \
-c 'resume 0x20000000'
export OPENOCD_EXTRA_INIT
.PHONY: flash
flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg
endif

View File

@ -58,8 +58,7 @@ export OPENOCD_PRE_VERIFY_CMDS += \
-c 'resume 0x20000000'
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh
.PHONY: flash
flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
# this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

View File

@ -10,8 +10,7 @@ export CPU_MODEL ?= mkw21d256vha5
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
.PHONY: flash
flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
# We need special handling of the watchdog if we want to speed up the flash
# verification by using the MCU to compute the image checksum after flashing.