Skip to content

Commit

Permalink
sys/preprocessor: add preprocessor module
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian18 committed Oct 17, 2022
1 parent fad66e4 commit b4dcbba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions makefiles/defaultmodules_deps.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions sys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions sys/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions sys/preprocessor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE := preprocessor

include $(RIOTBASE)/Makefile.base
18 changes: 18 additions & 0 deletions sys/preprocessor/Makefile.include
Original file line number Diff line number Diff line change
@@ -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) > $@

0 comments on commit b4dcbba

Please sign in to comment.