automake-patches
[Top][All Lists]
Advanced

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

[bug#60535] [PATCH] depend2: switch echo|sed to automatic vars


From: Mike Frysinger
Subject: [bug#60535] [PATCH] depend2: switch echo|sed to automatic vars
Date: Wed, 11 Jan 2023 22:36:53 -0500

On 05 Jan 2023 16:47, Karl Berry wrote:
> Please excuse my curmudgeonness, but it's not clear to me that avoiding
> sed is worth these hassles in working around the implementation-specific
> bugs in the automatic variables. Especially if we have to invoke a shell
> and various commands anyway, how about keeping things as they are? -k

i don't quite buy the argument of "we've got a lot of per-object overhead,
so what's a little bit more".  we should be trying to minimize overhead of
generated code as much as possible.  forking a subshell to fork sed just to
munge a string that we can have make itself generate is pure overhead.

but you're appealing to avoiding hassle.  to that end, i'll point out the
current depdir logic is already in an unhealthy state: we're generating
similar logic 3 times with automake-processed conditionals depending on 3
runtime settings:
?!GENERIC?              %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo 
%-c% -o %OBJ% %SOURCEFLAG%`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?!GENERIC?              %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??!SUBDIROBJ?   %VERBOSE%%COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo 
%-c% -o %OBJ% %SOURCEFLAG%%SOURCE%
?GENERIC??!SUBDIROBJ?   %SILENT%$(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po
?GENERIC??SUBDIROBJ?    %VERBOSE%depbase=`echo %OBJ% | sed 
's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
?GENERIC??SUBDIROBJ?    %COMPILE% -MT %OBJ% -MD -MP -MF %DEPBASE%.Tpo %-c% -o 
%OBJ% %SOURCEFLAG%%SOURCE% &&\
?GENERIC??SUBDIROBJ?    $(am__mv) %DEPBASE%.Tpo %DEPBASE%.Po

this directly translates to overhead in the generated Makefile.in:
.c.o:
@am__fastdepCC_TRUE@                $(AM_V_CC)depbase=`echo $@ | sed 
's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@                $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo 
-c -o $@ $< &&\
@am__fastdepCC_TRUE@                $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@   $(AM_V_CC)source='$<' object='$@' 
libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@   DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) 
@AMDEPBACKSLASH@
@am__fastdepCC_FALSE@               $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<

switching to make variables will allow us to collapse these.  i'm fairly
confident i can at least collapse the last 5 lines ?GENERIC? into 2 lines.
-mike

Attachment: signature.asc
Description: PGP signature


reply via email to

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