[jamming] yet another newbie
paulf at metainfo.com
Thu Apr 7 17:27:01 PDT 2005
What the grist is depends on where you are relative to the directory
the files in question are. That's why what you did worked in Parser.d
but not in $(TOP). It isn't something you manually do like that. See
Jambase's FGrist rules.
Library libparser : paux.C [ FGristFiles lex.yy.c y.tab.c ] ;
and removing your manual gristing should do it.
I will point out again you are kind of looking at this backwards. In
make we are used to specifying the dependencies like how you are doing
it one level at a time. Jam is really nice in contrast because it uses
rules to fill in all the intermediate dependencies. The generated code
from tools like yacc and lex are treated as intermediate object files
that you never have to bother with. And that is also the reason that
your Jamfile has to kludge around like this with the gristing.
Gristing is something your everyday Jamfiles should never have to
Is there any particular reason you are not letting the stock Jamrules
build the library from lexer.l and p.y as source files?
On Apr 7, 2005, at 4:39 PM, Anton Evgrafov wrote:
> Thanks for your reply! How do I add grists correctly? I tried for
> example to
> change $(TOP)/Parser.d/Jamfile as
> Library libparser : paux.C lex.yy.c y.tab.c ;
> MyYacc <Parser.d>y.tab.c <Parser.d>y.tab.h : <Parser.d>p.y ;
> MyLex <Parser.d>lex.yy.c : <Parser.d>lexer.l <Parser.d>y.tab.h ;
> Then I can run jam in $(TOP)/Parser.d but not in $(TOP).
>> But.. with the stock Jambase, you should be able to simply say:
>> Library libparser : paux.C p.y lexer.l ;
>> So I don't know why you are making life so hard on yourself.
> The reason for that is that I don't want to rename files in this
> fortran/c/c++ project. E.g., y.tab.h generated by yacc is used
> elsewhere in
> the project; there are other examples, where for example we have
> file.h, file.l and file.y -- separate project files sharing a single
> So I thought that writing (read: copy-pasting) a couple of custom
> rules for
> jam is in fact easier than renaming the whole bunch of project files,
> dependencies, etc. Was I wrong?
More information about the jamming