5 messages in com.perforce.jamming[jamming] Need help with SubDir| From | Sent On | Attachments |
|---|---|---|
| EXT-Goodson, Stephen | 15 Jun 2001 19:40 | |
| Dave Lewis | 15 Jun 2001 22:58 | |
| EXT-Goodson, Stephen | 19 Jun 2001 17:20 | |
| EXT-Goodson, Stephen | 20 Jun 2001 17:08 | |
| Brett Calcott | 20 Jun 2001 18:00 |
| Subject: | [jamming] Need help with SubDir![]() |
|---|---|
| From: | Dave Lewis (dle...@vignette.com) |
| Date: | 06/15/2001 10:58:00 PM |
| List: | com.perforce.jamming |
I'm just starting to use Jam and I've run into a problem using SubDir. I've
constructed
> a simple example that shows my problem. Here's the Jamfile:
>
> # Jamfile in $(TOPDIR)/Sub/
> SubDir TOPDIR Sub ;
>
> rule CatRule
> {
> DEPENDS $(<) : $(>) ;
> Clean clean : $(<) ;
> }
>
> actions CatRule
> {
> cat $(>) > $(<)
> }
>
> CatRule foo.c : somefile ;
>
> Main foo : foo.c ;
>
> #end of Jamfile
>
> There is an empty Jamrules file in $(TOPDIR), and Sub/somefile exists.
Originally
> I had CatRule in the Jamrules file, but moved it while trying to figure this
out.
>
> When I invoke jam, it complains that it doesn't know how to make <Sub>foo.c,
but
> if I type "jam foo.c" it makes it just fine. Also, if I remove the SubDir
rule it works fine.
> What am I doing wrong? Thanks for your help.
The reason would be that the main rule establishes a dependency between <Sub>foo and <Sub>foo.o and <Sub>foo.c, but the CatFile rule just makes a dependency between somefile and foo.c Since <Sub>foo.c is a different target than foo.c, the CatFile action is not invoked.
This is just a guess. If you run jam with debug turned on, say -d5 you will see all the info...
The <Sub>foo.c notation is called grist, and it is used to make targets unique across directories, even if multiple directories have files of the same name in them.
dave




