4 messages in com.perforce.jamming[jamming] LibraryFromObjects using ob...
FromSent OnAttachments
Wallace, Richard29 Sep 2003 11:54 
Ingo Weinhold29 Sep 2003 12:39 
Arnt Gulbrandsen30 Sep 2003 01:13 
Steve Goodson30 Sep 2003 11:39 
Subject:[jamming] LibraryFromObjects using objects in a different dir
From:Arnt Gulbrandsen (ar@gulbrandsen.priv.no)
Date:09/30/2003 01:13:33 AM
List:com.perforce.jamming

Wallace, Richard writes:

I'm trying to get a small library to build using Jam. The problem I'm running into is the library is spread across a couple of different directories. ... I'm stumped as to what to try next. Suggestions?

As it happens, I almost solved the same problem last week. Not really fond of my solution, but anyway. I made two rules, one analogous to Objects and one to Program (Library in your case).

rule Build { Objects $(>) ; set-$(<) += [ FGristFiles $(>:S=$(SUFOBJ)) ] ; }

rule Program { local target ; Depends exe : $(<) ; Depends $(<) : $(set-$(>)) ; MakeLocate $(<) : $(LOCATE_TARGET) ;

Clean clean : $(<) ; Link $(<) : $(set-$(>)) ; }

The first rule adds a number of .o files to a named set, the second builds a program from all the .o files in a list of named sets. The trick is: Build can be in src/a/Jamfile and Program in src/b/Jamfile and it still works, provided you SubInclude them in that order.

But I'm not entirely happy. Maybe Diane or someone can improve on that.

--Arnt