VPATH build from a tarball fails with some gmake versions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: VPATH build from a tarball fails with some gmake versions
Date: 2018-02-28 22:54:43
Message-ID: 32497.1519858483@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I tried doing a VPATH build referencing a source directory that I'd distclean'd
but not maintainer-clean'd, which should simulate the case of a VPATH
build from a tarball. I was quite surprised that it fell over:

...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -I. -I/home/postgres/pgsql/src/bin/psql -I/home/postgres/pgsql/src/interfaces/libpq -I../../../src/include -I/home/postgres/pgsql/src/include -D_GNU_SOURCE -c -o sql_help.o sql_help.c
gcc: sql_help.c: No such file or directory
gcc: no input files
make[3]: *** [sql_help.o] Error 1
make[3]: Leaving directory `/home/postgres/buildroot/src/bin/psql'

gmake should be generating a path to sql_help.c, since that exists
in the corresponding source directory, but it does not. I can reproduce
this on RHEL6 with make-3.81-23, but not on Fedora 26 with make-4.2.1-2,
and (curiously) also not on High Sierra with Apple's copy of make 3.81.
I wonder how many other people see it.

The attached patch seems to fix it, indicating that there's something
about the rules relating sql_help.c and sql_help.h that is confusing
make, such that turning sql_help.c into the primary target for the
create_help rule removes the confusion.

Comments?

regards, tom lane

Attachment Content-Type Size
switch-sql-help-h-and-c.patch text/x-diff 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-02-28 23:01:55 Re: [HACKERS] pgbench randomness initialization
Previous Message Andrew Dunstan 2018-02-28 22:49:43 Re: ALTER TABLE ADD COLUMN fast default