Re: targets in :child recipes

Tim Hemel <[email protected]>
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
On Fri, Dec 05, 2003 at 05:50:01PM +0100, Tim Hemel wrote:
> main.aap:
> -----------------------------------------------------------
> Modules = etc base kernel rcfiles
> @for d in expand2list(Modules):
>         :child $d/main.aap
> 
> ROOTFS = rootfs
> 
> image: $ROOTFS
>         :pass
> 
> $ROOTFS: inst-kernel
>         :pass
> -----------------------------------------------------------
> 
> kernel/main.aap:
> -----------------------------------------------------------
> BUILD=`var_abspath("build")`
> 
> _top.KERNEL=$BUILD/bsd
> KERNCONF=`var_abspath("NET4501")`
> KERNSRC=/usr/src/sys
> 
> $_top.KERNEL: $KERNCONF
>         :sys config -b $BUILD -s $KERNSRC $KERNCONF
>         :cd $BUILD
>         :sys make clean && make depend && make
> 
> inst-kernel: $_top.KERNEL
>         :print Install kernel to $_top.ROOTFS
> -----------------------------------------------------------
> 
> For some reason however, the inst-kernel target is not seen:
> 
> buma# aap image
> Aap: Do not know how to build "inst-kernel"
> 
> It is defined in a child recipe however. Should I refer to targets in a
> child recipe by a different name, or could this be a bug?

I made it work. Virtual targets in child recipes are not seen, unless they are
explicitly marked virtual. I did not understand this from the manual.
The solution is to use:

inst-kernel {virtual}{remember} : $_top.KERNEL

The {remember} attribute makes the recipe a bit more efficient.


Tim

-- 
Zen Microsystems: we're the om in .commmmmmmmm...


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.