X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=build-aux%2Fsubdirmk-setup;h=6822fe12aa27d8d285b1775dbbc7bbebcd242ad9;hb=0f76ff6232060fa6ac511061ce4e0bd859c9b61d;hp=c1866f6bcb29ae5f48858a6c3353e691972046dd;hpb=a423046ad42c0fbdf7fd3afad88dfe57dfbd30ca;p=subdirmk.git diff --git a/build-aux/subdirmk-setup b/build-aux/subdirmk-setup index c1866f6..6822fe1 100644 --- a/build-aux/subdirmk-setup +++ b/build-aux/subdirmk-setup @@ -8,35 +8,19 @@ use strict; -our $root = [ '.', [ ] ]; -# each node is [ 'relative subdir name', \@children ] +our @allsubdirs = @ARGV; -sub build_tree () { - foreach my $subdir (@ARGV) { - my @path = $subdir eq '.' ? () : split m{/+}, $subdir; - my $node = $root; - foreach my $d (@path) { - my ($c,) = grep { $_->[0] eq $d } @{ $node->[1] }; - if (!$c) { - $c = [ $d, [ ] ]; - push @{ $node->[1] }, $c; - } - $node = $c; - } - } -} - - - -sub write_makefile ($$) { - my ($subdir,$depth) = @_; +sub write_makefile () { start_output_file("Makefile"); - my $cd = $depth ? join('/', ('..',) x $depth) : '.'; print O <