From 2c3c275694eaf33e76ff58304adb57b89545a5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 10 Oct 2019 11:52:20 +0200 Subject: [PATCH 1/3] Makefile.include: also do 'cleanterm' after 'flash-only' Harmonize with `term`. --- Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index 4acf053677..2c20082144 100644 --- a/Makefile.include +++ b/Makefile.include @@ -646,7 +646,7 @@ term: $(filter flash flash-only, $(MAKECMDGOALS)) $(TERMDEPS) # Term without the pyterm added logging # TERMFLAGS must be exported for `jlink.sh term_rtt`. cleanterm: export PYTERMFLAGS += --noprefix --no-repeat-command-on-empty-line -cleanterm: $(filter flash, $(MAKECMDGOALS)) $(TERMDEPS) +cleanterm: $(filter flash flash-only, $(MAKECMDGOALS)) $(TERMDEPS) $(call check_cmd,$(TERMPROG),Terminal program) $(TERMPROG) $(TERMFLAGS) From 4fe875c92f73a20c99f270838a8aee2c768bfdcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 10 Oct 2019 11:53:54 +0200 Subject: [PATCH 2/3] Makefile.include/term: define 'flash/flash-only' as TERMFLASHDEPS This puts the handling of `flash/flash-only` in common for both `term/cleanterm` commands. --- Makefile.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.include b/Makefile.include index 2c20082144..a12d242b33 100644 --- a/Makefile.include +++ b/Makefile.include @@ -637,16 +637,17 @@ flash-only: $(FLASHDEPS) preflash: $(BUILD_BEFORE_FLASH) $(PREFLASHER) $(PREFFLAGS) +TERMFLASHDEPS ?= $(filter flash flash-only,$(MAKECMDGOALS)) termdeps: $(TERMDEPS) -term: $(filter flash flash-only, $(MAKECMDGOALS)) $(TERMDEPS) +term: $(TERMFLASHDEPS) $(TERMDEPS) $(call check_cmd,$(TERMPROG),Terminal program) $(TERMPROG) $(TERMFLAGS) # Term without the pyterm added logging # TERMFLAGS must be exported for `jlink.sh term_rtt`. cleanterm: export PYTERMFLAGS += --noprefix --no-repeat-command-on-empty-line -cleanterm: $(filter flash flash-only, $(MAKECMDGOALS)) $(TERMDEPS) +cleanterm: $(TERMFLASHDEPS) $(TERMDEPS) $(call check_cmd,$(TERMPROG),Terminal program) $(TERMPROG) $(TERMFLAGS) From 18ae34609c5923c69035dcf0a641369fe719d118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 10 Oct 2019 11:56:57 +0200 Subject: [PATCH 3/3] Makefile.include: put TERMFLASHDEPS in TERMDEPS This makes it now apply also to `test` automatically. --- Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.include b/Makefile.include index a12d242b33..fb24530257 100644 --- a/Makefile.include +++ b/Makefile.include @@ -638,16 +638,18 @@ preflash: $(BUILD_BEFORE_FLASH) $(PREFLASHER) $(PREFFLAGS) TERMFLASHDEPS ?= $(filter flash flash-only,$(MAKECMDGOALS)) +# Add TERMFLASHDEPS to TERMDEPS so it also applies to `test` +TERMDEPS += $(TERMFLASHDEPS) termdeps: $(TERMDEPS) -term: $(TERMFLASHDEPS) $(TERMDEPS) +term: $(TERMDEPS) $(call check_cmd,$(TERMPROG),Terminal program) $(TERMPROG) $(TERMFLAGS) # Term without the pyterm added logging # TERMFLAGS must be exported for `jlink.sh term_rtt`. cleanterm: export PYTERMFLAGS += --noprefix --no-repeat-command-on-empty-line -cleanterm: $(TERMFLASHDEPS) $(TERMDEPS) +cleanterm: $(TERMDEPS) $(call check_cmd,$(TERMPROG),Terminal program) $(TERMPROG) $(TERMFLAGS)