-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefiles.pre
57 lines (45 loc) · 1.71 KB
/
makefiles.pre
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
CI_CONF_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
# Allways use BINFILE used for flashing, but not always a dependency
# if flash-only is used and RIOT_CI_BUILD is set
BUILD_FILES += $(BINFILE)
# Include all locally configured boards
include $(CI_CONF_DIR)/ci-boards.mk
# Overrite default board configurations
include $(CI_CONF_DIR)/ci-boards-configs.mk
CI_CONNECTED_BOARDS = $(sort $(filter $(CI_BOARDS),$(patsubst /dev/riot/tty-%,%,$(wildcard /dev/riot/tty-*))))
.PHONY: list-boards list-boards-json
list-boards: info-debug-variable-CI_CONNECTED_BOARDS
list-boards-json:
$(Q)printf "[";
$(Q)for board in ${CI_CONNECTED_BOARDS}; do \
printf "\"%s\", " $${board}; \
done;
$(Q)printf "]\n"
# Common configuration
CFG_PORT_BASE ?= /dev/riot/tty-$(BOARD)
CFG_PROG_BASE ?= /dev/riot/$(PROGRAMMER)-$(BOARD)
ifneq (,$(wildcard $(CFG_PORT_BASE)_$(BOARD_INDEX)))
CFG_PORT ?= $(CFG_PORT_BASE)_$(BOARD_INDEX)
else
CFG_PORT ?= $(CFG_PORT_BASE)
endif
ifneq (,$(wildcard $(CFG_PROG_BASE)_$(BOARD_INDEX)))
CFG_PROG ?= $(CFG_PROG_BASE)_$(BOARD_INDEX)
else
CFG_PROG ?= $(CFG_PROG_BASE)
endif
# Use progammer serial if it exists
ifneq (,$(wildcard $(CFG_PROG)))
CFG_DEBUG_ADAPTER_ID ?= $(shell udevadm info -q property $(CFG_PROG) | sed -n '/ID_SERIAL_SHORT/ {s/ID_SERIAL_SHORT=//p}')
else
CFG_DEBUG_ADAPTER_ID ?= $(shell udevadm info -q property $(CFG_PORT) | sed -n '/ID_SERIAL_SHORT/ {s/ID_SERIAL_SHORT=//p}')
endif
# Board specific configuration
ifneq (,$(findstring $(BOARD),$(CI_CONNECTED_BOARDS)))
PORT = $(CFG_PORT)
DEBUG_ADAPTER_ID = $(CFG_DEBUG_ADAPTER_ID)
endif
# Add docker.makefiles.pre
-include $(CI_CONF_DIR)/docker.makefiles.pre
# Add makefiles post
RIOT_MAKEFILES_GLOBAL_POST += $(CI_CONF_DIR)/makefiles.post