diff --git a/Makefile.dep b/Makefile.dep index 1274aa3ca4..1e2081fc54 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -636,6 +636,12 @@ ifneq (,$(filter cpp11-compat,$(USEMODULE))) FEATURES_REQUIRED += libstdcpp endif +ifneq (,$(filter fuzzing,$(USEMODULE))) + USEMODULE += netdev_test + USEMODULE += gnrc_netif + USEMODULE += gnrc_pktbuf_malloc +endif + ifneq (,$(filter gnrc,$(USEMODULE))) USEMODULE += gnrc_netapi USEMODULE += gnrc_netreg @@ -742,12 +748,6 @@ ifneq (,$(filter evtimer_mbox,$(USEMODULE))) USEMODULE += core_mbox endif -ifneq (,$(filter fuzzing,$(USEMODULE))) - USEMODULE += netdev_test - USEMODULE += gnrc_netif - USEMODULE += gnrc_pktbuf_malloc -endif - ifneq (,$(filter can_linux,$(USEMODULE))) LINKFLAGS += -lsocketcan endif diff --git a/sys/Makefile.include b/sys/Makefile.include index a5cb26e796..1ecb64f23a 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -17,6 +17,10 @@ ifneq (,$(filter gnrc_sock_async,$(USEMODULE))) CFLAGS += -DSOCK_HAS_ASYNC endif +ifneq (,$(filter gnrc_pktbuf,$(USEMODULE))) + include $(RIOTBASE)/sys/net/gnrc/pktbuf/Makefile.include +endif + ifneq (,$(filter posix_headers,$(USEMODULE))) USEMODULE_INCLUDES += $(RIOTBASE)/sys/posix/include endif diff --git a/sys/net/gnrc/pktbuf/Makefile.include b/sys/net/gnrc/pktbuf/Makefile.include new file mode 100644 index 0000000000..1312596307 --- /dev/null +++ b/sys/net/gnrc/pktbuf/Makefile.include @@ -0,0 +1,5 @@ +# Check that only one implementation of pktbuf is used +USED_PKTBUF_IMPLEMENTATIONS := $(filter-out gnrc_pktbuf_cmd,$(filter gnrc_pktbuf_%,$(USEMODULE))) +ifneq (1,$(words $(USED_PKTBUF_IMPLEMENTATIONS))) + $(error Only one implementation of gnrc_pktbuf should be used. Currently using: $(USED_PKTBUF_IMPLEMENTATIONS)) +endif