chiark
/
gitweb
/
~ian
/
subdirmk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b41c29f
)
WIP
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 10 Nov 2019 20:31:11 +0000
(20:31 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 10 Nov 2019 20:31:11 +0000
(20:31 +0000)
build-aux/subdirmk-setup
patch
|
blob
|
history
diff --git
a/build-aux/subdirmk-setup
b/build-aux/subdirmk-setup
index 3d8ef7d8221c7fe52f2f41bfd23457398dfd4a83..59430c7cc987977d9f866ae5f0b491903782f4de 100755
(executable)
--- a/
build-aux/subdirmk-setup
+++ b/
build-aux/subdirmk-setup
@@
-8,11
+8,19
@@
use strict;
use strict;
+our $srcdir;
+our @subdirs = @ARGV;
+
+die unless $ARGV[0] eq '--srcdir';
+die unless @ARGV>=2;
+shift @ARGV;
+($srcdir, @subdirs) = @ARGV;
+
our $root = [ '.', [ ] ];
# each node is [ 'relative subdir name', \@children ]
sub build_tree () {
our $root = [ '.', [ ] ];
# each node is [ 'relative subdir name', \@children ]
sub build_tree () {
- foreach my $subdir (@
ARGV
) {
+ foreach my $subdir (@
subdirs
) {
my @path = $subdir eq '.' ? () : split m{/+}, $subdir;
my $node = $root;
foreach my $d (@path) {
my @path = $subdir eq '.' ? () : split m{/+}, $subdir;
my $node = $root;
foreach my $d (@path) {
@@
-38,7
+46,7
@@
sub write_makefile ($$) {
o <<END;
default: all
%:
o <<END;
default: all
%:
- $(MAKE) -C $cd ${dir_prefix}$@
+
\
$(MAKE) -C $cd ${dir_prefix}$@
END
}
END
}
@@
-145,7
+153,7
@@
sub process_tree() {
process_subtree($root, [ ]);
start_output_file("subdirs.mk");
o "include Subdir.mk\n";
process_subtree($root, [ ]);
start_output_file("subdirs.mk");
o "include Subdir.mk\n";
- foreach my $subdir (@
ARGV
) {
+ foreach my $subdir (@
subdirs
) {
o "include $subdir/Subdir.mk";
}
}
o "include $subdir/Subdir.mk";
}
}