5 messages in com.perforce.jammingActions that build multiple targets
FromSent OnAttachments
chri...@natinst.com chris.bartz@natinst.com22 Jan 1998 08:35 
M. S...@research.bell-labs.com22 Jan 1998 08:52 
Laur...@perforce.com22 Jan 1998 10:46 
chri...@natinst.com chris.bartz@natinst.com22 Jan 1998 12:08 
Laur...@perforce.com22 Jan 1998 13:44 
Subject:Actions that build multiple targets
From:Laur...@perforce.com (Laur@perforce.com)
Date:01/22/1998 01:44:53 PM
List:com.perforce.jamming

chri@natinst.com writes:

1) If I am doing a multi-process build, could the FindSBR rule get run before the Cc rule? I think making the .sbr depend on .obj will prevent this so it might not be a problem.

No, the dependencies will keep them in order. In fact, my caveat about having to invoke BrowserDB after the other rules is probably not even necessary.

I'm not sure I like saying that the .sbr depends on the .obj though, but I can't think of any practicle reason not to.

The alternative is to set up your compile rule to work with a variable number of targets. That would be even more fussy, I think.

2) Will the "CCFLAGS += /Fr$(s)" really work? If I am using LOCATE_TARGET to send my targets to a different directory, this will not use the bound file name, but the "target" name as it was when the rule was run. If $(s) includes grist, won't this statement evaluate to "CCFLAGS += /Fr<grist>file.sbr".

As I said, the example needs to be fleshed out for your implementation. If your targets are gristed, use "CCFLAGS += /Fr$(s:G=)".

And if the /Fr switch needs the rooted pathname, you can probably use "CCFLAGS += /Fr$(s:G=:D=$(LOCATE_TARGET))".

If LOCATE_TARGET won't work in your implementation (e.g., if you do some later binding of targets), you could hardcode something like this in your Cc action:

actions Cc { $(CC) /c $(CCFLAGS) $(OPTIM) $(SBR_FLAG)$(<:S=.sbr) /Fo$(<) /I$(HDRS) $(>) }

and just set SBR_FLAG for any target that needs it (in the CompileWithSBR rule or equivalent):

SBR_FLAG on $(s:S=.obj) = /Fr ;

For .obj files that do not have SBR_FLAG set on them, the /Fr switch won't appear at all in the compile command because the token comes out null.

Unfortunately, I want everything. I use grist so I can make release, debug and other versions, I use LOCATE_TARGET so the debug and release versions end up in different directories, and I want to use a multiple processes.

I think you can have everything, but some things are a bit tricky...

---Laura

------------------------------------------------------------------------- Laura Wingerd Perforce Software, Inc. lau@perforce.com 510-864-7400

-------------------------------------------------------------------------