Fix pg_config.h make rule
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 7 May 2012 18:28:38 +0000 (21:28 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 7 May 2012 18:28:38 +0000 (21:28 +0300)
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

index 51c2102b7426aa1abca60c90d837dc2089d707af..e10c86cd311a3fb08da1e9675cf65873658d34b1 100644 (file)
@@ -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