
Dear Jeroen Hofstee,
In message 4E0B8F82.4000600@myspectrum.nl you wrote:
rules.mk uses the GNU specific sed \w leading to not directly obvious Make / _depend errors in the build process, like circular dependencies
You should probably mention when such errors result - I have never seen any of these.
Current command (gsed = GNU sed, sed = FreeBSD takes \w as w). The first command is not the intention. [jeroen@blue ~]$ echo some/example/test.c | sed -e 's/(.*).\w/\1.o/'; some/example/test.c [jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/(.*).\w/\1.o/'; some/example/test.o [jeroen@blue ~]$ echo some/example/test.w | sed -e 's/(.*).\w/\1.o/'; some/example/test.o [jeroen@blue ~]$ echo some/example/test.w | gsed -e 's/(.*).\w/\1.o/'; some/example/test.o
None GNU specific as per GNU docs (fine): [jeroen@blue ~]$ echo some/example/test.c | sed -e 's/(.*).[[:alnum:]_]/\1.o/'; some/example/test.o [jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/(.*).[[:alnum:]_]/\1.o/'; some/example/test.o
or shorter (regex are greedy): [jeroen@blue ~]$ echo some/example/test.c | sed -e 's/(.*)..*/\1.o/'; some/example/test.o [jeroen@blue ~]$ echo some/example/test.c | gsed -e 's/(.*)..*/\1.o/'; some/example/test.o
I don't think this last version is equivalent to the original code. With GNU sed:
-> echo foo/bar-baz.frob-nitz | sed -e 's/(.*).\w/\1.o/' foo/bar-baz.orob-nitz -> echo foo/bar-baz.frob-nitz | sed -e 's/(.*)..*/\1.o/' foo/bar-baz.o
Would you accept a patch for this?
Yes, of course - if the resultinmg code works, and if you follow patch submission rules (like SoB: line etc.).
Best regards,
Wolfgang Denk