On 3/29/2010 8:20 PM, Philip Guenther wrote:
Hmm. SysV make has offered the desired feature with the syntax
b1 + b2 + b3: d1
touch -r $^ $@
Ah, thank you! I wasn't aware of a precedent syntax for this feature.
I definitely agree with
using this syntax over what I proposed for compatibility with sysV and
(potentially) future
POSIX standardization if the sysV semantics are adequate. I'll run some
tests with the
Solaris 10 version and follow up with comparisons with the semantics I
had proposed.
It appears the sysV implementation doesn't let you declare multiple
groups with a single rule, but that's not a restriction of the syntax
itself. Yes, that syntax has a meaning in GNU make (treating '+' as a
target), but it's clearly not a portable name for a target. (Indeed,
plus-sign is not part of the POSIX "Portable Filename Character Set".)
I'm not sure if multiple groups has good use cases or not. I proposed
supporting it mainly
because I felt there was a clear, reasonable, and consistent behavior
and specifying the behavior
felt important since the syntax didn't preclude it. (similar to nested
groups except that nested
groups don't seem to have a clear and reasonable behavior)
I suspect very few people would be upset by the inability to specify a
target named '+'. Those
that are impacted would likely be able to change the file/target name to
something else. However,
if there is substantial concern, than a backward compatibility option
could be added to disable
the new semantics.
The proposed syntax already has a conflicting special meaning in GNU
make (multiple archive-member target) for what would be the common
case of a single group. That is, this:
(b1 b2 b3): d1
whatever
currently means "the b1, b2, or b3 members of any archive library
depend on d1 and are updated by running 'whatever'". The fact that
it's a special syntax means that it's more likely to actually be in
use out there. How will the proposed change affect Makefiles using
that syntax?
Are you sure about this syntax? I can't find any descriptions of it in
the GNU make manual.
I do see archive pattern rules with a syntax such as '(%.o): %.c', but
no static rules like this.
I tried this syntax and gmake treated it as three separate targets:
'(b1', 'b2', 'b3)'. This suggests
we could use parenthesis for the syntax, but I have no objections to the
sysV syntax. As Eddy
pointed out, the sysV syntax avoids the issue of nested groups.
(While I don't think the sysV syntax is *great*, I personally think
it's a better choice than overloading the meaning of parentheses.)
Yup, I agree. If only for compatibility.
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make