chiark / gitweb /
syntax: Support &: literal (for make `grouped' multiple targets)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jan 2020 12:37:14 +0000 (12:37 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jan 2020 12:37:14 +0000 (12:37 +0000)
Very recent versions of GNU make support this syntax:

  foo bar biz &: baz boz
        echo $^ > foo
        echo $^ > bar
        echo $^ > biz

(See (make)Multiple Targets, subheading `Rules with Grouped Targets')

This use of & is nonoverlapping with everything we care about, so we
can just pass it straight through.  Passing through &: means we pass
through &:: too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
generate

diff --git a/README b/README
index 70708cd18803076c94ef41e82906c331009f661a..bea3c1b5ed053caaeb8078f821361add0778a0da 100644 (file)
--- a/README
+++ b/README
@@ -130,6 +130,10 @@ So pathname syntax is a subset of:
 &:<directive> <args>....
        recognised at start of line only (possibly after lwsp)
 
+&:             =>      &:
+       for make multiple targets syntax
+       recognised anywhere *except* start of line
+
 &:include filename             filename should usually be [&]foo.sd.mk
 &:-include filename            tolerate nonexistent file
        RHS is &-expanded but filenames are relative to the top
index b682299d870a8ca0ade4a14321f0a1f3845dcc5e..b65ba1de66ce0883a63f33dffe6548b88d37921e 100755 (executable)
--- a/generate
+++ b/generate
@@ -350,6 +350,7 @@ sub process_input_mk ($$$$) {
                next;
            }
            if (s{^\\$esc}{}) { od "$$esclitr" }
+           elsif (s{^:}{}) { od "$$esclitr:" }
            elsif (s{^\\\$}{}) { oud '$' }
            elsif (s{^\\\s+$}{}) { }
            elsif (s{^$esc}{}) { od "$$esclitr$$esclitr" }