develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r36115 - in trunk/config: auto gen gen/makefiles

From:
fperrad
Date:
January 28, 2009 12:24
Subject:
[svn:parrot] r36115 - in trunk/config: auto gen gen/makefiles
Message ID:
20090128202417.0EAC5CB9AE@x12.develooper.com
Author: fperrad
Date: Wed Jan 28 12:24:16 2009
New Revision: 36115

Modified:
   trunk/config/auto/perldoc.pm
   trunk/config/gen/makefiles.pm
   trunk/config/gen/makefiles/docs.in

Log:
[configure] the generation of 'docs/Makefile' is not longer a special case

Modified: trunk/config/auto/perldoc.pm
==============================================================================
--- trunk/config/auto/perldoc.pm	(original)
+++ trunk/config/auto/perldoc.pm	Wed Jan 28 12:24:16 2009
@@ -46,6 +46,48 @@
 
     _handle_version($conf, $version, $cmd);
 
+    my $TEMP_pod_build = <<'E_NOTE';
+
+# the following part of the Makefile was built by 'config/auto/perldoc.pm'
+
+E_NOTE
+
+    opendir OPS, 'src/ops' or die "opendir ops: $!";
+    my @ops = sort grep { !/^\./ && /\.ops$/ } readdir OPS;
+    closedir OPS;
+
+    my $TEMP_pod = join q{ } =>
+        map { my $t = $_; $t =~ s/\.ops$/.pod/; "ops/$t" } @ops;
+
+    my $slash       = $conf->data->get('slash');
+    my $new_perldoc = $conf->data->get('new_perldoc');
+
+    foreach my $ops (@ops) {
+        my $pod = $ops;
+        $pod =~ s/\.ops$/.pod/;
+        if ( $new_perldoc ) {
+            $TEMP_pod_build .= <<"END"
+ops$slash$pod: ..${slash}src${slash}ops${slash}$ops
+\t\$(PERLDOC) -ud ops${slash}$pod ..${slash}src${slash}ops${slash}$ops
+\t\$(CHMOD) 0644 ops${slash}$pod
+
+END
+        }
+        else {
+            $TEMP_pod_build .= <<"END"
+ops$slash$pod: ..${slash}src${slash}ops${slash}$ops
+\t\$(PERLDOC) -u ..${slash}ops${slash}$ops > ops${slash}$pod
+\t\$(CHMOD) 0644 ..${slash}ops${slash}$pod
+
+END
+        }
+    }
+
+    $conf->data->set(
+        TEMP_pod             => $TEMP_pod,
+        TEMP_pod_build       => $TEMP_pod_build,
+    );
+
     return 1;
 }
 

Modified: trunk/config/gen/makefiles.pm
==============================================================================
--- trunk/config/gen/makefiles.pm	(original)
+++ trunk/config/gen/makefiles.pm	Wed Jan 28 12:24:16 2009
@@ -78,7 +78,6 @@
     my ( $self, $conf ) = @_;
 
     $self->makefiles($conf);
-    $conf->append_configure_log('docs/Makefile');
     $self->cflags($conf);
 
     return 1;
@@ -123,55 +122,7 @@
         my $args   = $self->{makefiles}->{$target};
         my $source = delete $args->{SOURCE};
 
-        if ( $target ne 'docs/Makefile' ) {
-            $conf->genfile($source => $target, %$args );
-        }
-        else {
-
-            if ( $conf->data->get('has_perldoc') ) {
-
-                # set up docs/Makefile, partly based on the .ops in the root dir
-
-                opendir OPS, "src/ops" or die "opendir ops: $!";
-                my @ops = sort grep { !/^\./ && /\.ops$/ } readdir OPS;
-                closedir OPS;
-
-                my $pod = join " " =>
-                    map { my $t = $_; $t =~ s/\.ops$/.pod/; "ops/$t" } @ops;
-
-                $conf->data->set( pod => $pod );
-
-                $conf->genfile($source => $target, %$args );
-
-                $conf->data->set( pod => undef );
-
-                open my $MAKEFILE, ">>", "docs/Makefile"
-                    or die "open >> docs/Makefile: $!";
-
-                my $slash       = $conf->data->get('slash');
-                my $new_perldoc = $conf->data->get('new_perldoc');
-
-                foreach my $ops (@ops) {
-                    my $pod = $ops;
-                    $pod =~ s/\.ops$/.pod/;
-                    print {$MAKEFILE} "ops$slash$pod: ..${slash}src${slash}ops${slash}$ops\n";
-                    if ( $new_perldoc == 1 ) {
-                        print {$MAKEFILE} "\t\$(PERLDOC) -ud ops${slash}$pod"
-                            . " ..${slash}src${slash}ops${slash}$ops\n";
-                        print {$MAKEFILE} "\t\$(CHMOD) 0644 ops${slash}$pod\n\n";
-                    }
-                    else {
-                        print {$MAKEFILE} "\t\$(PERLDOC) -u ..${slash}ops${slash}$ops"
-                            . " > ops${slash}$pod\n";
-                        print {$MAKEFILE} "\t\$(CHMOD) 0644 ..${slash}ops${slash}$pod\n\n";
-                    }
-                }
-
-            }
-            else {
-                print "\nNo Perldoc, not generating a docs makefile.\n";
-            }
-        }
+        $conf->genfile($source => $target, %$args );
     }
     return;
 }

Modified: trunk/config/gen/makefiles/docs.in
==============================================================================
--- trunk/config/gen/makefiles/docs.in	(original)
+++ trunk/config/gen/makefiles/docs.in	Wed Jan 28 12:24:16 2009
@@ -9,7 +9,7 @@
 PERLDOC = @perldoc@
 
 # long list of .pod files
-POD = @pod@
+POD = @TEMP_pod@
 
 #
 # Targets
@@ -35,7 +35,7 @@
 	$(MKPATH) ops
 
 packfile-c.pod: ../src/packfile.c
-#IF(new_perldoc):	$(PERLDOC) -ud packfile-c.pod ../src/packfile.c 
+#IF(new_perldoc):	$(PERLDOC) -ud packfile-c.pod ../src/packfile.c
 #ELSE:	$(PERLDOC) -u ../src/packfile.c > packfile-c.pod
 
 clean:
@@ -47,3 +47,4 @@
 html-clean:
 	$(PERL) -I../lib -MParrot::Distribution -e "Parrot::Distribution->new()->delete_html_docs()"
 
+@TEMP_pod_build@



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About