On Sat, Aug 10, 2024 at 12:40:26AM +0200, Patrice Dumas wrote: > On Fri, Aug 09, 2024 at 11:08:02PM +0100, Gavin Smith wrote: > > With the attached patch, it cd's to srcdir before running pod2texi. > > This way pod2texi with --subdir works correctly. > > Looks like it should work as intended, indeed. > > > In order for the change of working directory to work correctly, I had > > to make a few changes. texi2any_internals.texi is listed as a Makefile > > target without the "$(srcdir)/" prefix. This still works correctly > > due to the VPATH mechanism. This allows correct use of $@ in the Makefile > > rule in the new working directory. > > > > The files in $(texi2any_internals_dependencies) are now listed without the > > "$(top_srcdir)/" prefix; rather, they are given a "../../" prefix. Again, > > the VPATH mechanism should allow these files to be found in the srcdir. > > The "../../" prefix is still correct for these files after "cd $(srcdir)", > > allowing the list of files to be passed to pod2texi correctly. > > I recall that on some platform, a BSD I think, Make only used the VPATH > for the prerequiste (if I recall well), and that's why we systematically > added $srcdir for targets even though it would not have been needed > with VPATH. But I think that your approach can still work, by not using $@ > and having a different path in the target and rule: > $(srcdir)/texi2any_internals.texi: .... > ......... > texi2any_internals.texi .... >
I've commited the patch I posted with minor modifications.