[riot-notifications] [RIOT-OS/RIOT] sys/Makefile.dep: Some cleanup (#16268)

Francisco notifications at github.com
Tue Apr 13 10:57:33 CEST 2021


> @maribu the simplest fix is moving `fuzzing` dependency before the inclusion of the gnrc file.

An other option would be:

```diff
diff --git a/sys/Makefile.dep b/sys/Makefile.dep
index 77f44e5ff0..a415deec5f 100644
--- a/sys/Makefile.dep
+++ b/sys/Makefile.dep
@@ -302,6 +302,7 @@ ifneq (,$(filter fuzzing,$(USEMODULE)))
   USEMODULE += netdev_test
   USEMODULE += gnrc_netif
   USEMODULE += gnrc_pktbuf_malloc
+  DISABLE_MODULE += gnrc_pktbuf_static
 endif
 
 ifneq (,$(filter netstats_%, $(USEMODULE)))
diff --git a/sys/net/gnrc/Makefile.dep b/sys/net/gnrc/Makefile.dep
index cc0b3d2716..28cb4b9718 100644
--- a/sys/net/gnrc/Makefile.dep
+++ b/sys/net/gnrc/Makefile.dep
@@ -390,18 +390,18 @@ ifneq (,$(filter gnrc,$(USEMODULE)))
   endif
 endif
 
-ifneq (,$(filter gnrc_pktbuf, $(USEMODULE)))
-  ifeq (,$(filter gnrc_pktbuf_%, $(USEMODULE)))
-    USEMODULE += gnrc_pktbuf_static
+ifneq (,$(filter gnrc_pktbuf,$(USEMODULE)))
+  ifeq (,$(filter gnrc_pktbuf_%,$(USEMODULE)))
+    DEFAULT_MODULE += gnrc_pktbuf_static
   endif
-  ifeq (gnrc_pktbuf_cmd,$(filter gnrc_pktbuf_%, $(USEMODULE)))
+  ifneq (,$(filter gnrc_pktbuf_cmd,$(USEMODULE)))
     USEMODULE += gnrc_pktbuf_static
   endif
   DEFAULT_MODULE += auto_init_gnrc_pktbuf
   USEMODULE += gnrc_pkt
 endif
 
-ifneq (,$(filter gnrc_pktbuf_%, $(USEMODULE)))
+ifneq (,$(filter gnrc_pktbuf_cmd, $(USEMODULE)))
   USEMODULE += gnrc_pktbuf # make MODULE_GNRC_PKTBUF macro available for all implementations
 endif
 
diff --git a/tests/unittests/tests-pktbuf/Makefile.include b/tests/unittests/tests-pktbuf/Makefile.include
deleted file mode 100644
index dfacccf361..0000000000
--- a/tests/unittests/tests-pktbuf/Makefile.include
+++ /dev/null
@@ -1 +0,0 @@
-USEMODULE += gnrc_pktbuf_static
```

It makes explicit when there is a hard dependency and when it's a default choice. What do you think @miri64 @maribu? (I would nonetheless for this PR just move fuzzing up, and do this in a follow up)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16268#issuecomment-818571583
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210413/abe706c1/attachment.htm>


More information about the notifications mailing list