From f880b206a479bf4cd8ccac26f33a9cc3d490d6b7 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 24 Mar 2021 07:48:28 -0700 Subject: 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. --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3