diff --git a/makefiles/defaultmodules_deps.inc.mk b/makefiles/defaultmodules_deps.inc.mk index 4a6f92069d..c92eb88f9d 100644 --- a/makefiles/defaultmodules_deps.inc.mk +++ b/makefiles/defaultmodules_deps.inc.mk @@ -2,6 +2,10 @@ # end of the dependency loop. They MAY inlcude new modules, but this modules # MUST NOT have dependencies themselfs. +ifneq (,$(filter auto_init%,$(USEMODULE))) + USEMODULE += preprocessor preprocessor_successor +endif + ifneq (,$(filter auto_init_ztimer,$(USEMODULE))) USEMODULE += ztimer_init endif diff --git a/sys/Makefile b/sys/Makefile index 85c6fd1230..b7724719a7 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -173,6 +173,9 @@ endif ifneq (,$(filter pthread,$(USEMODULE))) DIRS += posix/pthread endif +ifneq (,$(filter preprocessor_%,$(USEMODULE))) + DIRS += preprocessor +endif ifneq (,$(filter routing,$(USEMODULE))) DIRS += net/routing endif diff --git a/sys/Makefile.include b/sys/Makefile.include index 0a4fcbe837..d131e7b3fa 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -181,3 +181,7 @@ endif ifneq (,$(filter tiny_strerror,$(USEMODULE))) include $(RIOTBASE)/sys/tiny_strerror/Makefile.include endif + +ifneq (,$(filter preprocessor_%,$(USEMODULE))) + include $(RIOTBASE)/sys/preprocessor/Makefile.include +endif diff --git a/sys/preprocessor/Makefile b/sys/preprocessor/Makefile new file mode 100644 index 0000000000..b058330cff --- /dev/null +++ b/sys/preprocessor/Makefile @@ -0,0 +1,3 @@ +MODULE := preprocessor + +include $(RIOTBASE)/Makefile.base diff --git a/sys/preprocessor/Makefile.include b/sys/preprocessor/Makefile.include new file mode 100644 index 0000000000..c124c81b53 --- /dev/null +++ b/sys/preprocessor/Makefile.include @@ -0,0 +1,18 @@ +RIOT_PP_SUCCESSOR_MAX ?= 9999 + +PSEUDOMODULES += preprocessor_successor + +USEMODULE_INCLUDES_preprocessor := $(BINDIR)/preprocessor +USEMODULE_INCLUDES += $(USEMODULE_INCLUDES_preprocessor) + +RIOT_GENERATE_PP_HEADERS := + +ifneq (,$(filter preprocessor_successor,$(USEMODULE))) + RIOT_GENERATE_PP_HEADERS += $(BINDIR)/preprocessor/preprocessor_successor.h +endif + +BUILDDEPS += $(RIOT_GENERATE_PP_HEADERS) + +$(BINDIR)/preprocessor/preprocessor_successor.h: + @mkdir -p '$(dir $@)' + $(Q)'$(RIOTTOOLS)/generate_pp_successor_header/generate_pp_successor_header.sh' $(RIOT_PP_SUCCESSOR_MAX) > $@