chiark
/
gitweb
/
~ian
/
secnet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a423046
)
Revert "BEFORE NO BUILD TREE"
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 10 Nov 2019 13:31:36 +0000
(13:31 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 10 Nov 2019 13:31:36 +0000
(13:31 +0000)
This reverts commit
a423046ad42c0fbdf7fd3afad88dfe57dfbd30ca
.
build-aux/subdirmk-setup
patch
|
blob
|
history
diff --git
a/build-aux/subdirmk-setup
b/build-aux/subdirmk-setup
index c1866f6bcb29ae5f48858a6c3353e691972046dd..9f3c8c62a43ae7858af834a8595db26e7c245d38 100644
(file)
--- a/
build-aux/subdirmk-setup
+++ b/
build-aux/subdirmk-setup
@@
-8,41
+8,25
@@
use strict;
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");
start_output_file("Makefile");
- my $cd = $depth ? join('/', ('..',) x $depth) : '.';
print O <<END;
%:
print O <<END;
%:
- $(MAKE) -C
$cd
$subdir/$@
+ $(MAKE) -C
@top
$subdir/$@
END
END
-}
+
+ my @thesedirs = $subdir, grep { $_ =~ m{^$subdir/} } @allsubdirs;
+ printf O "include $_/Subdir.mk"
+
+
sub process_subdir ($$) {
my ($subdir) = @_;
sub process_subdir ($$) {
my ($subdir) = @_;
- my $d
epth = $subdir eq '.' ? 0 : scalar split m{/+}, $subdir;
- write_makefile($subdir
,$depth
);
+ my $d
+ write_makefile($subdir);
filter_subdir_mk();
}
filter_subdir_mk();
}
-build_tree();
+foreach (@allsubdirs) { process_subdir($_); }