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

2023-01-12 Thread Karl Berry
Well, stated more positively, my concern is about not replacing a bunch of (granted) complicated old code with a bunch of complicated new code, i.e., creating new-and-different maintainer and portability hassles, for the sake of (what nowadays feels to me like) a micro-optimization. Let's not

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

2023-01-11 Thread Mike Frysinger
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

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

2023-01-05 Thread Zack Weinberg
On Thu, Jan 5, 2023, at 6:47 PM, 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. It seems to me that this would be worth doing *if* we could

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

2023-01-05 Thread Karl Berry
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

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

2023-01-05 Thread Nick Bowler
On 2023-01-04, Mike Frysinger wrote: [...] > dmake is one implementation that fails, and your suggestion doesn't work > :/. > $ dmake foo/bar.o > dmake: Error: -- Incomplete macro expression [)' b='$(at_f:.o=)'; test > x"$$a.o" = x"$(@F)" || a=$$b;\ > echo $$a] It might also be

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

2023-01-04 Thread Nick Bowler
On 2023-01-04, Mike Frysinger wrote: > On 04 Jan 2023 21:10, Nick Bowler wrote: [...] >> maybe something like: >> >> % cat >Makefile <<'EOF' >> at_f = $(@F) >> foo/bar.o: >> a='$(@F:.o=)' b='$(at_f:.o=)'; test x"$$a.o" = x"$(@F)" || a=$$b;\ >>echo $$a >> EOF > > this is

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

2023-01-04 Thread Mike Frysinger
On 04 Jan 2023 21:10, Nick Bowler wrote: > Except for one minor detail, $(@F) and $(@D) are highly portable. I > expect they were in the very first POSIX.2 specs as they predate the > earliest standards; I believe they first appeared in UNIX System V (ca. > 1983) and were later added to BSD in

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

2023-01-04 Thread Nick Bowler
On 2023-01-03, Mike Frysinger wrote: > The echo|sed is used to split the dirname & filename so it can insert > $(DEPDIR) in the middle, and then chop the trailing object suffix. In > the generic case, %OBJ% is $@, so we can leverage the POSIX vars $(@D) > and $(@F) to do the pathname splitting

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

2023-01-03 Thread Mike Frysinger
The echo|sed is used to split the dirname & filename so it can insert $(DEPDIR) in the middle, and then chop the trailing object suffix. In the generic case, %OBJ% is $@, so we can leverage the POSIX vars $(@D) and $(@F) to do the pathname splitting and insert $(DEPDIR) in between. For chopping