RE: PPC uImage build not reporting correctly

From: Stephen Warren
Date: Tue May 10 2005 - 10:28:22 EST


From: linux-kernel-owner@xxxxxxxxxxxxxxx
[mailto:linux-kernel-owner@xxxxxxxxxxxxxxx] 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@xxxxxxxxxxxx> wrote:
> > > 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.

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.

--
Stephen Warren, Software Engineer, NVIDIA, Fort Collins, CO
swarren@xxxxxxxxxx http://www.nvidia.com/
swarren@xxxxxxxxxxxxx http://www.wwwdotorg.org/pgp.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/