]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
config headers: avoid extra make recursion
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 11 Sep 2012 08:29:35 +0000 (10:29 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 11 Sep 2012 08:31:17 +0000 (10:31 +0200)
* lib/am/remake-hdr.am (%CONFIG_H%). By rewriting its recipe to
duplicate the '%STAMP%' recipe a little.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/remake-hdr.am

index 665b3435a5407d808b97153f44c37d30688333f2..cf4f013f86454083675b7c99e7423768df3315b2 100644 (file)
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 %CONFIG_H%: %STAMP%
-## Recover from removal of config headers.  Break up in two invocations
-## so that "make -n" is properly honored.
-       @test -f $@ || rm -f %STAMP%
-       @test -f $@ || $(MAKE) %STAMP%
+## Recover from removal of config headers.  This is duplicated with the
+## '%STAMP%' rule below, but allow us to avoid a (potentially costly)
+## make recursion.
+       $(if $(wildcard $@),,@rm -f %STAMP%)
+       $(if $(wildcard $@),,cd $(top_builddir) && $(SHELL) ./config.status %CONFIG_H_PATH%)
 
 %STAMP%: %CONFIG_H_DEPS% $(top_builddir)/config.status
        @rm -f %STAMP%