[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/10] depend: a preparatory refactoring
From: |
Stefano Lattarini |
Subject: |
[PATCH 07/10] depend: a preparatory refactoring |
Date: |
Tue, 14 May 2013 10:04:30 +0200 |
This is just a preparatory change in view of a future refactoring.
No semantic change is intended.
* lib/am/depend2.am: Adjust; for example, using '$@' in all recipes
to indicate the output file (rather than recipe-specific transforms
like '%OBJ%' and '%LTOBJ%'), and not assuming to know the exact
file extension of the output file (e.g., whether it's '.o' or '.lo').
Signed-off-by: Stefano Lattarini <address@hidden>
---
lib/am/depend2.am | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index 6c6c684..a54fcd3 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -38,18 +38,18 @@ if %?NONLIBTOOL%
if %FASTDEP%
## TODO: rewrite this to avoid extra forks once we can assume a POSIX
## TODO: shell.
- %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'` \
- && %COMPILE% -MT %OBJ% -MD -MP -MF $$depbase.Tpo -c -o %OBJ%
%SOURCEFLAG% \
+ %VERBOSE%depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
\
+ && %COMPILE% -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ %SOURCEFLAG% \
?GENERIC? %SOURCE% \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% \
&& $(am__mv) $$depbase.Tpo $$depbase.Po
else !%FASTDEP%
if %AMDEP%
- %VERBOSE%source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
+ %VERBOSE%source='%SOURCE%' object='$@' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
- %VERBOSE-NODEP%%COMPILE% -c -o %OBJ% %SOURCEFLAG% \
+ %VERBOSE-NODEP%%COMPILE% -c -o $@ %SOURCEFLAG% \
?GENERIC? %SOURCE%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
@@ -60,8 +60,8 @@ endif !%FASTDEP%
if %FASTDEP%
## TODO: rewrite this to avoid extra forks once we can assume a POSIX
## TODO: shell.
- %VERBOSE%depbase=`echo %OBJ% | sed
's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'` \
- && %COMPILE% -MT %OBJOBJ% -MD -MP -MF $$depbase.Tpo -c -o %OBJOBJ%
%SOURCEFLAG% \
+ %VERBOSE%depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
\
+ && %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%.
?!GENERIC? `if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; \
@@ -69,10 +69,10 @@ if %FASTDEP%
&& $(am__mv) $$depbase.Tpo $$depbase.Po
else !%FASTDEP%
if %AMDEP%
- %VERBOSE%source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
+ %VERBOSE%source='%SOURCE%' object='$@' libtool=no @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
- %VERBOSE-NODEP%%COMPILE% -c -o %OBJOBJ% %SOURCEFLAG% \
+ %VERBOSE-NODEP%%COMPILE% -c -o $@ %SOURCEFLAG% \
?GENERIC? `$(CYGPATH_W) '%SOURCE%'`
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? `if test -f '%SOURCE%'; then $(CYGPATH_W) '%SOURCE%'; \
@@ -86,18 +86,18 @@ if %?LIBTOOL%
if %FASTDEP%
## TODO: rewrite this to avoid extra forks once we can assume a POSIX
## TODO: shell.
- %VERBOSE%depbase=`echo %OBJ% | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`
\
- && %LTCOMPILE% -MT %LTOBJ% -MD -MP -MF $$depbase.Tpo -c -o %LTOBJ%
%SOURCEFLAG% \
+ %VERBOSE%depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.[^.]*$$||'`
\
+ && %LTCOMPILE% -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ %SOURCEFLAG%
\
?GENERIC? %SOURCE% \
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% \
&& $(am__mv) $$depbase.Tpo $$depbase.Plo
else !%FASTDEP%
if %AMDEP%
- %VERBOSE%source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
+ %VERBOSE%source='%SOURCE%' object='$@' libtool=yes @AMDEPBACKSLASH@
DEPDIR=$(DEPDIR) $(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
- %VERBOSE-NODEP%%LTCOMPILE% -c -o %LTOBJ% %SOURCEFLAG% \
+ %VERBOSE-NODEP%%LTCOMPILE% -c -o $@ %SOURCEFLAG% \
?GENERIC? %SOURCE%
## For non-suffix rules, we must emulate a VPATH search on %SOURCE%.
?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
--
1.8.3.rc0.19.g7e6a0cc
- [PATCH 10/10] depend: reduce code duplication, de-uglify make verbose output, (continued)
- [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, 2013/05/14
- [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 <=
- Re: [PATCH 00/10] {master} Enable subdir-objects option unconditionally, Stefano Lattarini, 2013/05/18