1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #14664 from miri64/make/feat/termlog

Makefile.include: add capability to log `make term` to file
This commit is contained in:
Martine Lenders 2020-08-05 17:45:07 +02:00 committed by GitHub
commit b9a4a5ead7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -715,6 +715,9 @@ flash-only: $(FLASHDEPS)
preflash: $(BUILD_BEFORE_FLASH)
$(PREFLASHER_PREFIX)$(PREFLASHER) $(PREFFLAGS)
ifneq (,$(TERMLOG)$(TERMTEE))
TERMTEE ?= | tee -a $(TERMLOG)
endif
TERMFLASHDEPS ?= $(filter flash flash-only,$(MAKECMDGOALS))
# Add TERMFLASHDEPS to TERMDEPS so it also applies to `test`
TERMDEPS += $(TERMFLASHDEPS)
@ -722,14 +725,14 @@ termdeps: $(TERMDEPS)
term: $(TERMDEPS)
$(call check_cmd,$(TERMPROG),Terminal program)
$(TERMPROG) $(TERMFLAGS)
$(TERMPROG) $(TERMFLAGS) $(TERMTEE)
# Term without the pyterm added logging
# PYTERMFLAGS must be exported for `jlink.sh term-rtt`.
cleanterm: export PYTERMFLAGS += --no-reconnect --noprefix --no-repeat-command-on-empty-line
cleanterm: $(TERMDEPS)
$(call check_cmd,$(TERMPROG),Terminal program)
$(TERMPROG) $(TERMFLAGS)
$(TERMPROG) $(TERMFLAGS) $(TERMTEE)
list-ttys:
$(Q)$(RIOTTOOLS)/usb-serial/list-ttys.sh

View File

@ -92,6 +92,8 @@ export WPEDANTIC # Issue all (extensive) compiler warnings demanded
export FLASH_ADDR # Define an offset to flash code into ROM memory.
# TERMPROG # The command to call on "make term".
# TERMFLAGS # Additional parameters to supply to TERMPROG.
# TERMLOG # Optional file to log "make term" output to.
# TERMTEE # Optional pipe to redirect "make term" output. Default: '| tee -a ${TERMLOG}' when TERMLOG is defined else undefined.
# PORT # The port to connect the TERMPROG to.
export ELFFILE # The unstripped result of the compilation.
export HEXFILE # The 'intel hex' stripped result of the compilation.