On Sat, Oct 12, 2019 at 3:08 PM Jouke Witteveen <j.wittev...@gmail.com> wrote:
>
> On Sat, Oct 12, 2019 at 2:50 PM Paul Smith <psm...@gnu.org> wrote:
> >
> > On Sat, 2019-10-12 at 13:11 +0200, Jouke Witteveen wrote:
> > > Before, this was only expanded to $(*F) in prerequisites.
> >
> > Sorry but I need more information than this; I can't understand this
> > change.
> >
> > The bug in Savannah, as I understand it, is that directory prefixes
> > which should be present are missing during prerequisite expansion.
> >
> > How does switching from $* to $(*F) (which is explicitly a file only)
> > help solve this problem?
> >
> > Cheers!
> >
>
> Haha, yeah, this seems counterintuitive, doesn't it!
> The true cause of the issue is not immediately visible in the patch:
> stem_str is used as a temporary value of file->stem and this value
> gets assigned to $* in the second expansion. To be consistent with the
> value of $* in the recipe, we should thus prepend the path to stem_str
> in some cases. This is what my patch does.
>
> However, as a sort of 'hack', the current code replaces % by $* on the
> first expansion, relying on the second expansion to do the right
> thing. This does not work after fixing $*, as directories have a
> special treatment in implicit rules (they are prepended to
> prerequisites separately). The reason this currently works, is because
> $* is set incorrectly. By changing it to $(*F), everything is fine
> again also with the fixed $* :-).

I realized this morning that my testing was too focused on one
particular scenario and that whether % is replaced by $* or by $(*F)
should depend on whether check_lastslash is set or not (i.e. whether
add_dir is 1 or 0). I'll send a revised patch soon.

- Jouke

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to