Re: shortest stem
Paul Smith <[email protected]>
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Organization | GNU's Not Unix! |
| Message-ID | <[email protected]> |
On Wed, 2009-09-23 at 18:50 +0200, Boris Kolpackov wrote: > > I'd really appreciate it if folks with larger, more complex secondary > > expansion environments would give it a whirl. > > Sure, I have one of those. Cool; I got the code working and passing the regression tests on Sunday and I've been trying to find the time ever since to get the docs etc. done. Sigh. Tonight, I think. > > For example, what about: > > > > %.o : %.c > > %-d.o : %.y > > > > ? Today this ordering will always choose to build the .o from the .c > > file because it appears first. After the change, how will this work? > > For names which end on '-d.o' the second rule will be tried first. After > that, the usual logic applies. > > In general, I think the difference in behavior will be limited to > very small number of cases, namely, where there is more than one > pattern rule to build the same thing, and the rules differ in the > 'specificity' of the target, e.g, '%.o' & '%-pic.o'. I don't think > such situations are very common. Here's a thought. What if we were even more picky, and ONLY re-ordered rules where the prerequisites were also identical? So, in my example above, it would work the same way as it does now because the prerequisites were different. I think that if we made this change, then your new modification would be able to be turned on all the time and no switch would be required. I don't see ANY use in rules like this: %.o: %.c %-d.o: %.c today, as the second one is by definition never used. I'm OK with that being enabled permanently, and telling people that if they have these kinds of unused rules around causing problems, they should remove them.