[riot-notifications] [RIOT-OS/RIOT] makefiles: introduce 'LIBS' variable (#11111)

Gaëtan Harter notifications at github.com
Tue Mar 5 17:28:26 CET 2019


### Contribution description

This introduced the LIBS variables to declare a module as a static
library.

It is a requirement to allow handling linking differently between
static libraries and shared libraries in upcoming pull requests.

Co-authored-by: Joakim Nohlgård <joakim.nohlgard at eistec.se>

This is split of https://github.com/RIOT-OS/RIOT/pull/8711 and modified as some specific handling done for `USEPKG` is not necessary anymore.

I took the same "static libraries" and "shared libraries" from `man ld` in the `--whole-archive` section.

### Testing procedure


Compiling should sill work in the same way and the output of `BASELIBS` should not have changed.

To simplify testing, I comment `APPDEPS` in the pic32 boards as it contains the full path and is not relevant for this test:

```diff
diff --git a/boards/pic32-clicker/Makefile.include b/boards/pic32-clicker/Makefile.include
index 264f0e502..3c9c68a90 100644
--- a/boards/pic32-clicker/Makefile.include
+++ b/boards/pic32-clicker/Makefile.include
@@ -1,4 +1,4 @@
 export CPU = mips_pic32mx
 export CPU_MODEL=p32mx470f512h
-export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S
+#export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S
 export USE_UHI_SYSCALLS = 1
diff --git a/boards/pic32-wifire/Makefile.include b/boards/pic32-wifire/Makefile.include
index 7e4a7c738..3c1a62eca 100644
--- a/boards/pic32-wifire/Makefile.include
+++ b/boards/pic32-wifire/Makefile.include
@@ -1,4 +1,4 @@
 export CPU = mips_pic32mz
 export CPU_MODEL=p32mz2048efg100
-export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S
+#export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S
 export USE_UHI_SYSCALLS = 1
```

and compare the value of `BASELIBS`.

I use https://gist.github.com/cladmi/9818888da7412a9195ec0d4c3c2a8b8a to compare the output and it should see no difference:

    BINDIR='/tmp/bin/$(BOARD)' ./scripts/compare_riot_repositories_variable_value.sh riot_master riot_pr BASELIBS

There are currently /bin/sh: 1: Syntax error: Missing '))' messages but they are unrelated.


### Issues/PRs references

This is a split and refactored out of https://github.com/RIOT-OS/RIOT/pull/8711
Depends on https://github.com/RIOT-OS/RIOT/pull/11109 refactoring
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11111

-- Commit Summary --

  * makefiles/modules.inc.mk: do not export USEMODULE
  * makefiles/modules.inc.mk: do not export BASELIBS
  * makefiles/modules.inc.mk: factorize in _ALLMODULES
  * makefiles/modules.inc.mk: group CFLAGS handling
  * makefiles/modules.inc.mk: refactor, do not overwrite NO_PSEUDOMODULES
  * makefiles: introduce 'LIBS' variable

-- File Changes --

    M makefiles/modules.inc.mk (24)
    M makefiles/vars.inc.mk (1)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11111.patch
https://github.com/RIOT-OS/RIOT/pull/11111.diff

-- 
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/11111
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190305/ff63e12d/attachment-0001.html>


More information about the notifications mailing list