chiark / gitweb /
subdirmk: Go back to ^ and ~
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 14 Nov 2019 19:40:59 +0000 (19:40 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 14 Nov 2019 19:43:46 +0000 (19:43 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
example/Subdir.sd.mk
example/lib/Subdir.sd.mk
generate

index 162d7ce..5c2040a 100644 (file)
@@ -3,7 +3,7 @@
 #  Copyright 2019 Ian Jackson
 # SPDX-License-Identifier: LGPL-2.0-or-later
 
-INCLUDES       += -I&;lib/
+INCLUDES       += -I&^/lib/
 
 include subdirmk/usual.mk
 include subdirmk/regen.mk
index 8ac946d..c2939c5 100644 (file)
@@ -10,4 +10,4 @@
 &libtoy.a:     $(&OBJECTS)
        $(AR) rc $@ $^
 
--include &,for-test.mk
+-include &^/lib/for-test.mk
index b4c52ae..f46747d 100755 (executable)
--- a/generate
+++ b/generate
@@ -133,8 +133,8 @@ sub process_input_mk ($$$$$$$$) {
 
     my %pfxmap = (
                  ''  => $dir_prefix,
-                 ',' => "\$(top_srcdir)${dir_suffix}/",
-                 ';' => "\$(top_srcdir)/",
+                 '^' => "\$(top_srcdir)${dir_suffix}/",
+                 '~' => "\$(top_srcdir)/",
                 );
 
     while (<$input>) {
@@ -153,12 +153,12 @@ sub process_input_mk ($$$$$$$$) {
                $targets->{$t} //= [ ];
            }
            elsif (m{^(?=$caps_re)}) { o $var_prefix }
-           elsif (s{^([,;]?)(?=$lc_re)}{}) { o $pfxmap{$1} }
+           elsif (s{^([~^]?)(?=$lc_re)}{}) { o $pfxmap{$1} }
            elsif (s{^_}{}) { o $var_prefix }
            elsif (s{^=_}{}) { o $var_prefix }
-           elsif (s{^([,;]?)/}{}) { o $pfxmap{$1} }
+           elsif (s{^([~^]?)/}{}) { o $pfxmap{$1} }
            elsif (s{^=/}{}) { o $dir_name }
-           elsif (s{^([,;]?)(?=[ \t])}{}) {
+           elsif (s{^([~^]?)(?=[ \t])}{}) {
                my $prefix = $pfxmap{$1} // die;
                my $after='';
                if (m{([ \t])$esc}) { ($_,$after) = ($`, $1.$'); }