cons-discuss
[Top][All Lists]
Advanced

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

Re: Extending cons


From: wouter . batelaan
Subject: Re: Extending cons
Date: Tue, 21 Nov 2000 11:41:03 +0100

On 20/11/2000 15:54:13 holmberg wrote:

>On Wed, 15 Nov 2000 address@hidden wrote:
>>
>> Hi cons'ers,
>>
>> I'd like to use cons as a tool for building software components
>> in Philips. Each software component comes with a standardized makefile.
>> A product could contain many components from different sources.
>>
>[...]
>>
>> So I'd like to extend cons so it can process with these components:
>> - declare components
>> - find where a component is.
>> - determine build order.
>> - build each component (generally by calling make).
>>
>> I thus add a Construct file to each component, containing something like:
>>
>> Component "comp1";
>> UseComponent "comp2";
>> UseComponent "comp3";
>>
>> UseComponent indicates a dependency component, and should cause
>> cons to read "comp2/Construct" etc, and add a build prerequisite to comp1.
>> However, if a dependency component is a legacy component (has no Construct 
>file),
>> I suggest this:
>> UseComponent "legacy1", legacy=>1, command=>"gmake ...";
>>
>> I value your comments on these ideas.
>>
>
>As I understand it, you declare the dependencies between
>"components" and then want to run "make" on each component in the
>"right" order (and to *always* run all the makes, since only they
>know if there is something to do in each component).
>
>Isn't this just a topological sort ?
>You could use the Graph::Directed-module to do it in Perl,
>but do you really need cons ?

No, of course I could write something myself,
but cons has several features which I would like to use:
- It has a framework for reading Perl files.
- It has facilities to declare dependencies, which it
handles effectively in the right order.
- It has the capability to define (configuration) variables and control
inheritance of them.
- It allows building command lines, using variable substitution,
invoking them, and checking return status.
It allows me to gradually change from just controlling and sequencing make
builds to using cons for each component and the whole system.

>As long as you keep the Makefiles to build each component I
>don't really see the benefit of starting to use cons.

It is too much effort to convert all makefiles to cons at this moment.
It also is too much of a culture shock to existing developers.

>>[...]
>I'm afraid you have to read the code ....
>(or ask specific question on this list)

There are various path functions:
file::srcpath
file::rsrcpath
file::path
file::rpath
file::rfile

Are the 'src' versions of these the same as the non-'src' versions if one does 
not 
use the Link command?

Does file::path return src or linked path?

Regards,

-- Wouter Batelaan



reply via email to

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