1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-15 09:33:50 +01:00

Makefile.include: use programmer wrapper to silent output

This commit is contained in:
Alexandre Abadie 2021-02-09 17:49:56 +01:00
parent 976eda9cbb
commit c181ba2fe4
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 31 additions and 2 deletions

View File

@ -709,10 +709,13 @@ distclean:
-@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i distclean ; done
-@rm -rf $(BINDIRBASE)
# Include PROGRAMMER_FLASH/PROGRAMMER_RESET variables
include $(RIOTMAKE)/tools/programmer.inc.mk
# Define flash-recipe with a default value
define default-flash-recipe
$(call check_cmd,$(FLASHER),Flash program)
$(FLASHER) $(FFLAGS)
$(PROGRAMMER_FLASH)
endef
flash-recipe ?= $(default-flash-recipe)
@ -774,7 +777,7 @@ endif
reset:
$(call check_cmd,$(RESET),Reset program)
$(RESET) $(RESET_FLAGS)
$(PROGRAMMER_RESET)
# tests related targets and variables
include $(RIOTMAKE)/tests/tests.inc.mk

View File

@ -0,0 +1,26 @@
# Configure the programmer related variables
PROGRAMMER_QUIET ?= $(QUIET)
ifeq (0,$(PROGRAMMER_QUIET))
PROGRAMMER_VERBOSE_OPT ?= --verbose
endif
# Don't use the programmer wrapper for the CI (where speed and verbose output
# are important)
ifneq (1,$(RIOT_CI_BUILD))
USE_PROGRAMMER_WRAPPER_SCRIPT ?= 1
else
USE_PROGRAMMER_WRAPPER_SCRIPT ?= 0
endif
ifeq (1,$(USE_PROGRAMMER_WRAPPER_SCRIPT))
PROGRAMMER_FLASH ?= @$(RIOTTOOLS)/programmer/programmer.py \
--action Flashing --cmd "$(FLASHER) $(FFLAGS)" \
--programmer "$(PROGRAMMER)" $(PROGRAMMER_VERBOSE_OPT)
PROGRAMMER_RESET ?= @$(RIOTTOOLS)/programmer/programmer.py \
--action Resetting --cmd "$(RESET) $(RESET_FLAGS)" \
--programmer "$(PROGRAMMER)" $(PROGRAMMER_VERBOSE_OPT)
else
PROGRAMMER_FLASH ?= $(FLASHER) $(FFLAGS)
PROGRAMMER_RESET ?= $(RESET) $(RESET_FLAGS)
endif