cvsuser 03/07/23 07:38:28
Modified: config/gen makefiles.pl
config/gen/makefiles docs.in
Log:
Generate POD from the ops files in portable fashion. Courtesy of Lars Balker
Rasmussen.
Revision Changes Path
1.17 +28 -2 parrot/config/gen/makefiles.pl
Index: makefiles.pl
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- makefiles.pl 21 Jul 2003 20:16:12 -0000 1.16
+++ makefiles.pl 23 Jul 2003 14:38:23 -0000 1.17
@@ -13,8 +13,6 @@
commentType => '#');
genfile('config/gen/makefiles/classes.in', 'classes/Makefile',
commentType => '#');
- genfile('config/gen/makefiles/docs.in', 'docs/Makefile',
- commentType => '#');
genfile('config/gen/makefiles/languages.in', 'languages/Makefile',
commentType => '#');
genfile('config/gen/makefiles/jako.in', 'languages/jako/Makefile',
@@ -33,6 +31,34 @@
commentType => '#');
genfile('config/gen/makefiles/ook.in', 'languages/ook/Makefile',
commentType => '#');
+
+ # set up docs/Makefile, partly based on the .ops in the root dir
+
+ opendir ROOT, "." or die "opendir .: $!";
+ my @ops = sort grep { -f $_ and /\.ops$/ } readdir ROOT;
+ closedir ROOT;
+
+ my $pod = join " ", map { my $t = $_; $t =~ s/\.ops$/.pod/; "ops/$t" } @ops;
+
+ Configure::Data->set(pod => $pod);
+
+ genfile('config/gen/makefiles/docs.in', 'docs/Makefile',
+ commentType => '#');
+
+ Configure::Data->set(pod => undef);
+
+ open MAKEFILE, ">> docs/Makefile" or die "open >> docs/Makefile: $!";
+
+ foreach my $ops (@ops) {
+ my $pod = $ops;
+ $pod =~ s/\.ops$/.pod/;
+ print MAKEFILE <<"EOM";
+ops/$pod: ../$ops
+ perldoc -u ../$ops > ops/$pod
+EOM
+ }
+
+ close MAKEFILE
}
1;
1.6 +3 -5 parrot/config/gen/makefiles/docs.in
Index: docs.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/docs.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- docs.in 22 Jul 2003 21:04:14 -0000 1.5
+++ docs.in 23 Jul 2003 14:38:28 -0000 1.6
@@ -1,11 +1,9 @@
PERL = ${perl}
RM_F = ${rm_f}
-OPS = bit.pod cmp.pod core.pod debug.pod dotgnu.pod io.pod math.pod \
- object.pod obscure.pod pmc.pod rx.pod set.pod stack.pod string.pod \
- sys.pod var.pod
+POD = ${pod}
-all: packfile-c.pod packfile-perl.pod
+all: packfile-c.pod packfile-perl.pod $(POD)
packfile-c.pod: ../packfile.c
perldoc -u ../packfile.c > packfile-c.pod
@@ -14,5 +12,5 @@
perldoc -u ../lib/Parrot/PackFile.pm > packfile-perl.pod
clean:
- $(RM_F) packfile-c.pod packfile-perl.pod
+ $(RM_F) packfile-c.pod packfile-perl.pod $(POD)