diff --git a/examples/language_bindings/officially_supported/rust-async/Cargo.toml b/examples/language_bindings/officially_supported/rust-async/Cargo.toml index 7d8ae6f055..e3cb239120 100644 --- a/examples/language_bindings/officially_supported/rust-async/Cargo.toml +++ b/examples/language_bindings/officially_supported/rust-async/Cargo.toml @@ -28,4 +28,4 @@ portable-atomic = { version = "1", features = [ "critical-section" ] } # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. -rust_riotmodules = { path = "../../sys/rust_riotmodules/" } +rust_riotmodules = { path = "../../../../sys/rust_riotmodules/" } diff --git a/examples/language_bindings/officially_supported/rust-gcoap/Cargo.toml b/examples/language_bindings/officially_supported/rust-gcoap/Cargo.toml index 99d15c69d8..e60fb52e7c 100644 --- a/examples/language_bindings/officially_supported/rust-gcoap/Cargo.toml +++ b/examples/language_bindings/officially_supported/rust-gcoap/Cargo.toml @@ -30,7 +30,7 @@ riot-coap-handler-demos = { git = "https://gitlab.com/etonomy/riot-module-exampl # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. -rust_riotmodules = { path = "../../sys/rust_riotmodules/" } +rust_riotmodules = { path = "../../../../sys/rust_riotmodules/" } static_cell = "2.1.0" [patch.crates-io] diff --git a/examples/language_bindings/officially_supported/rust-hello-world/Cargo.toml b/examples/language_bindings/officially_supported/rust-hello-world/Cargo.toml index 21e200d9b4..e7b3136c11 100644 --- a/examples/language_bindings/officially_supported/rust-hello-world/Cargo.toml +++ b/examples/language_bindings/officially_supported/rust-hello-world/Cargo.toml @@ -21,4 +21,4 @@ riot-wrappers = { version = "0.9.0", features = [ "set_panic_handler" ] } # Rust, that may change; it is best practice for any RIOT application that has # its own top-level Rust crate to include rust_riotmodules from inside # RIOTBASE. -rust_riotmodules = { path = "../../sys/rust_riotmodules/" } +rust_riotmodules = { path = "../../../../sys/rust_riotmodules/" } diff --git a/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_eddystone/Makefile b/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_eddystone/Makefile index 69fb96bf99..e7edce55bd 100644 --- a/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_eddystone/Makefile +++ b/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_eddystone/Makefile @@ -5,7 +5,7 @@ APPLICATION = skald_eddystone BOARD ?= nrf52dk # This has to be the absolute path to the RIOT base directory: -RIOTBASE ?= $(CURDIR)/../../../.. +RIOTBASE ?= $(CURDIR)/../../../../.. # include Skald USEMODULE += skald_eddystone diff --git a/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_ibeacon/Makefile b/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_ibeacon/Makefile index f6353a9f71..b641ef5261 100644 --- a/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_ibeacon/Makefile +++ b/examples/networking/bluetooth_low_energy/misc_ble_examples/skald_ibeacon/Makefile @@ -5,7 +5,7 @@ APPLICATION = skald_ibeacon BOARD ?= nrf52dk # This has to be the absolute path to the RIOT base directory: -RIOTBASE ?= $(CURDIR)/../../../.. +RIOTBASE ?= $(CURDIR)/../../../../.. # include Skald USEMODULE += skald_ibeacon diff --git a/examples/networking/bluetooth_low_energy/nimble/nimble_gatt/Makefile b/examples/networking/bluetooth_low_energy/nimble/nimble_gatt/Makefile index 1440490f50..85e974749a 100644 --- a/examples/networking/bluetooth_low_energy/nimble/nimble_gatt/Makefile +++ b/examples/networking/bluetooth_low_energy/nimble/nimble_gatt/Makefile @@ -5,7 +5,7 @@ APPLICATION = nimble_gatt BOARD ?= nrf52dk # This has to be the absolute path to the RIOT base directory: -RIOTBASE ?= $(CURDIR)/../../../.. +RIOTBASE ?= $(CURDIR)/../../../../.. # Include NimBLE USEPKG += nimble diff --git a/examples/networking/bluetooth_low_energy/nimble/nimble_heart_rate_sensor/Makefile b/examples/networking/bluetooth_low_energy/nimble/nimble_heart_rate_sensor/Makefile index e5c4a6f825..4ede1e7b80 100644 --- a/examples/networking/bluetooth_low_energy/nimble/nimble_heart_rate_sensor/Makefile +++ b/examples/networking/bluetooth_low_energy/nimble/nimble_heart_rate_sensor/Makefile @@ -5,7 +5,7 @@ APPLICATION = nimble_heart_rate_sensor BOARD ?= nrf52dk # This has to be the absolute path to the RIOT base directory: -RIOTBASE ?= $(CURDIR)/../../../.. +RIOTBASE ?= $(CURDIR)/../../../../.. # Some RIOT modules needed for this example USEMODULE += event_timeout_ztimer diff --git a/examples/networking/bluetooth_low_energy/nimble/nimble_scanner/Makefile b/examples/networking/bluetooth_low_energy/nimble/nimble_scanner/Makefile index f4e6c1ea10..c0cdf34c56 100644 --- a/examples/networking/bluetooth_low_energy/nimble/nimble_scanner/Makefile +++ b/examples/networking/bluetooth_low_energy/nimble/nimble_scanner/Makefile @@ -5,7 +5,7 @@ APPLICATION = nimble_scanner BOARD ?= nrf52dk # This has to be the absolute path to the RIOT base directory: -RIOTBASE ?= $(CURDIR)/../../../.. +RIOTBASE ?= $(CURDIR)/../../../../.. # We use the xtimer and the shell in this example USEMODULE += shell diff --git a/examples/networking/gnrc_networking/gnrc_lorawan/Makefile b/examples/networking/gnrc_networking/gnrc_lorawan/Makefile index 30325e4f9e..161eb318fc 100644 --- a/examples/networking/gnrc_networking/gnrc_lorawan/Makefile +++ b/examples/networking/gnrc_networking/gnrc_lorawan/Makefile @@ -5,7 +5,7 @@ APPLICATION = gnrc_lorawan DEVELHELP ?= 1 BOARD ?= b-l072z-lrwan1 -RIOTBASE ?= ../../ +RIOTBASE ?= $(CURDIR)/../../../.. # Include board's default network devices and auto-initialization of GNRC # interfaces diff --git a/makefiles/app_dirs.blacklist b/makefiles/app_dirs.blacklist new file mode 100644 index 0000000000..08ef93449c --- /dev/null +++ b/makefiles/app_dirs.blacklist @@ -0,0 +1,21 @@ +examples/advanced_examples/bindist/ +examples/advanced_examples/pio_blink/ +examples/essentials/subfolders/ +examples/language_bindings/community_supported/wasm/ +tests/build_system/blob/ +tests/build_system/cpp_exclude/external_modules/ +tests/build_system/cpp_ext/external_modules/ +tests/build_system/external_board_dirs/esp-ci-boards/ +tests/build_system/external_board_dirs/netdev-ci-boards/ +tests/build_system/external_board_native/external_boards/ +tests/build_system/external_module_dirs/external_modules/ +tests/build_system/external_pkg_dirs/external_pkgs/ +tests/build_system/kconfig/external_modules/ +tests/build_system/kconfig/external_pkgs/ +tests/periph/qdec/boards_modded/ +tests/pkg/openwsn_sock_udp/external_modules/ +tests/pkg/tflite-micro/external_modules/ +tests/pkg/utensor/external_modules/ +tests/pkg/wolfcrypt-ed25519-verify/ +tests/sys/suit_manifest/native_flashpage/ +tests/unittests/ diff --git a/makefiles/app_dirs.inc.mk b/makefiles/app_dirs.inc.mk index f71a021f19..878bd2a85b 100644 --- a/makefiles/app_dirs.inc.mk +++ b/makefiles/app_dirs.inc.mk @@ -3,32 +3,18 @@ # fallback so empty RIOTBASE won't lead to "/examples/" RIOTBASE ?= . -# 1. use wildcard to find Makefiles -# 2. use patsubst to drop trailing "/" -# 3. use patsubst to drop possible leading "./" -# 4. sort +APPS_BASE_DIRS = bootloaders examples fuzzing tests -# Prepare the list of application directories -APPLICATION_DIRS := \ - fuzzing \ - bootloaders \ - examples \ - tests \ - tests/bench \ - tests/build_system \ - tests/core \ - tests/cpu \ - tests/drivers \ - tests/net \ - tests/periph \ - tests/pkg \ - tests/sys \ - # - -APPLICATION_DIRS := $(addprefix $(RIOTBASE)/,$(APPLICATION_DIRS)) -APPLICATION_DIRS_RELATIVE := $(dir $(wildcard $(addsuffix /*/Makefile,$(APPLICATION_DIRS)))) -APPLICATION_DIRS_ABSOLUTE := $(abspath $(APPLICATION_DIRS_RELATIVE)) -APPLICATION_DIRS := $(sort $(patsubst ./%,%,$(patsubst %/,%,$(APPLICATION_DIRS_RELATIVE)))) +# 1. recursively find Makefiles +# 2. take parent folders +# 3. exclude build artifacts (below bin/) +# 4. exclude false positives from app_dirs.blacklist +# 5. sort +APPLICATION_DIRS := $(shell find $(APPS_BASE_DIRS) -name Makefile -type f | \ + xargs dirname | \ + grep -vF "/bin/" | \ + grep -vFf $(RIOTBASE)/makefiles/app_dirs.blacklist | \ + sort | uniq) info-applications: @for dir in $(APPLICATION_DIRS); do echo $$dir; done