Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-01-04 11:52:11

On 2002-01-04 at 07:37 PM, ghost_at_[hidden] (Vladimir Prus) wrote:

>Rene Rivera wrote:
>> >> > project my-project : <source-location>src ;
>> >> > exe foobar : *.c ;
>> >>
>> >> correct. I would like to see this a lot !
>> >
>> >The simplest question here is how the new builtin rules should be called.
>> >I think that "GLOB". It it reasonable to make it take a wildcard,
>> > interpret it relatively to the current directory, and return all the
>> > matches? The other option is to take a target name, and then match
>> > filenames in the directory given via "LOCATE". I don't think this latter
>> > option gives us anything, and that the former should be taken. Other
>> > comments?
>> Yes, a "GLOB" rule seems like the way to do it. But now another question is
>> what should happen when there are no matches? Return null/empty? Or return
>> the pattern itself, as SEARCH would do?
>Good question. Shell can behave both ways, but that's not relevant. I would
>prefer if nothing is returned, simply because it's more logical. But a lot of
>other question appear:
>Should all source name be globbed? If yes, then we'll just override SEARCH
>logic for sources. If not, how will we decide which ones are globbed? Via
>some special grist:
> exe foobar : <wc>*.c ;
>or using a heuristic?

More good questions :-)

I don't think we can glob all the names by overriding the SEARCH. The
problemis that then we have to return the pattern if no match is found to keep
compatability of detecting when a file is missing. For example:

exe foobar : test.c *.c ;

Can't evalaute to nothing if test.c doesn't exist. It has to evaluate to at
least "test.c".

Doing a heuristic seems like a bad choice also, because regular files can look
very much like regex patterns. Just the "." in "test.c" could be considered
part of a pattern, and then we would be back again to the above problem.

So that only leaves marking a glob in a special way. Using grist seems
reasonable then. So then the rules (exe,lib, etc) would notice that it's a
glob and use "GLOB" to expand the names.

-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at