From d7b2cd9d40e858778ca93b59383d280e510a01e7 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Mon, 7 May 2012 21:28:38 +0300
Subject: [PATCH] Fix pg_config.h make rule

According to the Autoconf documentation, there should be a make rule

pg_config.h: stamp-h

so that with the right setup around this, a change in pg_config.h.in
will trigger a rebuild of everything that depends on pg_config.h.  But
this doesn't always work, sometimes you need to run make twice to get
everything up to date after a change of pg_config.h.in.

The fix is to write the rule as

pg_config.h: stamp-h ;

instead (with an empty command instead of no command).  This is what
Automake-generated makefiles effectively do, so it seems safe to be on
this side.

It's not actually clear why this is (apparently) more correct.  It's
been posted to
<http://lists.gnu.org/archive/html/help-make/2012-04/msg00058.html>
without response so far.
---
 src/Makefile.global.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 51c2102b742..e10c86cd311 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -536,18 +536,18 @@ $(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_
 # unnecessarily. Therefore we make config.status update a timestamp file
 # stamp-h every time it runs, so that we don't trigger this rule every time.
 # (We do trigger the null rule for stamp-h to pg_config.h every time; so it's
-# important for that rule to be null!)
+# important for that rule to be empty!)
 #
 # Of course you need to turn on dependency tracking to get any
 # dependencies on pg_config.h.
-$(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h
+$(top_builddir)/src/include/pg_config.h: $(top_builddir)/src/include/stamp-h ;
 
 $(top_builddir)/src/include/stamp-h: $(top_srcdir)/src/include/pg_config.h.in $(top_builddir)/config.status
 	cd $(top_builddir) && ./config.status src/include/pg_config.h
 
 # Also remake ecpg_config.h from ecpg_config.h.in if the latter changed, same
 # logic as above.
-$(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h: $(top_builddir)/src/interfaces/ecpg/include/stamp-h
+$(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h: $(top_builddir)/src/interfaces/ecpg/include/stamp-h ;
 
  $(top_builddir)/src/interfaces/ecpg/include/stamp-h: $(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h.in $(top_builddir)/config.status
 	cd $(top_builddir) && ./config.status src/interfaces/ecpg/include/ecpg_config.h
-- 
GitLab