On Fri, Sep 04, 2020 at 09:49:16PM -0400, Tom Lane wrote:
> There are a couple different ways we might think about fixing
> this. Maybe this specific rule is broken and needs to be fixed to
> not assume that '$(dir $<)' is the same for all its dependencies.
> Alternatively, maybe the problem is that the derived files
> fmgr-stamp et al. should have been created in the source tree, even
> during a VPATH build. (I have a vague recollection that we do it
> that way for some derived files, but maybe that's out of date.)
The GNU make manual does recommend:
GNU distributions usually contain some files which are not source files—for
example, Info files, and the output from Autoconf, Automake, Bison or
Flex. Since these files normally appear in the source directory, they should
always appear in the source directory, not in the build directory. So
Makefile rules to update them should put the updated files in the source
directory.
-- https://www.gnu.org/software/make/manual/html_node/Makefile-Basics.html
> Of course, it might also be fair to argue that this scenario of
> a source tree that has only some up-to-date derived files is
> not supported/supportable. It definitely doesn't seem worth
> a huge amount of effort to fix; but on the other hand the rule
> I cite above does seem to be assuming something it shouldn't.
I agree fixing this is low-priority.