automake-patches
[Top][All Lists]
Advanced

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

[PATCH 09/11] depend2.am: reduce code duplication


From: Stefano Lattarini
Subject: [PATCH 09/11] depend2.am: reduce code duplication
Date: Sat, 12 Jan 2013 13:52:02 +0100

Just a simplification; no semantic change is intended.

* lib/am/depend2.am (am__set_depbase): New.  Use it in all the three
flavours of recipes (.o, .obj, .lo), instead of duplicating its code.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/am/depend2.am | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index a54fcd3..5522aa3 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -32,13 +32,16 @@
 ## a package with gcc 3.x or later.  In this case we can skip the use of
 ## depcomp and easily inline the dependency tracking.
 
+if %?FIRST%
+## TODO: rewrite this to avoid extra forks once we can assume a POSIX shell.
+am__set_depbase = depbase=`echo $@ | sed 
's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
+endif %?FIRST%
+
 if %?NONLIBTOOL%
 ?GENERIC?%EXT%.o:
 ?!GENERIC?%OBJ%: %SOURCE%
 if %FASTDEP%
-## TODO: rewrite this to avoid extra forks once we can assume a POSIX
-## TODO: shell.
-       %VERBOSE%depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'` 
\
+       %VERBOSE%$(am__set_depbase) \
          && %COMPILE% -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ %SOURCEFLAG% \
 ?GENERIC?      %SOURCE% \
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
@@ -58,9 +61,7 @@ endif !%FASTDEP%
 ?GENERIC?%EXT%.obj:
 ?!GENERIC?%OBJOBJ%: %SOURCE%
 if %FASTDEP%
-## TODO: rewrite this to avoid extra forks once we can assume a POSIX
-## TODO: shell.
-       %VERBOSE%depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'` 
\
+       %VERBOSE%$(am__set_depbase) \
        && %COMPILE% -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ %SOURCEFLAG% \
 ?GENERIC?      `$(CYGPATH_W) '%SOURCE%'` \
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
@@ -84,9 +85,7 @@ if %?LIBTOOL%
 ?GENERIC?%EXT%.lo:
 ?!GENERIC?%LTOBJ%: %SOURCE%
 if %FASTDEP%
-## TODO: rewrite this to avoid extra forks once we can assume a POSIX
-## TODO: shell.
-       %VERBOSE%depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'` 
\
+       %VERBOSE%$(am__set_depbase) \
          && %LTCOMPILE% -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ %SOURCEFLAG% 
\
 ?GENERIC?      %SOURCE% \
 ## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
-- 
1.8.1.rc3.192.g2d0029e




reply via email to

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