Ticket #1954: 0001-Remove-make-docs-global-target.patch

File 0001-Remove-make-docs-global-target.patch, 5.0 KB (added by coke, 3 years ago)
  • config/auto/perldoc.pm

    From ff1007604bbf3d9d01aac95bde1e67a6806cb6df Mon Sep 17 00:00:00 2001
    From: Coke <will@coleda.com>
    Date: Sat, 19 Feb 2011 00:41:01 -0500
    Subject: [PATCH] Remove "make docs" global target
      - also removes default make target in docs/ dir
      - makes "make help" the default.
    
    TT #1954
    ---
     config/auto/perldoc.pm       |   43 ------------------------------------------
     config/gen/makefiles/docs.in |   31 ++++++-----------------------
     config/gen/makefiles/root.in |   13 ------------
     3 files changed, 7 insertions(+), 80 deletions(-)
    
    diff --git a/config/auto/perldoc.pm b/config/auto/perldoc.pm
    index 8ff8465..d210422 100644
    a b  
    4646 
    4747    _handle_version($conf, $version, $cmd); 
    4848 
    49     my $TEMP_pod_build = <<'E_NOTE'; 
    50  
    51 # the following part of the Makefile was built by 'config/auto/perldoc.pm' 
    52  
    53 E_NOTE 
    54  
    55     opendir my $OPS, 'src/ops' or die "opendir ops: $!"; 
    56     my @ops = sort grep { !/^\./ && /\.ops$/ } readdir $OPS; 
    57     closedir $OPS; 
    58  
    59     my $TEMP_pod = join q{ } => 
    60         map { my $t = $_; $t =~ s/\.ops$/.pod/; "ops/$t" } @ops; 
    61  
    62     my $new_perldoc = $conf->data->get('new_perldoc'); 
    63  
    64     foreach my $ops (@ops) { 
    65         my $pod = $ops; 
    66         $pod =~ s/\.ops$/.pod/; 
    67         if ( $new_perldoc ) { 
    68             $TEMP_pod_build .= <<"END" 
    69 ops/$pod: ../src/ops/$ops 
    70 \t\$(PERLDOC_BIN) -ud ops/$pod ../src/ops/$ops 
    71 \t\$(CHMOD) 0644 ops/$pod 
    72  
    73 END 
    74         } 
    75         else { 
    76             $TEMP_pod_build .= <<"END" 
    77 ops/$pod: ../src/ops/$ops 
    78 \t\$(PERLDOC_BIN) -u ../ops/$ops > ops/$pod 
    79 \t\$(CHMOD) 0644 ../ops/$pod 
    80  
    81 END 
    82         } 
    83     } 
    84  
    85     $conf->data->set( 
    86         TEMP_pod             => $TEMP_pod, 
    87         TEMP_pod_build       => $TEMP_pod_build, 
    88     ); 
    89  
    9049    return 1; 
    9150} 
    9251 
     
    9857            has_perldoc => 0, 
    9958            new_perldoc => 0, 
    10059            perldoc     => 'echo', 
    101             TEMP_pod        => '', 
    102             TEMP_pod_build  => '', 
    10360        ); 
    10461        $self->set_result('no'); 
    10562        return; 
  • config/gen/makefiles/docs.in

    diff --git a/config/gen/makefiles/docs.in b/config/gen/makefiles/docs.in
    index 4965daa..dfb2729 100644
    a b  
    1010PERLDOC_BIN = @perldoc@ 
    1111VERSION = @VERSION@@DEVEL@ 
    1212 
    13 # long list of .pod files 
    14 POD = @TEMP_pod@ 
    15  
    1613# 
    1714# Targets 
    1815# 
    19  
    20 # The default target 
    21 all: packfile-c.pod $(POD) 
    22  
    2316# This is a listing of all targets, that are meant to be called by users 
    2417# Most of them are proxied in the root makefile parrot/Makefile 
    2518help : 
    2619        @echo "" 
    27         @echo "Following targets are available to the user:" 
     20        @echo "Following targets are available:" 
    2821        @echo "" 
    29         @echo "all:             Generate documentation from .pod files or from the sources." 
     22        @echo "help             Generate this usage statement." 
    3023        @echo "                 This is the default target." 
    3124        @echo "" 
     25        @echo "html             Generate html documentation" 
     26        @echo "html-clean       Remove html documentation" 
     27        @echo "" 
    3228        @echo "htmlhelp:        windows only, generate a .chm file." 
    3329        @echo "htmlhelp-clean:  Remove generated .chm" 
    3430        @echo "" 
    3531        @echo "pdf:             Generate a PDF from the html docs" 
    3632        @echo "pdf-clean:       Remove generated pdf" 
    3733        @echo "" 
    38         @echo "   clean:        Remove the generated documentation." 
     34        @echo "   clean:        Invoke all clean targets" 
    3935        @echo "" 
    4036 
    41 $(POD): doc-prep 
    42  
    43 doc-prep: 
    44         $(MKPATH) ops 
    45         $(TOUCH) doc-prep 
    46  
    47 packfile-c.pod: ../src/packfile/api.c 
    48 #IF(new_perldoc):       $(PERLDOC_BIN) -ud packfile-c.pod ../src/packfile/api.c 
    49 #ELSE:  $(PERLDOC_BIN) -u ../src/packfile/api.c > packfile-c.pod 
    50  
    51 clean: 
    52         $(RM_F) packfile-c.pod $(POD) doc-prep 
     37clean: htmlhelp-clean html-clean 
    5338 
    5439html: 
    5540        $(PERL) -I../lib ../tools/docs/make_html_docs.pl --version=$(VERSION) 
     
    7863htmlhelp-clean: 
    7964#IF(win32):     $(RM_F) "html/*.hhc" "html/*.hhk" "html/*.hhp" "html/*.chm" 
    8065 
    81 @TEMP_pod_build@ 
    82  
    8366# Local variables: 
    8467#   mode: makefile 
    8568# End: 
  • config/gen/makefiles/root.in

    diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in
    index 89cfbba..c205295 100644
    a b  
    757757        @echo "" 
    758758        @echo "Documentation:" 
    759759        @echo "  help:              Print this help message." 
    760         @echo "  docs:              Generate documentation from POD in the sources." 
    761760        @echo "  html:              Generate HTML documentation from POD in the sources." 
    762761        @echo "  html-clean:        Remove the HTML documentation." 
    763762        @echo "  htmlhelp:          Compile HTML documentation (CHM format)." 
     
    19141913# 
    19151914############################################################################### 
    19161915 
    1917 #IF(has_perldoc):docs : docs.dummy 
    1918 #ELSE:docs : docs.stub 
    1919  
    1920 docs.stub: 
    1921         @echo "Perldoc is required, but not detected." 
    1922  
    1923 docs.dummy : 
    1924         $(MAKE) docs 
    1925  
    1926 docs-clean : 
    1927         $(MAKE) docs clean 
    1928  
    19291916#IF(has_perldoc):html : html.dummy 
    19301917#ELSE:html : html.stub 
    19311918