[riot-notifications] [RIOT-OS/RIOT] makefiles/info.inc.mk: fix supported boards output (#14009)

Francisco notifications at github.com
Tue May 5 16:22:44 CEST 2020


Discussed about this with @aabadie. There are two issues here:

- the warning for `BOARDSDIR` being set is appearing in `sub-make`
- there is incorrect handling for the `BOARD` variable passed as a make argument.

Regarding the first issue I think a possible fix could be:

```diff
diff --git a/Makefile.include b/Makefile.include
index 37e935377a..a7651f021a 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -99,8 +99,11 @@ endif
 ifneq (,$(BOARDSDIR))
   # Only warn users, not the CI.
   ifneq ($(RIOT_CI_BUILD),1)
-    $(warning Using BOARDSDIR is deprecated use EXTERNAL_BOARD_DIRS instead)
-    $(info EXTERNAL_BOARD_DIRS can contain multiple folders separated by space)
+    # Do not warn when set from sub-make
+    ifeq ($(MAKELEVEL),0)
+      $(warning Using BOARDSDIR is deprecated use EXTERNAL_BOARD_DIRS instead)
+      $(info EXTERNAL_BOARD_DIRS can contain multiple folders separated by space)
+    endif
   endif
   EXTERNAL_BOARD_DIRS += $(BOARDSDIR)
 endif
```

that way if the user sets it he will still get a warning, but the fact that we set `BOARDSDIR` in `Makefile.include` will trigger an error in sub-makes.

We can remove all of this when `BOARDSDIR` is removed.

The second issue is just because `BOARD` does not get set to `none`. Setting the `BOARD` to `none` is useless so IMO the fix for that is just:

```diff
diff --git a/Makefile.include b/Makefile.include
index 37e935377a..707ad42f95 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -175,11 +175,8 @@ include $(RIOTMAKE)/boards.inc.mk
 include $(RIOTMAKE)/dependencies_debug.inc.mk
 
 GLOBAL_GOALS += buildtest buildtest-indocker info-boards-supported info-boards-features-missing info-buildsizes info-buildsizes-diff
-ifneq (, $(filter $(GLOBAL_GOALS), $(MAKECMDGOALS)))
-  BOARD=none
-endif
 
-ifeq (none,$(BOARD))
+ifneq (, $(filter $(GLOBAL_GOALS), $(MAKECMDGOALS)))
   include $(RIOTMAKE)/info-global.inc.mk
   include $(RIOTMAKE)/buildtests.inc.mk
 else
@@ -940,7 +937,7 @@ ifneq ($(_BASELIBS_VALUE_BEFORE_USAGE),$(BASELIBS))
   $(error BASELIBS value changed)
 endif
 
-endif # BOARD=none
+endif
 
 # include RIOT_MAKEFILES_GLOBAL_POST configuration files
 # allows setting user specific system wide configuration parsed after the body
``` 

-- 
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/14009#issuecomment-624085794
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200505/3016c75c/attachment-0001.htm>


More information about the notifications mailing list