mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] firmware: fix external firmware dependencies
@ 2024-01-16  9:10 Sascha Hauer
  2024-01-16  9:15 ` Ahmad Fatoum
  2024-01-17  7:17 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Sascha Hauer @ 2024-01-16  9:10 UTC (permalink / raw)
  To: Barebox List; +Cc: Ahmad Fatoum, Marco Felsch

A pbl is not rebuilt when the firmware file specified in fw-external-y
changes.

$(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)) is executed before
pbl-y actually contains the contents of fw-external-y. Also we want to
do the subsitution only for the external firmware files, not for pbl-y.

To fix this use a intermediate variable pbl-fwext-y instead of pbl-y and
initialize it before usage.

Also, use $$(wildcard $(fwdir)/%) instead of $(fwdir)/% to successfully
compile when the external firmware file is missing.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 firmware/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/firmware/Makefile b/firmware/Makefile
index 4c68817fc6..27504e9442 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -42,6 +42,7 @@ fwobjdir := $(objtree)/firmware
 
 pbl-y     := $(addsuffix .gen.o, $(pbl-firmware-y))
 obj-pbl-y := $(addsuffix .gen.o, $(firmware-y))
+pbl-fwext-y := $(addsuffix .extgen.o, $(fw-external-y))
 
 FWNAME    = $(patsubst $(obj)/%.extgen.S,%,$(patsubst $(obj)/%.gen.S,%,$@))
 FWSTR     = $(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME))))
@@ -104,9 +105,9 @@ $(patsubst %.gen.o,$(obj)/%.gen.o, $(obj-pbl-y)): $(obj)/%.gen.o: $(fwdir)/%
 # The same for pbl:
 .SECONDEXPANSION:
 $(patsubst %.gen.o,$(obj)/%.gen.pbl.o, $(obj-pbl-y) $(pbl-y)): $(obj)/%.gen.pbl.o: $$(wildcard $(fwdir)/%)
-$(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)): $(obj)/%.extgen.pbl.o: $(fwdir)/%
+$(patsubst %.extgen.o,$(obj)/%.extgen.pbl.o, $(pbl-fwext-y)): $(obj)/%.extgen.pbl.o: $$(wildcard $(fwdir)/%)
 
-pbl-y += $(addsuffix .extgen.o, $(fw-external-y))
+pbl-y += $(pbl-fwext-y)
 
 targets := $(patsubst $(obj)/%,%, \
                                 $(shell find $(obj) -name \*.gen.S 2>/dev/null))
-- 
2.39.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] firmware: fix external firmware dependencies
  2024-01-16  9:10 [PATCH] firmware: fix external firmware dependencies Sascha Hauer
@ 2024-01-16  9:15 ` Ahmad Fatoum
  2024-01-16  9:51   ` Marco Felsch
  2024-01-17  7:17 ` Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2024-01-16  9:15 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List; +Cc: Marco Felsch

Hello Sascha,

On 16.01.24 10:10, Sascha Hauer wrote:
> A pbl is not rebuilt when the firmware file specified in fw-external-y
> changes.
> 
> $(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)) is executed before
> pbl-y actually contains the contents of fw-external-y. Also we want to
> do the subsitution only for the external firmware files, not for pbl-y.
> 
> To fix this use a intermediate variable pbl-fwext-y instead of pbl-y and
> initialize it before usage.
> 
> Also, use $$(wildcard $(fwdir)/%) instead of $(fwdir)/% to successfully
> compile when the external firmware file is missing.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Thanks for fixing!

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Cheers,
Ahmad



> ---
>  firmware/Makefile | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/firmware/Makefile b/firmware/Makefile
> index 4c68817fc6..27504e9442 100644
> --- a/firmware/Makefile
> +++ b/firmware/Makefile
> @@ -42,6 +42,7 @@ fwobjdir := $(objtree)/firmware
>  
>  pbl-y     := $(addsuffix .gen.o, $(pbl-firmware-y))
>  obj-pbl-y := $(addsuffix .gen.o, $(firmware-y))
> +pbl-fwext-y := $(addsuffix .extgen.o, $(fw-external-y))
>  
>  FWNAME    = $(patsubst $(obj)/%.extgen.S,%,$(patsubst $(obj)/%.gen.S,%,$@))
>  FWSTR     = $(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME))))
> @@ -104,9 +105,9 @@ $(patsubst %.gen.o,$(obj)/%.gen.o, $(obj-pbl-y)): $(obj)/%.gen.o: $(fwdir)/%
>  # The same for pbl:
>  .SECONDEXPANSION:
>  $(patsubst %.gen.o,$(obj)/%.gen.pbl.o, $(obj-pbl-y) $(pbl-y)): $(obj)/%.gen.pbl.o: $$(wildcard $(fwdir)/%)
> -$(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)): $(obj)/%.extgen.pbl.o: $(fwdir)/%
> +$(patsubst %.extgen.o,$(obj)/%.extgen.pbl.o, $(pbl-fwext-y)): $(obj)/%.extgen.pbl.o: $$(wildcard $(fwdir)/%)
>  
> -pbl-y += $(addsuffix .extgen.o, $(fw-external-y))
> +pbl-y += $(pbl-fwext-y)
>  
>  targets := $(patsubst $(obj)/%,%, \
>                                  $(shell find $(obj) -name \*.gen.S 2>/dev/null))

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] firmware: fix external firmware dependencies
  2024-01-16  9:15 ` Ahmad Fatoum
@ 2024-01-16  9:51   ` Marco Felsch
  0 siblings, 0 replies; 4+ messages in thread
