diff --git a/boards/airfy-beacon/Makefile.include b/boards/airfy-beacon/Makefile.include index cc8572b7cc..14eaf50014 100644 --- a/boards/airfy-beacon/Makefile.include +++ b/boards/airfy-beacon/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf51x22xxaa # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/arduino-due/Makefile.include b/boards/arduino-due/Makefile.include index 10b858a74b..08c0eefea7 100644 --- a/boards/arduino-due/Makefile.include +++ b/boards/arduino-due/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = sam3x8e # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # define board specific flasher options export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh diff --git a/boards/ek-lm4f120xl/Makefile.include b/boards/ek-lm4f120xl/Makefile.include index 94d7395388..373406db2e 100644 --- a/boards/ek-lm4f120xl/Makefile.include +++ b/boards/ek-lm4f120xl/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = LM4F120H5QR #define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/f4vi1/Makefile.include b/boards/f4vi1/Makefile.include index 1d9b4b0200..19d12fd50e 100644 --- a/boards/f4vi1/Makefile.include +++ b/boards/f4vi1/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f415rg # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/fox/Makefile.include b/boards/fox/Makefile.include index fe9d27d108..cd16e056dc 100644 --- a/boards/fox/Makefile.include +++ b/boards/fox/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f103re # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB1 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbserial* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/iotlab-m3/Makefile.include b/boards/iotlab-m3/Makefile.include index f291c025ca..b0a76057cb 100644 --- a/boards/iotlab-m3/Makefile.include +++ b/boards/iotlab-m3/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f103re # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB1 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbserial* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*))) # setup serial terminal export BAUD = 500000 diff --git a/boards/limifrog-v1/Makefile.include b/boards/limifrog-v1/Makefile.include index e40282f74a..4063653936 100644 --- a/boards/limifrog-v1/Makefile.include +++ b/boards/limifrog-v1/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32l151rc # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/mbed_lpc1768/Makefile.include b/boards/mbed_lpc1768/Makefile.include index 630e0528f2..e6c64263cb 100644 --- a/boards/mbed_lpc1768/Makefile.include +++ b/boards/mbed_lpc1768/Makefile.include @@ -12,7 +12,7 @@ export DEBUGGER_FLAGS = # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/msb-430-common/Makefile.include b/boards/msb-430-common/Makefile.include index af7e9f442c..71bc5200b9 100644 --- a/boards/msb-430-common/Makefile.include +++ b/boards/msb-430-common/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = msp430f1612 # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/msbiot/Makefile.include b/boards/msbiot/Makefile.include index 2f8ee328ff..1df898f14c 100644 --- a/boards/msbiot/Makefile.include +++ b/boards/msbiot/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f415rg #define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/mulle/Makefile.include b/boards/mulle/Makefile.include index 2ed218e7d7..49392d7cee 100644 --- a/boards/mulle/Makefile.include +++ b/boards/mulle/Makefile.include @@ -82,7 +82,7 @@ ifeq ($(PORT),) PORT := $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh) endif else ifeq ($(OS),Darwin) - PORT := $(shell ls -1 /dev/tty.usbserial* | head -n 1) + PORT := $(firstword $(sort $(wildcard /dev/tty.usbserial*))) endif endif ifeq ($(PORT),) diff --git a/boards/nrf51dongle/Makefile.include b/boards/nrf51dongle/Makefile.include index 76f48a1f71..53810879fd 100644 --- a/boards/nrf51dongle/Makefile.include +++ b/boards/nrf51dongle/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf51x22xxab # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup JLink for flashing export JLINK_DEVICE := nrf51822 diff --git a/boards/nrf52dk/Makefile.include b/boards/nrf52dk/Makefile.include index e6a37d3ae9..e16b064a4d 100644 --- a/boards/nrf52dk/Makefile.include +++ b/boards/nrf52dk/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf52xxaa # set default port depending on operating system PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup the boards dependencies include $(RIOTBOARD)/$(BOARD)/Makefile.dep diff --git a/boards/nrf6310/Makefile.include b/boards/nrf6310/Makefile.include index 6fcf0d217d..6db9e3a7bd 100644 --- a/boards/nrf6310/Makefile.include +++ b/boards/nrf6310/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf51x22xxaa # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # define flash and debugging environment export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh diff --git a/boards/nucleo-f091/Makefile.include b/boards/nucleo-f091/Makefile.include index 97b59fc9e0..55cf92fcc0 100644 --- a/boards/nucleo-f091/Makefile.include +++ b/boards/nucleo-f091/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f091rc #define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/nucleo-f103/Makefile.include b/boards/nucleo-f103/Makefile.include index a23e997856..f1b362445f 100755 --- a/boards/nucleo-f103/Makefile.include +++ b/boards/nucleo-f103/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f103rb #define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/nucleo-f303/Makefile.include b/boards/nucleo-f303/Makefile.include index b65ef8a2c5..aca137caf3 100755 --- a/boards/nucleo-f303/Makefile.include +++ b/boards/nucleo-f303/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f303re #define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/nucleo-f334/Makefile.include b/boards/nucleo-f334/Makefile.include index b3d8ea9bea..edf7af4036 100644 --- a/boards/nucleo-f334/Makefile.include +++ b/boards/nucleo-f334/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f334r8 #define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/nucleo-f401/Makefile.include b/boards/nucleo-f401/Makefile.include index 5d99f17c20..d2ca4cad21 100644 --- a/boards/nucleo-f401/Makefile.include +++ b/boards/nucleo-f401/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f401re # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/nucleo-l1/Makefile.include b/boards/nucleo-l1/Makefile.include index dd05d8f352..4a9e698d24 100644 --- a/boards/nucleo-l1/Makefile.include +++ b/boards/nucleo-l1/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32l152ret6 # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/openmote-cc2538/Makefile.include b/boards/openmote-cc2538/Makefile.include index 603c277d3f..1681566a1d 100644 --- a/boards/openmote-cc2538/Makefile.include +++ b/boards/openmote-cc2538/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = cc2538sf53 # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbserial-* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*))) # setup JLink for flashing export JLINK_DEVICE := cc2538sf53 diff --git a/boards/pca10000/Makefile.include b/boards/pca10000/Makefile.include index a2fb34f60f..7b11716814 100644 --- a/boards/pca10000/Makefile.include +++ b/boards/pca10000/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf51x22xxaa # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup JLink for flashing export JLINK_DEVICE := nrf51822 diff --git a/boards/pca10005/Makefile.include b/boards/pca10005/Makefile.include index ee3ebaa235..202562d2d3 100644 --- a/boards/pca10005/Makefile.include +++ b/boards/pca10005/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf51x22xxaa # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup JLink for flashing export JLINK_DEVICE := nrf51822 diff --git a/boards/remote/Makefile.include b/boards/remote/Makefile.include index 7eb3015c0e..452a14daed 100644 --- a/boards/remote/Makefile.include +++ b/boards/remote/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = cc2538sf53 # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB1 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbserial-* | head -n 2 | tail -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*))) # define the default flash-tool export PROGRAMMER ?= cc2538-bsl diff --git a/boards/samr21-xpro/Makefile.include b/boards/samr21-xpro/Makefile.include index f16f5d8744..851983a666 100644 --- a/boards/samr21-xpro/Makefile.include +++ b/boards/samr21-xpro/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = samr21g18a # set default port depending on operating system PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup the boards dependencies include $(RIOTBOARD)/$(BOARD)/Makefile.dep diff --git a/boards/slwstk6220a/Makefile.include b/boards/slwstk6220a/Makefile.include index 59057d72b3..3e6a7aac0e 100644 --- a/boards/slwstk6220a/Makefile.include +++ b/boards/slwstk6220a/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = ezr32wg330f256r60 # set default port depending on operating system PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) # setup the boards dependencies include $(RIOTBOARD)/$(BOARD)/Makefile.dep diff --git a/boards/stm32f0discovery/Makefile.include b/boards/stm32f0discovery/Makefile.include index 9bce9d87bb..f0a04d1444 100644 --- a/boards/stm32f0discovery/Makefile.include +++ b/boards/stm32f0discovery/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f051r8 # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/stm32f3discovery/Makefile.include b/boards/stm32f3discovery/Makefile.include index fa0286a256..4389d6e7d9 100644 --- a/boards/stm32f3discovery/Makefile.include +++ b/boards/stm32f3discovery/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f303vc # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/stm32f4discovery/Makefile.include b/boards/stm32f4discovery/Makefile.include index a06d871f3e..221cfa9757 100644 --- a/boards/stm32f4discovery/Makefile.include +++ b/boards/stm32f4discovery/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = stm32f407vg # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/telosb/Makefile.include b/boards/telosb/Makefile.include index 22a5df72f7..6a78e3b2c8 100644 --- a/boards/telosb/Makefile.include +++ b/boards/telosb/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = msp430f1611 # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.usbserial-MXV* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial-MXV*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/weio/Makefile.include b/boards/weio/Makefile.include index 87461024c1..766053b7ca 100644 --- a/boards/weio/Makefile.include +++ b/boards/weio/Makefile.include @@ -12,7 +12,7 @@ export DEBUGGER_FLAGS = # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/wsn430-common/Makefile.include b/boards/wsn430-common/Makefile.include index c5d09101c3..9daf460eb2 100644 --- a/boards/wsn430-common/Makefile.include +++ b/boards/wsn430-common/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = msp430f1611 # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/yunjia-nrf51822/Makefile.include b/boards/yunjia-nrf51822/Makefile.include index cc8572b7cc..14eaf50014 100644 --- a/boards/yunjia-nrf51822/Makefile.include +++ b/boards/yunjia-nrf51822/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = nrf51x22xxaa # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial diff --git a/boards/z1/Makefile.include b/boards/z1/Makefile.include index b909dd2e85..fa3dea543c 100644 --- a/boards/z1/Makefile.include +++ b/boards/z1/Makefile.include @@ -4,7 +4,7 @@ export CPU_MODEL = msp430f2617 # set default port depending on operating system PORT_LINUX ?= /dev/ttyUSB0 -PORT_DARWIN ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) # setup serial terminal include $(RIOTBOARD)/Makefile.include.serial