linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* PPC uImage build not reporting correctly
@ 2005-05-06 15:23 Kumar Gala
  2005-05-06 21:45 ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Kumar Gala @ 2005-05-06 15:23 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Tom Rini, Linux Kernel list, linuxppc-embedded list

Sam,

Tom pointed me at you to look at a makefile issue with 
arch/ppc/boot/images/Makefile.  When I do the following:

$ make uImage
   CHK     include/linux/version.h
make[1]: `arch/ppc/kernel/asm-offsets.s' is up to date.
   CHK     include/linux/compile.h
   CHK     usr/initramfs_list
   UIMAGE  arch/ppc/boot/images/uImage
Image Name:   Linux-2.6.12-rc3
Created:      Fri May  6 10:19:28 2005
Image Type:   PowerPC Linux Kernel Image (gzip compressed)
Data Size:    993322 Bytes = 970.04 kB = 0.95 MB
Load Address: 0x00000000
Entry Point:  0x00000000
   Image: arch/ppc/boot/images/uImage not made

The issue is that the file arch/ppc/boot/images/uImage does exit (the 
'not made' is not correct).

$(obj)/uImage: $(obj)/vmlinux.gz
         $(Q)rm -f $@
         $(call if_changed,uimage)
         @echo '  Image: $@' $(if $(wildcard $@),'is ready','not made')

It seems the $(wildcard $@) expands at the start of the rule.  Any 
ideas?

- kumar 

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

* Re: PPC uImage build not reporting correctly
  2005-05-06 15:23 Kumar Gala
@ 2005-05-06 21:45 ` Sam Ravnborg
  2005-05-06 21:57   ` Kumar Gala
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2005-05-06 21:45 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Tom Rini, Sam Ravnborg, Linux Kernel list, linuxppc-embedded list

> Sam,
>
> Tom pointed me at you to look at a makefile issue with
> arch/ppc/boot/images/Makefile.  When I do the following:
>
> $ make uImage
>    CHK     include/linux/version.h
> make[1]: `arch/ppc/kernel/asm-offsets.s' is up to date.
>    CHK     include/linux/compile.h
>    CHK     usr/initramfs_list
>    UIMAGE  arch/ppc/boot/images/uImage
> Image Name:   Linux-2.6.12-rc3
> Created:      Fri May  6 10:19:28 2005
> Image Type:   PowerPC Linux Kernel Image (gzip compressed)
> Data Size:    993322 Bytes = 970.04 kB = 0.95 MB
> Load Address: 0x00000000
> Entry Point:  0x00000000
>    Image: arch/ppc/boot/images/uImage not made
>
> The issue is that the file arch/ppc/boot/images/uImage does exit (the
> 'not made' is not correct).
>
> $(obj)/uImage: $(obj)/vmlinux.gz
>          $(Q)rm -f $@
>          $(call if_changed,uimage)
>          @echo '  Image: $@' $(if $(wildcard $@),'is ready','not made')
>
> It seems the $(wildcard $@) expands at the start of the rule.  Any
> ideas?

It probarly uses the build-in cache in make - and I see no easy way to
tell make not to use the cache in this case.
Could you try to replace "$(wildcard $@)" with something like:
$(shell if -f $@ echo Y; fi)

Untested - I'm not on a Linux box right now.

   Sam

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

* Re: PPC uImage build not reporting correctly
  2005-05-06 21:45 ` Sam Ravnborg
@ 2005-05-06 21:57   ` Kumar Gala
  0 siblings, 0 replies; 8+ messages in thread
From: Kumar Gala @ 2005-05-06 21:57 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Tom Rini, Linux Kernel list, linuxppc-embedded list


On May 6, 2005, at 4:45 PM, Sam Ravnborg wrote:

