Skip to content

Commit

Permalink
Makefile.include: use programmer wrapper to silent output
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Feb 25, 2021
1 parent 976eda9 commit c181ba2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions makefiles/tools/programmer.inc.mk
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c181ba2

Please sign in to comment.