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

makefiles/tools/serial: ensure PORT is set and fail early.

By ensuring the PORT auto-detection worked, we can give meaningful
error messages and fail earlier.

This uses ensure_value from makefiles/utils/checks.mk. An include was
added to Makefile.include to make this fuction available to all other
makefiles.
This commit is contained in:
Juan Carrano 2018-11-06 18:59:15 +01:00 committed by Francisco Molina
parent 63be700fa7
commit fe9704dbd6
2 changed files with 5 additions and 5 deletions

View File

@ -106,6 +106,9 @@ OS := $(shell uname)
# set python path, e.g. for tests
PYTHONPATH := $(RIOTBASE)/dist/pythonlibs/:$(PYTHONPATH)
# Basic utilities included before anything else
include $(RIOTMAKE)/utils/checks.mk
# Include Docker settings near the top because we need to build the environment
# command line before some of the variable origins are overwritten below when
# using abspath, strip etc.

View File

@ -1,12 +1,9 @@
# set default port depending on operating system
OS := $(shell uname)
ifeq ($(OS),Linux)
PORT ?= $(PORT_LINUX)
PORT ?= $(call ensure_value,$(PORT_LINUX),No port set)
else ifeq ($(OS),Darwin)
PORT ?= $(PORT_DARWIN)
endif
ifeq ($(PORT),)
$(info Warning: no PORT set!)
PORT ?= $(call ensure_value,$(PORT_DARWIN),No port set)
endif
export BAUD ?= 115200