chiark / gitweb /
README: More syntax further up
[subdirmk.git] / generate
index 3caf4e65a0bac0d559c7d891904cefae29584179..bae0995bef30dc90fbd19e7cb511d61a0887b99a 100755 (executable)
--- a/generate
+++ b/generate
@@ -198,6 +198,8 @@ sub wrncore ($$) {
 
 sub wrn ($$) {
     my ($wk,$m) = @_;
+    our %warn_dedupe;
+    return 0 if $warn_dedupe{$err_file,$.,$wk,$m}++;
     wrncore($wk, "${err_file}:$.: $m");
 }
 
@@ -289,9 +291,15 @@ sub process_input_mk ($$$$) {
                }
            }
            next;
+       } elsif (s#^\s*$esc\:local\+global\s+(\S.*)$##) {
+           foreach my $vn (split /\s+/, $1) {
+               $vn =~ s{^$esc}{};
+               $varref{$vn}{NoWarn} = 1;
+           }
+           next;
        } elsif (s#^\s*$esc\:(?=(-?)include|macro)##) {
            $buffering_output='';
-       } elsif (m#^\s*$esc\:([a-z][-0-9a-z_]*)#) {
+       } elsif (m#^\s*$esc\:([a-z][-+0-9a-z_]*)#) {
            err "unknown directive &:$1 or bad argumnt syntax";
        } elsif (s{^\s*${esc}TARGETS(?:_([0-9a-zA-Z_]+))?(?=\W)}{}) {
            my $t = $1 // 'all';
@@ -513,6 +521,7 @@ sub print_varref_warnings () {
     foreach my $vn (sort keys %varref) {
        my $vv = $varref{$vn};
        next unless $vv->{''} && $vv->{1};
+       next if $vv->{NoWarn};
        wrncore 'local+global', "saw both $vn and &$vn" or return;
        foreach my $amp ('', 1) {
            printf STDERR " saw %s%s at %s\n",