summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-24 07:48:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-03-24 07:48:28 -0700
commitf880b206a479bf4cd8ccac26f33a9cc3d490d6b7 (patch)
tree038238de96c25f99026c49fdf34e5678a9708f59 /Makefile
parenta95c0b7b451895022796d9adc3e18781a632697e (diff)
downloadtxr-f880b206a479bf4cd8ccac26f33a9cc3d490d6b7.tar.gz
txr-f880b206a479bf4cd8ccac26f33a9cc3d490d6b7.tar.bz2
txr-f880b206a479bf4cd8ccac26f33a9cc3d490d6b7.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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 37eb677d..521b894f 100644
--- a/Makefile
+++ b/Makefile
@@ -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