> > Sam,
>  >
>  > Tom pointed me at you to look at a makefile issue with
>  > arch/ppc/boot/images/Makefile.=A0 When I do the following:
>  >
>  > $ make uImage
>  >=A0=A0=A0 CHK=A0=A0=A0=A0 include/linux/version.h
> > make[1]: `arch/ppc/kernel/asm-offsets.s' is up to date.
>  >=A0=A0=A0 CHK=A0=A0=A0=A0 include/linux/compile.h
> >=A0=A0=A0 CHK=A0=A0=A0=A0 usr/initramfs_list
> >=A0=A0=A0 UIMAGE=A0 arch/ppc/boot/images/uImage
> > Image Name:=A0=A0 Linux-2.6.12-rc3
>  > Created:=A0=A0=A0=A0=A0 Fri May=A0 6 10:19:28 2005
> > Image Type:=A0=A0 PowerPC Linux Kernel Image (gzip compressed)
>  > Data Size:=A0=A0=A0 993322 Bytes =3D 970.04 kB =3D 0.95 MB
>  > Load Address: 0x00000000
>  > Entry Point:=A0 0x00000000
>  >=A0=A0=A0 Image: arch/ppc/boot/images/uImage not made
>  >
>  > The issue is that the file arch/ppc/boot/images/uImage does exit=20
> (the
>  > 'not made' is not correct).
>  >
>  > $(obj)/uImage: $(obj)/vmlinux.gz
> >=A0=A0=A0=A0=A0=A0=A0=A0=A0 $(Q)rm -f $@
>  >=A0=A0=A0=A0=A0=A0=A0=A0=A0 $(call if_changed,uimage)
> >=A0=A0=A0=A0=A0=A0=A0=A0=A0 @echo '=A0 Image: $@' $(if $(wildcard =
$@),'is ready','not=20
> made')
>  >
>  > It seems the $(wildcard $@) expands at the start of the rule.=A0 =
Any
>  > ideas?
>
> It probarly uses the build-in cache in make - and I see no easy way to
>  tell make not to use the cache in this case.
>  Could you try to replace "$(wildcard $@)" with something like:
> $(shell if -f $@ echo Y; fi)
>
> Untested - I'm not on a Linux box right now.

I tried the following w/o success:

$(obj)/uImage: $(obj)/vmlinux.gz
         $(Q)rm -f $@
         $(call if_changed,uimage)
         @echo '  Image: $@' $(shell if [ -f $@ ]; then echo 'is ready';=20=

else echo 'not made'; fi)

- kumar=

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

* Re: PPC uImage build not reporting correctly
       [not found] <Pine.LNX.4.63.0505061718380.6288@xmission.xmission.com>
@ 2005-05-09 15:19 ` Kumar Gala
  2005-05-10  4:28   ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: Kumar Gala @ 2005-05-09 15:19 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Tom Rini,
	<cpclark@xmission.com> <cpclark@xmission.com>,
	Linux Kernel list, linuxppc-embedded list


On May 6, 2005, at 6:22 PM, <cpclark@xmission.com> wrote:

> On Fri, 6 May 2005, Kumar Gala wrote:
>  > I tried the following w/o success:
>  >
> > $(obj)/uImage: $(obj)/vmlinux.gz
> >=A0=A0=A0=A0=A0=A0=A0=A0 $(Q)rm -f $@
>  >=A0=A0=A0=A0=A0=A0=A0=A0 $(call if_changed,uimage)
> >=A0=A0=A0=A0=A0=A0=A0=A0 @echo '=A0 Image: $@' $(shell if [ -f $@ ]; =
then echo 'is=20
> ready'; else
>  > echo 'not made'; fi)
>
> Couldn't you eliminate the ($shell ..) construct altogether, like=20
> this?:
>
> $(obj)/uImage: $(obj)/vmlinux.gz
> =A0=A0=A0=A0=A0=A0=A0 $(Q)rm -f $@
>  =A0=A0=A0=A0=A0=A0=A0 $(call if_changed,uimage)
> =A0=A0=A0=A0=A0=A0=A0 @echo -n '=A0 Image: $@'
>  =A0=A0=A0=A0=A0=A0=A0 @if [ -f $@ ]; then echo 'is ready' ; else echo =
'not made'; fi

Yes, and this seems to actually work.

Sam, does this look reasonable to you.  If so I will work up a patch.

thanks

- kumar

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

* Re: PPC uImage build not reporting correctly
  2005-05-09 15:19 ` Kumar Gala
@ 2005-05-10  4:28   ` Sam Ravnborg
  2005-05-10 10:34     ` cpclark
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2005-05-10  4:28 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Tom Rini,
	<cpclark@xmission.com> <cpclark@xmission.com>,
	Linux Kernel list, linuxppc-embedded list

On Mon, May 09, 2005 at 10:19:01AM -0500, Kumar Gala wrote:
> 
> On May 6, 2005, at 6:22 PM, <cpclark@xmission.com> wrote:
> 
> >On Fri, 6 May 2005, Kumar Gala wrote:
> > > I tried the following w/o success:
> > >
> >> $(obj)/uImage: $(obj)/vmlinux.gz
> >>???????? $(Q)rm -f $@
> > >???????? $(call if_changed,uimage)
> >>???????? @echo '? Image: $@' $(shell if [ -f $@ ]; then echo 'is 
> >ready'; else
> > > echo 'not made'; fi)
> >
> >Couldn't you eliminate the ($shell ..) construct altogether, like 
> >this?:
> >
> >$(obj)/uImage: $(obj)/vmlinux.gz
> >??????? $(Q)rm -f $@
> > ??????? $(call if_changed,uimage)
> >??????? @echo -n '? Image: $@'
> > ??????? @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
> 
> Yes, and this seems to actually work.
> 
> Sam, does this look reasonable to you.  If so I will work up a patch.
Looks ok - but I do not see why use of $(shell ...) did not work out.
Please bring your working version forward.

	Sam

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

* Re: PPC uImage build not reporting correctly
  2005-05-10  4:28   ` Sam Ravnborg
@ 2005-05-10 10:34     ` cpclark
  2005-05-11  5:01       ` Sam Ravnborg
  0 siblings, 1 reply; 8+ messages in thread
From: cpclark @ 2005-05-10 10:34 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Tom Rini, Linux Kernel list, linuxppc-embedded list

