[riot-notifications] [RIOT-OS/RIOT] sys/ecc: move hamming256 module to generic ecc (#9988)

Marian Buschsieweke notifications at github.com
Fri Mar 22 12:09:13 CET 2019


maribu commented on this pull request.



> @@ -811,3 +811,7 @@ USEPKG := $(sort $(USEPKG))
 ifneq ($(OLD_USEMODULE) $(OLD_USEPKG),$(USEMODULE) $(USEPKG))
   include $(RIOTBASE)/Makefile.dep
 endif
+
+ifneq (,$(filter ecc_%,$(USEMODULE)))
+  USEMODULE += ecc
+endif

To explain what the bug is: in
``` Makefile
ifneq ($(OLD_USEMODULE) $(OLD_USEPKG),$(USEMODULE) $(USEPKG)) 
   include $(RIOTBASE)/Makefile.dep 
endif 
```

The file `Makefile.dep` is included again until no changes in the used modules have taken place. E.g. lets assume at the top of the file some additional modules would have been added if module `ecc` was enabled, but that code did not trigger as `ecc` was not part of `USEMODULE` at that time. The recursive include makes sure that every dependency is caught. Moving the code below that will prevent this from happening.

Another issue is that this line

``` Makefile
USEMODULE := $(sort $(USEMODULE)) 
```

make sure that every module is only once in `USEMODULE` (it sorts and removes duplicates). If `USEMODULE` would contain duplicates, compilation would fail. E.g. if `ecc` was already part of `USEMODULE` the insertion of `ecc` in line 816 would result in such a duplicate.

Being honest, I'm not really an expert in the build system. Maybe @kaspar030 or @cladmi could confirm if I got the details right.

-- 
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/9988#discussion_r268125087
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190322/8285340e/attachment.html>


More information about the notifications mailing list