-&= => subdir
-&_ => subdir_
-&/ => subdir/
-&CAPS => subdir_CAPS
-&lc => subdir/lc
-
-&.= &._ &./ &.CAPS &.lc => $(top_srcdir)/subdir
-&:= &:_ &:/ &:CAPS &:lc => $(abs_top_srcdir)/subdir
+&= => subdir
+&_ => subdir_
+&/ => subdir/
+&CAPS => subdir_CAPS _ counts
+&lc => subdir/lc _ counts
+
+&,= &,_ &,/ &,CAPS &,lc prefixes $(top_srcdir)/subdir
+&;= &;_ &;/ &;CAPS &;lc prefixes $(abs_top_srcdir)/subdir
+
+&. => $(top_srcdir)
+&: => $(abs_top_srcdir)
+
& thing thing => like &thing &thing (until EOL)
+ (edits only `thing's which are CAPS or lc
+ and follow a space)
-&& => &
+&& => &
&! spc disables & *until* EOL
eg
&!@@@ @@@ is recognised instead of &
@@@!& go back to &
+
+&TARGETS[_things] is handled specially
+ must be spelled precisely this way
+ if no _things, means _all
--- /dev/null
+#!/usr/bin/perl -w
+#
+# $(srcdir)/build-aux/subdirmk-setup SUBDIR...
+#
+# generates
+# Subdir.mk.tmp
+# Makefile.tmp
+
+use strict;
+
+our @allsubdirs = @ARGV;
+
+sub write_makefile () {
+ start_output_file("Makefile");
+ print O <<END;
+%:
+ $(MAKE) -C @top $subdir/$@
+END
+
+ my @thesedirs = $subdir, grep { $_ =~ m{^$subdir/} } @allsubdirs;
+ printf O "include $_/Subdir.mk"
+
+
+
+sub process_subdir ($$) {
+ my ($subdir) = @_;
+ my $d
+ write_makefile($subdir);
+ filter_subdir_mk();
+}
+
+foreach (@allsubdirs) { process_subdir($_); }
### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
### MA 02111-1307, USA.
-&TARGETS_all += & libtoy.a
+&TARGETS += & libtoy.a
&OBJECTS += & toylib.c