On Tue, 10 May 2005, Sam Ravnborg wrote:

> On Mon, May 09, 2005 at 10:19:01AM -0500, Kumar Gala wrote:
> > 
> > On May 6, 2005, at 6:22 PM, <cpclark@xmission.com> wrote:
> > 
> > >On Fri, 6 May 2005, Kumar Gala wrote:
> > > > I tried the following w/o success:
> > > >
> > > > $(obj)/uImage: $(obj)/vmlinux.gz
> > > >         $(Q)rm -f $@
> > > >         $(call if_changed,uimage)
> > > >         @echo ' Image: $@' $(shell if [ -f $@ ]; then echo 'is ready'; else echo 'not made'; fi)
> > >
> > >Couldn't you eliminate the ($shell ..) construct altogether, like this?:
> > >
> > >$(obj)/uImage: $(obj)/vmlinux.gz
> > >        $(Q)rm -f $@
> > >        $(call if_changed,uimage)
> > >        @echo -n '? Image: $@'
> > >        @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
> > 
> > Yes, and this seems to actually work.
> > 
> > Sam, does this look reasonable to you.  If so I will work up a patch.
>
> Looks ok - but I do not see why use of $(shell ...) did not work out.

As I understand it, the $(shell ...) construct doesn't "work" in the case 
cited above because make evaluates/expands the $(shell ...) stuff while it 
is parsing the makefile and building the command list--i.e. before it has 
issued any commands to build anything.  What seems to be desired in this 
case is a file-existence test which runs "inline" with respect to the 
preceding commands.  The use of $(shell ...) inside a command 
subverts/preempts that natural sequence.  I think. :-)

Chris

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

* RE: PPC uImage build not reporting correctly
@ 2005-05-10 15:14 Stephen Warren
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Warren @ 2005-05-10 15:14 UTC (permalink / raw)
  To: Sam Ravnborg, Kumar Gala
  Cc: Tom Rini, cpclark, Linux Kernel list, linuxppc-embedded list

From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Sam Ravnborg
> On Mon, May 09, 2005 at 10:19:01AM -0500, Kumar Gala wrote:
> > On May 6, 2005, at 6:22 PM, <cpclark@xmission.com> wrote:
> > > Couldn't you eliminate the ($shell ..) construct altogether, like=20
> > > this?:
> > >
> > > $(obj)/uImage: $(obj)/vmlinux.gz
> > > ??????? $(Q)rm -f $@
> > > ??????? $(call if_changed,uimage)
> > > ??????? @echo -n '? Image: $@'
> > > ??????? @if [ -f $@ ]; then echo 'is ready' ; else echo 'not
made'; fi
> >=20
> > Yes, and this seems to actually work.
> >=20
> > Sam, does this look reasonable to you.  If so I will work up a
patch.
>
> Looks ok - but I do not see why use of $(shell ...) did not work out.
> Please bring your working version forward.
=20
It's because both any $(xxx) in the command will be expanded prior to
the command being executed ("command" meaning all lines in the complete
command script for the target in question - not on a line-by-line
basis).

Thus, the original $(wildcard), and also the $(shell) above are
evaluated/expanded by gmake prior to running any of the the "rm -rf",
"if_changed", and "echo" commands, and hence run before the uImage file
is created, and hence always think that it doesn't exist.

The only solution is to get the shell to do the evaluation of whether
uImage exists - that way, the evaluation is guaranteed to happen after
the uImage is (hopefully) created.

--=20
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@nvidia.com        http://www.nvidia.com/
swarren@wwwdotorg.org     http://www.wwwdotorg.org/pgp.html

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

* Re: PPC uImage build not reporting correctly
  2005-05-10 10:34     ` cpclark
@ 2005-05-11  5:01       ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2005-05-11  5:01 UTC (permalink / raw)
  To: cpclark; +Cc: Tom Rini, Linux Kernel list, linuxppc-embedded list

 >
> > Looks ok - but I do not see why use of $(shell ...) did not work out.
> 
> As I understand it, the $(shell ...) construct doesn't "work" in the case 
> cited above because make evaluates/expands the $(shell ...) stuff while it 
> is parsing the makefile and building the command list--i.e. before it has 
> issued any commands to build anything.  What seems to be desired in this 
> case is a file-existence test which runs "inline" with respect to the 
> preceding commands.  The use of $(shell ...) inside a command 
> subverts/preempts that natural sequence.  I think. :-)

That explains it - thanks!

	Sam

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

end of thread, other threads:[~2005-05-11  4:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10 15:14 PPC uImage build not reporting correctly Stephen Warren
     [not found] <Pine.LNX.4.63.0505061718380.6288@xmission.xmission.com>
2005-05-09 15:19 ` Kumar Gala
2005-05-10  4:28   ` Sam Ravnborg
2005-05-10 10:34     ` cpclark
2005-05-11  5:01       ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2005-05-06 15:23 Kumar Gala
2005-05-06 21:45 ` Sam Ravnborg
2005-05-06 21:57   ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).