<p>Nico Huber has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27324">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Makefile.inc: Rewrite $(files-in-dir)<br><br>The $(files-in-dir) macro is supposed to return all files (out of a<br>given set) that reside directly (non-recursive) in a given directory.<br>While the current solution worked splendidly, we can achieve the same<br>without recursive macros that look at each parent dir individually.<br><br>This also fixes a future make error, as make doesn't like the variable<br>name ` ` anymore ;)<br><br>Change-Id: Iac0eacdf91b8b5098592ad301c1f3fdb632454e9<br>Signed-off-by: Nico Huber <nico.h@gmx.de><br>---<br>M Makefile.inc<br>1 file changed, 8 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/27324/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Makefile.inc b/Makefile.inc</span><br><span>index 446e321..67ddb63 100644</span><br><span>--- a/Makefile.inc</span><br><span>+++ b/Makefile.inc</span><br><span>@@ -155,29 +155,19 @@</span><br><span> # Helper functions for ramstage postprocess</span><br><span> spc :=</span><br><span> spc +=</span><br><span style="color: hsl(0, 100%, 40%);">-$(spc) :=</span><br><span style="color: hsl(0, 100%, 40%);">-$(spc) +=</span><br><span> comma := ,</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# files-in-dir-recursive,dir,files</span><br><span style="color: hsl(0, 100%, 40%);">-files-in-dir-recursive=$(filter $(1)%,$(2))</span><br><span style="color: hsl(120, 100%, 40%);">+# Returns all files and dirs below `dir` (recursively).</span><br><span style="color: hsl(120, 100%, 40%);">+# files-below-dir,dir,files</span><br><span style="color: hsl(120, 100%, 40%);">+files-below-dir=$(filter $(1)%,$(2))</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# parent-dir,dir/</span><br><span style="color: hsl(0, 100%, 40%);">-parent-dir=$(dir $(if $(patsubst /%,,$(1)),,/)$(subst $( ),/,$(strip $(subst /, ,$(1)))))</span><br><span style="color: hsl(120, 100%, 40%);">+# Returns all dirs below `dir` (recursively).</span><br><span style="color: hsl(120, 100%, 40%);">+# dirs-below-dir,dir,files</span><br><span style="color: hsl(120, 100%, 40%);">+dirs-below-dir=$(filter-out $(1),$(sort $(dir $(call files-below-dir,$(1),$(2)))))</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-# filters out exactly the directory specified</span><br><span style="color: hsl(0, 100%, 40%);">-# filter-out-dir,dir_to_keep,dirs</span><br><span style="color: hsl(0, 100%, 40%);">-filter-out-dir=$(filter-out $(1),$(2))</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-# filters out dir_to_keep and all its parents</span><br><span style="color: hsl(0, 100%, 40%);">-# filter-out-dirs,dir_to_keep,dirs</span><br><span style="color: hsl(0, 100%, 40%);">-filter-out-dirs=$(if $(filter-out ./ /,$(1)),$(call filter-out-dirs,$(call parent-dir,$(1)),$(call filter-out-dir,$(1),$(2))),$(call filter-out-dir,$(1),$(2)))</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-# dir-wildcards,dirs</span><br><span style="color: hsl(0, 100%, 40%);">-dir-wildcards=$(addsuffix %,$(1))</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+# Returns all files directly in `dir` (non-recursively).</span><br><span> # files-in-dir,dir,files</span><br><span style="color: hsl(0, 100%, 40%);">-files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(sort $(dir $(2))))),$(call files-in-dir-recursive,$(1),$(2)))</span><br><span style="color: hsl(120, 100%, 40%);">+files-in-dir=$(filter-out $(addsuffix %,$(call dirs-below-dir,$(1),$(2))),$(call files-below-dir,$(1),$(2)))</span><br><span> </span><br><span> #######################################################################</span><br><span> # reduce command line length by linking the objects of each</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27324">change 27324</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27324"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iac0eacdf91b8b5098592ad301c1f3fdb632454e9 </div>
<div style="display:none"> Gerrit-Change-Number: 27324 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Nico Huber <nico.h@gmx.de> </div>