1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

Merge pull request #10440 from jcarrano/no-export-ports

makefiles: remove exports so that PORT is not evaluated if it's not needed.
This commit is contained in:
Francisco 2019-09-12 13:50:24 +02:00 committed by GitHub
commit 2d890db6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 24 deletions

View File

@ -69,9 +69,9 @@ export LINKFLAGS += -ffunction-sections
# set the tap interface for term/valgrind
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
export PORT ?= tap0
PORT ?= tap0
else
export PORT =
PORT =
endif
TERMFLAGS := $(PORT) $(TERMFLAGS)

View File

@ -41,29 +41,14 @@ solution):
# Add serial matching command
ifneq ($(PROGRAMMER_SERIAL),)
OOCD_BOARD_FLAGS += -c 'ftdi_serial $(PROGRAMMER_SERIAL)'
ifeq ($(PORT),)
# try to find tty name by serial number, only works on Linux currently.
ifeq ($(OS),Linux)
PORT := $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh "^$(PROGRAMMER_SERIAL)$$"))
endif
endif
endif
# Fallback PORT if no serial was specified or if the specified serial was not found
ifeq ($(PORT),)
ifeq ($(OS),Linux)
PORT := $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh))
else ifeq ($(OS),Darwin)
PORT := $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
endif
endif
PORT_LINUX_EXACT = $(if $(PROGRAMMER_SERIAL),$(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh "^$(PROGRAMMER_SERIAL)$$")),)
PORT_LINUX = $(if $(PORT_LINUX_EXACT),$(PORT_LINUX_EXACT),$(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh)))
PORT_DARWIN = $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1)
# TODO: add support for windows as host platform
ifeq ($(PORT),)
$(info CAUTION: No terminal port for your host system found!)
endif
export PORT
Limitations

View File

@ -8,7 +8,6 @@ endif
ifeq ($(PORT),)
$(info Warning: no PORT set!)
endif
export PORT
export BAUD ?= 115200

View File

@ -75,7 +75,7 @@ export GIT_CACHE_DIR # path to git-cache cache directory
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.
export PORT # The port to connect the TERMPROG to.
# 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.
# BINFILE # The 'binary' stripped result of the compilation.