diff --git a/Makefile.base b/Makefile.base index b4b1a495cc..0132e8c7e7 100644 --- a/Makefile.base +++ b/Makefile.base @@ -45,7 +45,11 @@ ifeq (1, $(SUBMODULES)) BASE_MODULE ?= $(MODULE) # for each $(BASE_MODULE)_ in USEMODULE, add .c to SRC - SRC += $(wildcard $(patsubst $(BASE_MODULE)_%,%.c,$(filter $(BASE_MODULE)_%,$(USEMODULE)))) + # unless in SUBMODULES_NO_SRC + SRC += $(wildcard \ + $(filter-out $(SUBMODULES_NO_SRC),\ + $(patsubst $(BASE_MODULE)_%,%.c,\ + $(filter $(BASE_MODULE)_%,$(USEMODULE))))) # remove duplicates SRC := $(sort $(SRC)) diff --git a/doc/doxygen/src/creating-modules.md b/doc/doxygen/src/creating-modules.md index d217f791e3..0182efc8a8 100644 --- a/doc/doxygen/src/creating-modules.md +++ b/doc/doxygen/src/creating-modules.md @@ -160,7 +160,8 @@ the only parts of compounded module names and only match against part of that na See `sys/ztimer/Makefile` for an example in code. -`SUBMODULES` can also be true-pseudomodules. +`SUBMODULES` can also be true-pseudomodules, or become one by conditionally excluding +the source files by adding them to `SUBMODULES_NO_SRC`. # Helper tools