[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic target
From: |
Steven Knight |
Subject: |
Re: Dynamic target |
Date: |
Wed, 15 Nov 2000 17:13:00 -0600 (CST) |
> 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.
>
> 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.
If the input text files are source files (i.e., aren't generated by
an action), then you could do this more simply by executing step 1 in
straight perl, either coded directly or by calling a utility to do it,
like so:
@c_files = `generate_list input1.txt input2.txt`;
Program $env 'output.exe', @c_files;
If the input text files are generated by other Cons actions, then you
need something like Gary's AfterBuild patch.
--SK
- Dynamic target, Zachary Deretsky, 2000/11/15
- Re: Dynamic target, Gary Oberbrunner, 2000/11/15
- Re: Dynamic target,
Steven Knight <=
- RE: Dynamic target: for the sake of clarity, Zachary Deretsky, 2000/11/15
- RE: Dynamic target: for the sake of clarity, Steven Knight, 2000/11/16
- AfterBuild, Dynamic target/dynamic dependencies: How?, Zachary Deretsky, 2000/11/22
- RE: AfterBuild, ... Correction, Zachary Deretsky, 2000/11/22
- Re: AfterBuild, Dynamic target/dynamic dependencies: How?, Steven Knight, 2000/11/29
- Dynamic target: How to get a file from source irectory to the linked build directory?, Zachary Deretsky, 2000/11/15
- Re: Dynamic target: How to get a file from source irectory to the linked build directory?, Steven Knight, 2000/11/16
- Re: Dynamic target: How to get a file from source irectory to the linked build directory?, Frank Thomas, 2000/11/16
AfterBuild, Giovanni Pietrobon, 2000/11/16
RE: Dynamic target, Alex Jacques, 2000/11/20