automake-patches
[Top][All Lists]
Advanced

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

facilitate 'libtool --dry-run': new macro $(am__mv)


From: Ralf Wildenhues
Subject: facilitate 'libtool --dry-run': new macro $(am__mv)
Date: Wed, 18 Jun 2008 00:41:26 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Before depend2.am was optimized to use several command lines (in some
cases) for compilation (d505ab9091905a56e01c5e13d9e2d55b50420691),
  make LIBTOOLFLAGS=--dry-run

used to work reasonably well, actually because the exit status of the mv
command was ignored with most make implementations.  Now that it rightly
isn't ignored any more, the above fails after the first command.

The patch below comes to help in that it allows me to use
  make LIBTOOLFLAGS=--dry-run am__mv=:

in order to proceed.  I have deliberately not used am__mv in other
places in Automake, as it's not intended to be a portable mv command
(and its purpose here may break other uses elsewhere), neither to
document it prominently, for now.

The dry run command provides an easy way to estimate libtool build
overhead, for example.  Pushed to master.

Cheers,
Ralf

    Introduce macro $(am__mv) to facilitate 'libtool --dry-run'.
    * lib/am/depend.am (am__mv): New macro, set to 'mv -f'.
    * lib/am/depend2.am: Use throughout to move the temporary
    depfile *.Tpo to its final destination *.Po.

diff --git a/lib/am/depend.am b/lib/am/depend.am
index c2bec7d..62d72f9 100644
--- a/lib/am/depend.am
+++ b/lib/am/depend.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003
+## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2008
 ## Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -15,6 +15,8 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+am__mv = mv -f
+
 ## This Makefile depends on Depdirs' files, so we should never
 ## erase them in -am or -recursive rules; that would prevent any other
 ## rules from being recursive (for instance multilib clean rules are
diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index 7bbe188..1a13bd2 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -1,6 +1,6 @@
 ## automake - create Makefile.in from Makefile.am
 ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-## 2003, 2004, 2006  Free Software Foundation, Inc.
+## 2003, 2004, 2006, 2008  Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@ if %FASTDEP%
 ?GENERIC??!SUBDIROBJ?  %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o 
%OBJ% %SOURCEFLAG%%SOURCE%
 ?GENERIC??SUBDIROBJ?   depbase=`echo %OBJ% | sed 
's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 ?GENERIC??SUBDIROBJ?   %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o 
%OBJ% %SOURCEFLAG%%SOURCE% &&\
-       mv -f %DEPBASE%.Tpo %DEPBASE%.Po
+       $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
 else !%FASTDEP%
 if %AMDEP%
        source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
@@ -92,7 +92,7 @@ if %FASTDEP%
 ?GENERIC??!SUBDIROBJ?  %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% 
-o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'`
 ?GENERIC??SUBDIROBJ?   depbase=`echo %OBJ% | sed 
's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
 ?GENERIC??SUBDIROBJ?   %COMPILE% -MT %OBJOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% 
-o %OBJOBJ% %SOURCEFLAG%`$(CYGPATH_W) '%SOURCE%'` &&\
-       mv -f %DEPBASE%.Tpo %DEPBASE%.Po
+       $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
 else !%FASTDEP%
 if %AMDEP%
        source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
@@ -119,7 +119,7 @@ if %FASTDEP%
 ?GENERIC??!SUBDIROBJ?  %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% 
-o %LTOBJ% %SOURCEFLAG%%SOURCE%
 ?GENERIC??SUBDIROBJ?   depbase=`echo %OBJ% | sed 
's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
 ?GENERIC??SUBDIROBJ?   %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% 
-o %LTOBJ% %SOURCEFLAG%%SOURCE% &&\
-       mv -f %DEPBASE%.Tpo %DEPBASE%.Plo
+       $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Plo
 else !%FASTDEP%
 if %AMDEP%
        source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@




reply via email to

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