From: Marco Felsch @ 2024-01-16  9:51 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Barebox List

On 24-01-16, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 16.01.24 10:10, Sascha Hauer wrote:
> > A pbl is not rebuilt when the firmware file specified in fw-external-y
> > changes.
> > 
> > $(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)) is executed before
> > pbl-y actually contains the contents of fw-external-y. Also we want to
> > do the subsitution only for the external firmware files, not for pbl-y.
> > 
> > To fix this use a intermediate variable pbl-fwext-y instead of pbl-y and
> > initialize it before usage.
> > 
> > Also, use $$(wildcard $(fwdir)/%) instead of $(fwdir)/% to successfully
> > compile when the external firmware file is missing.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Thanks for fixing!

+1 :)

> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

> 
> Cheers,
> Ahmad
> 
> 
> 
> > ---
> >  firmware/Makefile | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/firmware/Makefile b/firmware/Makefile
> > index 4c68817fc6..27504e9442 100644
> > --- a/firmware/Makefile
> > +++ b/firmware/Makefile
> > @@ -42,6 +42,7 @@ fwobjdir := $(objtree)/firmware
> >  
> >  pbl-y     := $(addsuffix .gen.o, $(pbl-firmware-y))
> >  obj-pbl-y := $(addsuffix .gen.o, $(firmware-y))
> > +pbl-fwext-y := $(addsuffix .extgen.o, $(fw-external-y))
> >  
> >  FWNAME    = $(patsubst $(obj)/%.extgen.S,%,$(patsubst $(obj)/%.gen.S,%,$@))
> >  FWSTR     = $(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME))))
> > @@ -104,9 +105,9 @@ $(patsubst %.gen.o,$(obj)/%.gen.o, $(obj-pbl-y)): $(obj)/%.gen.o: $(fwdir)/%
> >  # The same for pbl:
> >  .SECONDEXPANSION:
> >  $(patsubst %.gen.o,$(obj)/%.gen.pbl.o, $(obj-pbl-y) $(pbl-y)): $(obj)/%.gen.pbl.o: $$(wildcard $(fwdir)/%)
> > -$(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)): $(obj)/%.extgen.pbl.o: $(fwdir)/%
> > +$(patsubst %.extgen.o,$(obj)/%.extgen.pbl.o, $(pbl-fwext-y)): $(obj)/%.extgen.pbl.o: $$(wildcard $(fwdir)/%)
> >  
> > -pbl-y += $(addsuffix .extgen.o, $(fw-external-y))
> > +pbl-y += $(pbl-fwext-y)
> >  
> >  targets := $(patsubst $(obj)/%,%, \
> >                                  $(shell find $(obj) -name \*.gen.S 2>/dev/null))
> 
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] firmware: fix external firmware dependencies
  2024-01-16  9:10 [PATCH] firmware: fix external firmware dependencies Sascha Hauer
  2024-01-16  9:15 ` Ahmad Fatoum
@ 2024-01-17  7:17 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2024-01-17  7:17 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer; +Cc: Ahmad Fatoum, Marco Felsch


On Tue, 16 Jan 2024 10:10:20 +0100, Sascha Hauer wrote:
> A pbl is not rebuilt when the firmware file specified in fw-external-y
> changes.
> 
> $(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)) is executed before
> pbl-y actually contains the contents of fw-external-y. Also we want to
> do the subsitution only for the external firmware files, not for pbl-y.
> 
> [...]

Applied, thanks!

[1/1] firmware: fix external firmware dependencies
      https://git.pengutronix.de/cgit/barebox/commit/?id=f053db526549 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-17  7:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16  9:10 [PATCH] firmware: fix external firmware dependencies Sascha Hauer
2024-01-16  9:15 ` Ahmad Fatoum
2024-01-16  9:51   ` Marco Felsch
2024-01-17  7:17 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox