Merge pull request #10548 from jcarrano/flash-canned-recipe
Makefile.include: flash: do not peek into MAKECMDGOALS.
This commit is contained in:
commit
321dc5292f
@ -512,16 +512,19 @@ distclean:
|
|||||||
-@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i distclean ; done
|
-@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i distclean ; done
|
||||||
-@rm -rf $(BINDIRBASE)
|
-@rm -rf $(BINDIRBASE)
|
||||||
|
|
||||||
# if make target != 'flash-only', add target 'all' to ensure build before flash
|
define flash-recipe
|
||||||
ifeq (,$(filter flash-only, $(MAKECMDGOALS)))
|
$(call check_cmd,$(FLASHER),Flash program)
|
||||||
BUILD_BEFORE_FLASH = all
|
$(FLASHER) $(FFLAGS)
|
||||||
endif
|
endef
|
||||||
|
|
||||||
flash: $(BUILD_BEFORE_FLASH) $(FLASHDEPS)
|
# Do not add dependencies to "flash" directly, use FLASHDEPS, as this is shared
|
||||||
$(call check_cmd,$(FLASHER),Flash program)
|
# with flash-only too
|
||||||
$(FLASHER) $(FFLAGS)
|
|
||||||
|
|
||||||
flash-only: flash
|
flash: all $(FLASHDEPS)
|
||||||
|
$(flash-recipe)
|
||||||
|
|
||||||
|
flash-only: $(FLASHDEPS)
|
||||||
|
$(flash-recipe)
|
||||||
|
|
||||||
preflash: $(BUILD_BEFORE_FLASH)
|
preflash: $(BUILD_BEFORE_FLASH)
|
||||||
$(PREFLASHER) $(PREFFLAGS)
|
$(PREFLASHER) $(PREFFLAGS)
|
||||||
|
|||||||
@ -23,8 +23,7 @@ export OPENOCD_PRE_VERIFY_CMDS += \
|
|||||||
-c 'resume 0x20000000'
|
-c 'resume 0x20000000'
|
||||||
export OPENOCD_EXTRA_INIT
|
export OPENOCD_EXTRA_INIT
|
||||||
|
|
||||||
.PHONY: flash
|
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
||||||
flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
|
||||||
|
|
||||||
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg
|
export OPENOCD_CONFIG ?= $(RIOTBOARD)/common/frdm/dist/old-openocd-$(CPU_FAMILY).cfg
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -58,8 +58,7 @@ export OPENOCD_PRE_VERIFY_CMDS += \
|
|||||||
-c 'resume 0x20000000'
|
-c 'resume 0x20000000'
|
||||||
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh
|
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/$(CPU)/dist/check-fcfield-elf.sh
|
||||||
|
|
||||||
.PHONY: flash
|
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
||||||
flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
|
||||||
|
|
||||||
# this board uses openocd
|
# this board uses openocd
|
||||||
include $(RIOTMAKE)/tools/openocd.inc.mk
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|
||||||
|
|||||||
@ -10,8 +10,7 @@ export CPU_MODEL ?= mkw21d256vha5
|
|||||||
PORT_LINUX ?= /dev/ttyACM0
|
PORT_LINUX ?= /dev/ttyACM0
|
||||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||||
|
|
||||||
.PHONY: flash
|
FLASHDEPS += $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
||||||
flash: $(RIOTCPU)/$(CPU)/dist/wdog-disable.bin
|
|
||||||
|
|
||||||
# We need special handling of the watchdog if we want to speed up the flash
|
# 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.
|
# verification by using the MCU to compute the image checksum after flashing.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user