List Info

Thread: Re: Pre-parsing source files before building




Re: Pre-parsing source files before building
user name
2007-08-24 13:57:21
How can I write a rule that tells jam that the parsed
files in the parsed directory depend on the source
files in the source directory? I tried something like
this:

SRCDIR = src
PARSEDDIR = src/parsed
GENSRC = example1.c example2.c ;

rule PreParse
{
LOCATE on $(1) = $(PARSEDDIR) ;
LOCATE on $(2) = $(SRCDIR) ;
Depends $(1) : $(2) ;
}

actions PreParse
{
runScript --outputDir=$(PARSEDDIR) $(SRCDIR)
}
...

PreParse $(GENSRC) : $(GENSRC) ;



but then I get a warning that the files listed in
$(GENSRC) depend on themselves. How can I write the
rule such that it will run the PreParse rule/action
when the source files in the $(SRCDIR) are newer than
in the $(PARSEDDIR)?

Thanks
Chris

--- Craig Allsop <cjamallsopgmail.com> wrote:
[snip]
> You
> can tell jam to
> output them to an intermediate directory if you
> don't like them in the
> source folder ... anyway ...


"Gee, Thanks. You made me appreciate life by showing me
how badly my funeral will suck." - Bender, Futurama


       
____________________________________________________________
________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

_______________________________________________
jamming mailing list  -  jammingperforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

Re: Pre-parsing source files before building
user name
2007-08-24 21:10:17
On 8/25/07, Chris <syndicate_dragonyahoo.com> wrote:
> but then I get a warning that the files listed in
> $(GENSRC) depend on themselves. How can I write the
> rule such that it will run the PreParse rule/action
> when the source files in the $(SRCDIR) are newer than
> in the $(PARSEDDIR)?

PreParse $(GENSRC) : $(GENSRC) ;

You've called this rule with two lists, then inside you
depend one
list on the other. For each element of the first list, it
depends on
both elements of the second list. This is the reason I use a
loop to
call GenFile on one file at a time. Also, see the
<parsed> prefix I
use in my previous message to tell jam about the *different*
targets
but with the same name.

Craig.
_______________________________________________
jamming mailing list  -  jammingperforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )