chiark / gitweb /
DOES NOT WORK
[subdirmk.git] / build-aux / subdirmk-setup
index 000417f01874d940438518056b1c94ad09934aaa..e6e30e039912fd36f5703982199d3d7cc7cad736 100755 (executable)
@@ -16,6 +16,8 @@ die unless @ARGV>=2;
 shift @ARGV;
 ($srcdir, @subdirs) = @ARGV;
 
 shift @ARGV;
 ($srcdir, @subdirs) = @ARGV;
 
+s{/+$}{} foreach @subdirs;
+
 our $root = [ '.', [ ] ];
 # each node is [ 'relative subdir name', \@children ]
 
 our $root = [ '.', [ ] ];
 # each node is [ 'relative subdir name', \@children ]
 
@@ -77,8 +79,12 @@ sub write_makefile ($$) {
     my $cd = $depth ? join('/', ('..',) x $depth) : '.';
     o <<END;
 default: all
     my $cd = $depth ? join('/', ('..',) x $depth) : '.';
     o <<END;
 default: all
-%:
+       \@: \$@
+%:     FORCE-ALWAYS-RUN
        \$(MAKE) -C $cd -f subdirs.mk ${dir_prefix}\$@
        \$(MAKE) -C $cd -f subdirs.mk ${dir_prefix}\$@
+Makefile FORCE-ALWAYS-RUN:
+       \@: \$@
+.SUFFIXES:
 END
 }
 
 END
 }