automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH] config headers: avoid extra make recursion


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH] config headers: avoid extra make recursion
Date: Tue, 11 Sep 2012 12:14:52 +0200

* lib/am/remake-hdr.am (%CONFIG_H%). By rewriting its recipe to
duplicate the '%STAMP%' recipe a little.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/am/remake-hdr.am | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/am/remake-hdr.am b/lib/am/remake-hdr.am
index 665b343..cf4f013 100644
--- a/lib/am/remake-hdr.am
+++ b/lib/am/remake-hdr.am
@@ -15,10 +15,11 @@
 ## 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%
-- 
1.7.12




reply via email to

[Prev in Thread] Current Thread [Next in Thread]