[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/10] depend: reduce code duplication
From: |
Stefano Lattarini |
Subject: |
[PATCH 08/10] depend: reduce code duplication |
Date: |
Tue, 14 May 2013 10:04:31 +0200 |
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.3.rc0.19.g7e6a0cc
- [PATCH 00/10] {master} Enable subdir-objects option unconditionally, Stefano Lattarini, 2013/05/14
- [PATCH 01/10] subdir-objects: enable unconditionally, Stefano Lattarini, 2013/05/14
- [PATCH 10/10] depend: reduce code duplication, de-uglify make verbose output, Stefano Lattarini, 2013/05/14
- [PATCH 08/10] depend: reduce code duplication,
Stefano Lattarini <=
- [PATCH 03/10] depend: assume we can always pass '-o' to the C compiler, Stefano Lattarini, 2013/05/14
- [PATCH 06/10] depend: refactor and remove code duplication, Stefano Lattarini, 2013/05/14
- [PATCH 09/10] depend: prefer $(...) over `...` in Cygwin-specific recipes, Stefano Lattarini, 2013/05/14
- [PATCH 02/10] cleanup: having subdir-objects mandatory allow us some simplifications, Stefano Lattarini, 2013/05/14
- [PATCH 05/10] Automake::Language: drop unused fields 'compile_flag' and 'output_flag', Stefano Lattarini, 2013/05/14
- [PATCH 04/10] depend: assume '-c' compiler flag always means to produce object files, Stefano Lattarini, 2013/05/14
- [PATCH 07/10] depend: a preparatory refactoring, Stefano Lattarini, 2013/05/14
- Re: [PATCH 00/10] {master} Enable subdir-objects option unconditionally, Stefano Lattarini, 2013/05/18