mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 06:12:43 +01:00
Merge pull request #12999 from fjmolinas/pr_native_makefile_include_explicit_path
boards: use explicit paths for file inclusion
This commit is contained in:
commit
50f1b1423a
@ -7,4 +7,4 @@ endif
|
||||
include $(RIOTBOARD)/common/arduino-mkr/Makefile.include
|
||||
|
||||
# add arduino-mkrwan1300 include path
|
||||
INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
|
||||
INCLUDES += -I$(RIOTBOARD)/arduino-mkrwan1300/include
|
||||
|
@ -11,9 +11,9 @@ include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
include $(RIOTMAKE)/tools/renode.inc.mk
|
||||
|
||||
# debugger config
|
||||
DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
|
||||
DEBUGGER = $(RIOTBOARD)/cc2538dk/dist/debug.sh
|
||||
DEBUGSERVER = JLinkGDBServer -device CC2538SF53
|
||||
RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
||||
RESET ?= $(RIOTBOARD)/cc2538dk/dist/reset.sh
|
||||
|
||||
# Define the flash-tool and default port:
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
@ -22,7 +22,7 @@ ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
FLASHER = $(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py
|
||||
FFLAGS = -p "$(PROG_DEV)" -e -w -v $(FLASHFILE)
|
||||
else ifeq ($(PROGRAMMER),jlink)
|
||||
FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
|
||||
FLASHER = $(RIOTBOARD)/cc2538dk/dist/flash.sh
|
||||
FFLAGS = $(BINDIR) $(FLASHFILE)
|
||||
endif
|
||||
|
||||
|
@ -3,6 +3,6 @@ FLASHFILE ?= $(HEXFILE)
|
||||
FLASHER = mspdebug
|
||||
FFLAGS = rf2500 "prog $(FLASHFILE)"
|
||||
|
||||
INCLUDES += -I$(RIOTBOARD)/$(BOARD)/drivers/include
|
||||
INCLUDES += -I$(RIOTBOARD)/chronos/drivers/include
|
||||
|
||||
USEMODULE += chronos-drivers
|
||||
|
@ -18,6 +18,3 @@ else
|
||||
endif
|
||||
|
||||
INCLUDES += -I$(RIOTBOARD)/common/arduino-mkr/include
|
||||
|
||||
# setup the boards dependencies
|
||||
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
||||
|
@ -10,10 +10,10 @@ include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# st-flash
|
||||
FLASHER = st-flash
|
||||
DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
|
||||
DEBUGGER = $(RIOTBOARD)/f4vi1/dist/debug.sh
|
||||
DEBUGSERVER = st-util
|
||||
|
||||
# define st-flash parameters
|
||||
FLASHFILE ?= $(BINFILE)
|
||||
FFLAGS = write $(FLASHFILE) 0x8000000
|
||||
DEBUGGER_FLAGS = $(RIOTBOARD)/$(BOARD)/dist/gdb.conf $(ELFFILE)
|
||||
DEBUGGER_FLAGS = $(RIOTBOARD)/f4vi1/dist/gdb.conf $(ELFFILE)
|
||||
|
@ -18,4 +18,4 @@ else
|
||||
endif
|
||||
|
||||
# setup the boards dependencies
|
||||
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
||||
include $(RIOTBOARD)/feather-m0/Makefile.dep
|
||||
|
@ -1,4 +1,4 @@
|
||||
FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
|
||||
FLASHER = $(RIOTBOARD)/mbed_lpc1768/dist/flash.sh
|
||||
DEBUGGER =
|
||||
DEBUGSERVER =
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
export NATIVEINCLUDES += -DNATIVE_INCLUDES
|
||||
export NATIVEINCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/
|
||||
export NATIVEINCLUDES += -I$(RIOTBOARD)/native/include/
|
||||
export NATIVEINCLUDES += -I$(RIOTBASE)/core/include/
|
||||
export NATIVEINCLUDES += -I$(RIOTBASE)/drivers/include/
|
||||
|
||||
@ -11,7 +11,7 @@ else
|
||||
DEBUGGER ?= gdb
|
||||
endif
|
||||
|
||||
RESET ?= $(RIOTBOARD)/$(BOARD)/dist/reset.sh
|
||||
RESET ?= $(RIOTBOARD)/native/dist/reset.sh
|
||||
FLASHER = true
|
||||
FLASHFILE ?= $(ELFFILE)
|
||||
|
||||
|
@ -5,7 +5,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# custom flasher to use with the bootloader
|
||||
FLASHER = $(RIOTBOARD)/$(BOARD)/dist/robotis-loader.py
|
||||
FLASHER = $(RIOTBOARD)/opencm904/dist/robotis-loader.py
|
||||
DEBUGGER =
|
||||
DEBUGSERVER =
|
||||
|
||||
|
@ -25,7 +25,7 @@ else ifeq ($(PROGRAMMER),jlink)
|
||||
export FLASH_ADDR = 0x200000
|
||||
export JLINK_DEVICE = CC2538SF53
|
||||
export JLINK_IF = JTAG
|
||||
export JLINK_RESET_FILE = $(RIOTBOARD)/$(BOARD)/dist/hw_reset.seg
|
||||
export JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
endif
|
||||
|
||||
|
@ -18,4 +18,4 @@ else
|
||||
endif
|
||||
|
||||
# setup the boards dependencies
|
||||
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
||||
include $(RIOTBOARD)/sensebox_samd21/Makefile.dep
|
||||
|
17
dist/tools/buildsystem_sanity_check/check.sh
vendored
17
dist/tools/buildsystem_sanity_check/check.sh
vendored
@ -220,6 +220,22 @@ checks_develhelp_not_defined_via_cflags() {
|
||||
| error_with_message "Use DEVELHELP ?= 1 instead of using CFLAGS directly"
|
||||
}
|
||||
|
||||
|
||||
# Common code in boards should not use $(BOARD) to reference files
|
||||
check_files_in_boards_not_reference_board_var() {
|
||||
local patterns=()
|
||||
local pathspec=()
|
||||
|
||||
patterns+=(-e '/$(BOARD)/')
|
||||
|
||||
pathspec+=('boards/')
|
||||
# boards/common/nrf52 uses a hack to resolve dependencies early
|
||||
pathspec+=(':!boards/common/nrf52/Makefile.include')
|
||||
|
||||
git -C "${RIOTBASE}" grep "${patterns[@]}" -- "${pathspec[@]}" \
|
||||
| error_with_message 'Code in boards/ should not use $(BOARDS) to reference files since this breaks external BOARDS changing BOARDSDIR"'
|
||||
}
|
||||
|
||||
error_on_input() {
|
||||
! grep ''
|
||||
}
|
||||
@ -234,6 +250,7 @@ all_checks() {
|
||||
check_board_insufficient_memory_not_in_makefile
|
||||
checks_tests_application_not_defined_in_makefile
|
||||
checks_develhelp_not_defined_via_cflags
|
||||
check_files_in_boards_not_reference_board_var
|
||||
}
|
||||
|
||||
main() {
|
||||
|
Loading…
Reference in New Issue
Block a user