diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-03-24 07:48:28 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-03-24 07:48:28 -0700 |
commit | e72e4c2b4f227e92bcc11a32053c82525bee2c0e (patch) | |
tree | 038238de96c25f99026c49fdf34e5678a9708f59 | |
parent | 61aa1bb5e41d26b4aece36aa7059d09f314e5b3e (diff) | |
download | txr-e72e4c2b4f227e92bcc11a32053c82525bee2c0e.tar.gz txr-e72e4c2b4f227e92bcc11a32053c82525bee2c0e.tar.bz2 txr-e72e4c2b4f227e92bcc11a32053c82525bee2c0e.zip |
M1: Fix sed issue.
The MacOS sed doesn't accept semicolon termination for
commands involving defining labels or branching to labels.
This is not a new issue, but it is revealed on newer MacOS
because the sed now complains about unused labels.
In the sed command ':x; /whatever/ { ...; tx }', everything
after the initial : is interpreted as a label.
* Makefile (DEPGEN): Split the sed command's syntax up into
logical lines using multiple -e commands, applying some
formatting with indentation to try to keep it readable.
It looks like multiple -e options just glue together to
make a program, as if they were lines of code; one -e
can define a label referenced by another, and even the
closing brace can be treated as a separate command.
-rw-r--r-- | Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -112,7 +112,11 @@ ABBREVN = $(if $(VERBOSE),\ ABBREV3 = $(if $(VERBOSE),@:,@printf "%s %s -> %s\n" $(1) "$(3)" $(2)) define DEPGEN -$(V)sed ':x; /\\$$/ { N; s/\\\n//; tx }' < $(1) | \ +$(V)sed -e ':x' \ + -e '/\\$$/ {' \ + -e 'N; s/\\\n//' \ + -e 'tx' \ + -e '}' < $(1) | \ sed -e '1s/^/DEP_/' -e '1s/: [^ ]\+/ :=/' > $(1:.d=.v) endef |