|
From: | Jason Thomas |
Subject: | Re: Usage |
Date: | Tue, 23 Apr 2002 18:35:07 -0700 |
Thanks for the prompt response. This works except the particular tool set I'm using has an archiver that sucks the life out of the system when it's passed a large number of *.o's. I'm open to modifying cons or creating an extension to get the behavior that's more optimal for my tool set. Basically I need a method to invoke the linker after the Build command has completed w/o error. So I guess I'm after an unusual way. Interested if anyone has done anything like this using the existing cons API. Would some combination of Command and Depend get me there? I need my final executable to depend on all of the *.o's but not invoke _Object for each .o in its list (since this was presumably handled by calls to Object as I mention below). Could I fool Cons by altering the compatible build commands so as not to get the duplicate build rule error, not get _Object called and retain that Program then runs after everything else? Thanks, Jason At 04:35 PM 4/23/2002 -0400, Gary Oberbrunner wrote:
The usual way to do this is to use Library in each conscript; Library is special because it allows multiple invocations, each contributes more .o's to the final library.Then you'd just use Program in one of the conscripts to link the library in with your main.c (if any). If you do it like this your dependencies will be correct.Don't use AfterBuild for this. -- Gary Jason Thomas wrote:I have a large hierarchical system with a conscript file in each directory listing the details for the files in that directory. I include in the conscript file a call to Objects. Most of my conscripts look like this: Import qw( CONS ); @SOURCES = qw( foo.c ); Objects $CONS @SOURCES; In my Construct file I use the Build command to refer to all of the conscript files. This of course produces a bunch of .o's. Now I want to link them together. If I use Program I get a message like: <whatever> built (at least) two different ways: If I use Command I don't see a way to assure that Command only executes at the end of all the objects being built. Is AfterBuild supposed to run at the end of all other production rules? I couldn't tell since I couldn't get it to run at all. I've arranged my system this way because I only want the top level Construct to know about conscript files, but not the list of sources contained there. I can abandon this if it's wishful thinking with cons.
[Prev in Thread] | Current Thread | [Next in Thread] |