Description
The build system will ignore the BOARD_WHITELIST macro defined in some applications when building with make hexfile instead of make. This probably happens with other targets as well, I did not look into it closer (and I don't really understand the make system well enough to fix it).
The BOARD_WHITELIST macro is checked in the Makefile.include file on the main level, but I don't know why it's not checked for the hexfile target.
Steps to reproduce the issue
Choose an application that has a board whitelist and choose a board that is NOT on the whitelist. In this case, I chose examples/openthread and nrf52dk.
Expected results
The build system throws an error as it does with just make.
~/riotdev/RIOT/examples/openthread$ BOARD=nrf52dk make
The selected BOARD=nrf52dk is not whitelisted: samr21-xpro iotlab-m3 iotlab-a8-m3 frdm-kw41z openlabs-kw41z-mini-256kib openlabs-kw41z-mini phynode-kw41z usb-kw41z cc2538dk remote-reva remote-revb omote openmote-cc2538 nrf52840dk nrf52840-mdk reel
/home/cbuec/riotdev/RIOT/examples/openthread/../../Makefile.include:1006: *** You can let the build continue on expected errors by setting CONTINUE_ON_EXPECTED_ERRORS=1 to the command line. Stop.
Actual results
make hexfile will try to compile the application anyways and then run into issues during the compiling process.
~/riotdev/RIOT/examples/openthread$ BOARD=nrf52dk make hexfile
"make" -C /home/cbuec/riotdev/RIOT/pkg/cmsis/
"make" -C /home/cbuec/riotdev/RIOT/pkg/openthread/
cmake -Wno-dev -B/home/cbuec/riotdev/RIOT/examples/openthread/bin/nrf52dk/pkg-build/openthread -H/home/cbuec/riotdev/RIOT/build/pkg/openthread \
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
-DCMAKE_C_COMPILER="arm-none-eabi-gcc" \
-DCMAKE_C_COMPILER_AR="ar" \
-DCMAKE_C_COMPILER_RANLIB="arm-none-eabi-ranlib" \
-DCMAKE_C_FLAGS="-mcpu=cortex-m4 -mlittle-endian -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fdata-sections -ffunction-sections -Os -ffunction-sections -fshort-enums -Wno-implicit-fallthrough -Wno-unused-parameter" \
-DCMAKE_CXX_COMPILER="arm-none-eabi-g++" \
-DCMAKE_CXX_FLAGS="-mcpu=cortex-m4 -mlittle-endian -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fdata-sections -ffunction-sections -Os -ffunction-sections -fshort-enums -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-class-memaccess -DOPENTHREAD_TARGET_RIOT -fno-exceptions -fno-rtti" \
-DCMAKE_NM="arm-none-eabi-nm" \
-DCMAKE_STRIP="" \
-DOT_PLATFORM=NO \
-DOT_CONFIG="/home/cbuec/riotdev/RIOT/pkg/openthread/include/platform_config.h" \
-DOT_APP_CLI=ON \
-DOT_JOINER=OFF \
-DOT_COAP=ON
-- The C compiler identification is GNU 10.3.1
-- The CXX compiler identification is GNU 10.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
third_party/nlbuild-autotools/repo/scripts/mkversion: line 132: arm-none-eabi-/dev/null: No such file or directory
third_party/nlbuild-autotools/repo/scripts/mkversion: line 203: arm-none-eabi-/usr/bin/printf: No such file or directory
third_party/nlbuild-autotools/repo/scripts/mkversion: line 245: arm-none-eabi-/usr/bin/printf: No such file or directory
-- Version:
-- Project core config: "/home/cbuec/riotdev/RIOT/pkg/openthread/include/platform_config.h"
-- Found PythonInterp: /usr/bin/python3.10 (found version "3.10.12")
-- Found Perl: /usr/bin/perl (found version "5.34.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cbuec/riotdev/RIOT/examples/openthread/bin/nrf52dk/pkg-build/openthread
"make" -C /home/cbuec/riotdev/RIOT/examples/openthread/bin/nrf52dk/pkg-build/openthread mbedcrypto mbedtls openthread-ftd openthread-cli-ftd
[ 0%] Building C object third_party/mbedtls/repo/library/CMakeFiles/mbedcrypto.dir/aes.c.o
...
[ 98%] Building CXX object src/cli/CMakeFiles/openthread-cli-ftd.dir/cli_udp.cpp.o
[100%] Linking CXX static library libopenthread-cli-ftd.a
[100%] Built target openthread-cli-ftd
"make" -C /home/cbuec/riotdev/RIOT/boards/common/init
"make" -C /home/cbuec/riotdev/RIOT/boards/nrf52dk
"make" -C /home/cbuec/riotdev/RIOT/boards/common/nrf52xxxdk
"make" -C /home/cbuec/riotdev/RIOT/core
"make" -C /home/cbuec/riotdev/RIOT/core/lib
"make" -C /home/cbuec/riotdev/RIOT/cpu/nrf52
"make" -C /home/cbuec/riotdev/RIOT/cpu/cortexm_common
"make" -C /home/cbuec/riotdev/RIOT/cpu/cortexm_common/periph
"make" -C /home/cbuec/riotdev/RIOT/cpu/nrf52/periph
"make" -C /home/cbuec/riotdev/RIOT/cpu/nrf52/vectors
"make" -C /home/cbuec/riotdev/RIOT/cpu/nrf5x_common
"make" -C /home/cbuec/riotdev/RIOT/cpu/nrf5x_common/periph
"make" -C /home/cbuec/riotdev/RIOT/drivers
"make" -C /home/cbuec/riotdev/RIOT/drivers/netdev
"make" -C /home/cbuec/riotdev/RIOT/drivers/periph_common
"make" -C /home/cbuec/riotdev/RIOT/pkg/openthread/contrib
/home/cbuec/riotdev/RIOT/pkg/openthread/contrib/openthread.c: In function 'openthread_bootstrap':
/home/cbuec/riotdev/RIOT/pkg/openthread/contrib/openthread.c:103:27: error: 'netdev' undeclared (first use in this function)
103 | openthread_radio_init(netdev, tx_buf, rx_buf);
| ^~~~~~
/home/cbuec/riotdev/RIOT/pkg/openthread/contrib/openthread.c:103:27: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [/home/cbuec/riotdev/RIOT/Makefile.base:149: /home/cbuec/riotdev/RIOT/examples/openthread/bin/nrf52dk/openthread_contrib/openthread.o] Error 1
make[1]: *** [/home/cbuec/riotdev/RIOT/Makefile.base:31: ALL--/home/cbuec/riotdev/RIOT/pkg/openthread/contrib] Error 2
make: *** [/home/cbuec/riotdev/RIOT/examples/openthread/../../Makefile.include:747: application_openthread.module] Error 2
Versions
This happens on the latest master.
Description
The build system will ignore the
BOARD_WHITELISTmacro defined in some applications when building withmake hexfileinstead ofmake. This probably happens with other targets as well, I did not look into it closer (and I don't really understand the make system well enough to fix it).The
BOARD_WHITELISTmacro is checked in theMakefile.includefile on the main level, but I don't know why it's not checked for thehexfiletarget.Steps to reproduce the issue
Choose an application that has a board whitelist and choose a board that is NOT on the whitelist. In this case, I chose
examples/openthreadandnrf52dk.Expected results
The build system throws an error as it does with just
make.Actual results
make hexfilewill try to compile the application anyways and then run into issues during the compiling process.Versions
This happens on the latest master.