diff --git a/makefiles/app_dirs.inc.mk b/makefiles/app_dirs.inc.mk new file mode 100644 index 0000000000000000000000000000000000000000..d181aed5e39f1106da410f1eeeaab9445eef1564 --- /dev/null +++ b/makefiles/app_dirs.inc.mk @@ -0,0 +1,14 @@ +# 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 +APPLICATION_DIRS := $(sort $(patsubst ./%,%,$(patsubst %/,%,$(dir $(wildcard \ + $(RIOTBASE)/examples/*/Makefile \ + $(RIOTBASE)/tests/*/Makefile \ + ))))) + +info-applications: + @for dir in $(APPLICATION_DIRS); do echo $$dir; done