cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic target


From: Gary Oberbrunner
Subject: Re: Dynamic target
Date: Wed, 15 Nov 2000 16:29:09 -0500 (EST)

>>>>> "ZD" == Zachary Deretsky <address@hidden> writes:

  ZD> I need to implement the following 2 steps:

  ZD> 1. The first step takes 2 input text files and generates a set
  ZD> of .c files.  These files will all get the same prefix, but
  ZD> other than that I do not know the names of these files or the
  ZD> size of the set in advance.

  ZD> 2. The second step compiles and links these files into an
  ZD> executable.

  ZD> Basically, the first step generates a list of files which should
  ZD> be used as inputs for the second step.


Hi, Zach.  This is exactly what we do here.  My solution is as
follows:

1. You need my AfterBuild patch, which allows you to execute code
   after a specified target is built.

2. In your first step, also generate a list of the .c files into a
   text file.  Mention that file as one of the targets of your step 1
   command.

3. Write an AfterBuild action (in my AfterBuild patch) for the above
   text file, which should just add each filename seen into the link.
   (You may need to futz with this; I build a DLL, and cons knows how
   to do that in sections; Command and Program don't.)

4. Use your regular Command/Program target to define the main
   executable.

Sorry I can't provide more detail now; I have to run.  Email me
privately and I'll give you the AfterBuild patch and more details.

-- 
. . . . . . . . . . . . . . . . . . . . . . . . .
Gary Oberbrunner                address@hidden
GenArts, Inc.                   Tel: 617-492-2888
8 Clinton Street                Fax: 617-492-2852
Cambridge, MA 02139 USA         http://web.genarts.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]