Skip to content

Commit

Permalink
[GH #896] Revert "Apply patch submitted by Coke in TT #1954."
Browse files Browse the repository at this point in the history
This reverts commit 6ac86c9.

We need to provide docs for our ops.
  • Loading branch information
Reini Urban committed Dec 21, 2012
1 parent 4ea38b3 commit c2da547
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 7 deletions.
43 changes: 43 additions & 0 deletions config/auto/perldoc.pm
Expand Up @@ -46,6 +46,47 @@ sub runstep {

_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 my $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 $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/$pod: ../src/ops/$ops
\t\$(PERLDOC_BIN) -ud ops/$pod ../src/ops/$ops
\t\$(CHMOD) 0644 ops/$pod
END
}
else {
$TEMP_pod_build .= <<"END"
ops/$pod: ../src/ops/$ops
\t\$(PERLDOC_BIN) -u ../ops/$ops > ops/$pod
\t\$(CHMOD) 0644 ../ops/$pod
END
}
}

$conf->data->set(
TEMP_pod => $TEMP_pod,
TEMP_pod_build => $TEMP_pod_build,
);

return 1;
}

Expand All @@ -57,6 +98,8 @@ sub _initial_content_check {
has_perldoc => 0,
new_perldoc => 0,
perldoc => 'echo',
TEMP_pod => '',
TEMP_pod_build => '',
);
$self->set_result('no');
return;
Expand Down
31 changes: 24 additions & 7 deletions config/gen/makefiles/docs.in
Expand Up @@ -10,31 +10,46 @@ RM_RF = @rm_rf@
PERLDOC_BIN = @perldoc@
VERSION = @VERSION@@DEVEL@

# long list of .pod files
POD = @TEMP_pod@

#
# Targets
#

# The default target
all: packfile-c.pod $(POD)

# This is a listing of all targets, that are meant to be called by users
# Most of them are proxied in the root makefile parrot/Makefile
help :
@echo ""
@echo "Following targets are available:"
@echo "Following targets are available to the user:"
@echo ""
@echo "help Generate this usage statement."
@echo "all: Generate documentation from .pod files or from the sources."
@echo " This is the default target."
@echo ""
@echo "html Generate html documentation"
@echo "html-clean Remove html documentation"
@echo ""
@echo "htmlhelp: windows only, generate a .chm file."
@echo "htmlhelp-clean: Remove generated .chm"
@echo ""
@echo "pdf: Generate a PDF from the html docs"
@echo "pdf-clean: Remove generated pdf"
@echo ""
@echo " clean: Invoke all clean targets"
@echo " clean: Remove the generated documentation."
@echo ""

clean: htmlhelp-clean html-clean
$(POD): doc-prep

doc-prep:
$(MKPATH) ops
$(TOUCH) doc-prep

packfile-c.pod: ../src/packfile/api.c
#IF(new_perldoc): $(PERLDOC_BIN) -ud packfile-c.pod ../src/packfile/api.c
#ELSE: $(PERLDOC_BIN) -u ../src/packfile/api.c > packfile-c.pod

clean:
$(RM_F) packfile-c.pod $(POD) doc-prep

html:
$(PERL) -I../lib ../tools/docs/mk_html_docs.pl --version=$(VERSION)
Expand Down Expand Up @@ -63,6 +78,8 @@ htmlhelp: html
htmlhelp-clean:
#IF(win32): $(RM_F) "html/*.hhc" "html/*.hhk" "html/*.hhp" "html/*.chm"

@TEMP_pod_build@

# Local variables:
# mode: makefile
# End:
Expand Down
13 changes: 13 additions & 0 deletions config/gen/makefiles/root.in
Expand Up @@ -791,6 +791,7 @@ help :
@echo ""
@echo "Documentation:"
@echo " help: Print this help message."
@echo " docs: Generate documentation from POD in the sources."
@echo " html: Generate HTML documentation from POD in the sources."
@echo " html-clean: Remove the HTML documentation."
@echo " htmlhelp: Compile HTML documentation (CHM format)."
Expand Down Expand Up @@ -2090,6 +2091,18 @@ $(INC_DIR)/vtable.h : src/vtable.tbl $(BUILD_TOOLS_DIR)/vtable_h.pl lib/Parrot/V
#
###############################################################################

#IF(has_perldoc):docs : docs.dummy
#ELSE:docs : docs.stub

docs.stub:
@echo "Perldoc is required, but not detected."

docs.dummy :
$(MAKE) docs

docs-clean :
$(MAKE) docs clean

#IF(has_perldoc):html : html.dummy
#ELSE:html : html.stub

Expand Down

0 comments on commit c2da547

Please sign in to comment.