[jamming] Implicit action won't work

Ingo Weinhold bonefish at cs.tu-berlin.de
Mon Feb 10 02:39:38 PST 2003


On Mon, 10 Feb 2003, Russell wrote:

> Ingo Weinhold wrote:
> >>Russell wrote:
> ...
> >>Running jam gives:
> >>   Rule HEX: myprog myprog.exe
> >>   Action HEX: myprog objs/myprog.exe
> >>
> >>I don't understand why the second line doesn't say:
> >>   Action HEX: objs/myprog objs/myprog.exe
> >
> >
> > I don't know either. I threw your lines into a Jamfile and got:
> >
> > $ jam-2.4
> > Rule HEX: myprog myprog.exe
> > ..found 9 target(s)...
> > ..updating 1 target(s)...
> > HEX objs/myprog
> > Action HEX: objs/myprog objs/myprog.exe
> > ..updated 1 target(s)...
> >
> > Tested with plain Jam 2.4.
>
> Hi, i managed to get that result too (working too late;)
>
> I think i don't fully understand the jam process, so i made
> a small example that causes various problems.
> In Jamrules, i have:
>
> TOP = /home/russell/test ;
> SUFEXE = .exe ;
> rule HEX
> {
>    local _h ;
>    _h = $(<:S=.hex) ;
>    Depends $(_h) : $(>) ;
>    Depends all : $(_h) ;
>    echo "Rule Hex:" $(<) $(_h) S(>) ;
> }
> actions HEX
> {
>    echo "Action hex:" $(<) $(>)
> }
>
> In Jamfile, i have:
>
> SubDir TOP ;
> HEX myprog : myprog.exe ;
>
> I created /home/russell/test/myprog.exe with "touch myprog.exe".
>
> When i run jam, i get:
>
>    Rule hex: myprog myprog.hex myprog.exe
>    ...found 9 target(s)...
>
> which shows action HEX didn't execute. The last few lines of jam -d 3
> shows:
>    made  newer myprog.exe
>    made+ missing myprog.hex
>    made  update all
>    ...found 9 target(s)...
>
> I don't know why "actions HEX" doesn't work. There's no jam options
> to put out a simple dependency tree.

Mmh, what is wrong with `-d3'?

Your problem here is that HEX is invoked on myprog.exe, not on myprog.hex.
Thus for jam no rule is invoked on myprog.hex and hence it can't execute
any actions.

You can work around by renaming the actions to HEX1 and add
`HEX1 $(_h) : $(>) ;' to your HEX rule. This way HEX1 is called for your
target and the respective actions will be executed.

CU, Ingo




More information about the jamming mailing list