<h3>Contribution description</h3>
<p>This introduced the LIBS variables to declare a module as a static<br>
library.</p>
<p>It is a requirement to allow handling linking differently between<br>
static libraries and shared libraries in upcoming pull requests.</p>
<p>Co-authored-by: Joakim Nohlg√•rd <a href="mailto:joakim.nohlgard@eistec.se">joakim.nohlgard@eistec.se</a></p>
<p>This is split of <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="301403651" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/8711" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/8711/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/8711">#8711</a> and modified as some specific handling done for <code>USEPKG</code> is not necessary anymore.</p>
<p>I took the same "static libraries" and "shared libraries" from <code>man ld</code> in the <code>--whole-archive</code> section.</p>
<h3>Testing procedure</h3>
<p>Compiling should sill work in the same way and the output of <code>BASELIBS</code>¬†should not have changed.</p>
<p>To simplify testing, I comment <code>APPDEPS</code> in the pic32 boards as it contains the full path and is not relevant for this test:</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-c1">diff --git a/boards/pic32-clicker/Makefile.include b/boards/pic32-clicker/Makefile.include</span>
index 264f0e502..3c9c68a90 100644
<span class="pl-md">--- a/boards/pic32-clicker/Makefile.include</span>
<span class="pl-mi1">+++ b/boards/pic32-clicker/Makefile.include</span>
<span class="pl-mdr">@@ -1,4 +1,4 @@</span>
 export CPU = mips_pic32mx
 export CPU_MODEL=p32mx470f512h
<span class="pl-md"><span class="pl-md">-</span>export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S</span>
 export USE_UHI_SYSCALLS = 1
<span class="pl-c1">diff --git a/boards/pic32-wifire/Makefile.include b/boards/pic32-wifire/Makefile.include</span>
index 7e4a7c738..3c1a62eca 100644
<span class="pl-md">--- a/boards/pic32-wifire/Makefile.include</span>
<span class="pl-mi1">+++ b/boards/pic32-wifire/Makefile.include</span>
<span class="pl-mdr">@@ -1,4 +1,4 @@</span>
 export CPU = mips_pic32mz
 export CPU_MODEL=p32mz2048efg100
<span class="pl-md"><span class="pl-md">-</span>export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#export APPDEPS += $(RIOTCPU)/$(CPU)/$(CPU_MODEL)/$(CPU_MODEL).S</span>
 export USE_UHI_SYSCALLS = 1</pre></div>
<p>and compare the value of <code>BASELIBS</code>.</p>
<p>I use <a rel="nofollow" href="https://gist.github.com/cladmi/9818888da7412a9195ec0d4c3c2a8b8a">https://gist.github.com/cladmi/9818888da7412a9195ec0d4c3c2a8b8a</a> to compare the output and it should see no difference:</p>
<pre><code>BINDIR='/tmp/bin/$(BOARD)' ./scripts/compare_riot_repositories_variable_value.sh riot_master riot_pr BASELIBS
</code></pre>
<p>There are currently /bin/sh: 1: Syntax error: Missing '))' messages but they are unrelated.</p>
<h3>Issues/PRs references</h3>
<p>This is a split and refactored out of <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="301403651" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/8711" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/8711/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/8711">#8711</a><br>
Depends on <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="417357309" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11109" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11109/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11109">#11109</a> refactoring</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/RIOT-OS/RIOT/pull/11111'>https://github.com/RIOT-OS/RIOT/pull/11111</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>makefiles/modules.inc.mk: do not export USEMODULE</li>
  <li>makefiles/modules.inc.mk: do not export BASELIBS</li>
  <li>makefiles/modules.inc.mk: factorize in _ALLMODULES</li>
  <li>makefiles/modules.inc.mk: group CFLAGS handling</li>
  <li>makefiles/modules.inc.mk: refactor, do not overwrite NO_PSEUDOMODULES</li>
  <li>makefiles: introduce 'LIBS' variable</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11111/files#diff-0">makefiles/modules.inc.mk</a>
    (24)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/RIOT-OS/RIOT/pull/11111/files#diff-1">makefiles/vars.inc.mk</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11111.patch'>https://github.com/RIOT-OS/RIOT/pull/11111.patch</a></li>
  <li><a href='https://github.com/RIOT-OS/RIOT/pull/11111.diff'>https://github.com/RIOT-OS/RIOT/pull/11111.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11111">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YIWxw9_BZQXjTfmNI76Ws2bs_fvcks5vTpsqgaJpZM4be_fV">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YASf7C463AJKP3TJfOoXod0Hgztiks5vTpsqgaJpZM4be_fV.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"makefiles: introduce 'LIBS' variable (#11111)"}],"action":{"name":"View Pull Request","url":"https://github.com/RIOT-OS/RIOT/pull/11111"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11111",
"url": "https://github.com/RIOT-OS/RIOT/pull/11111",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>