2 # Build HTML files from .pod and .pm files
3 # I'd love to do this as a makefile, but the targets have colons, which
4 # make hates (GNU make, anyway)
12 'BSE::TB::SiteCommon.html',
13 'BSE::TB::TagOwner.html',
17 'Generate::Article.html',
18 'Generate::Product.html',
19 'Generate::Catalog.html',
20 'Squirrel::Template.html',
34 'BSE::UI::Affiliate.html',
43 my @exts = qw(.pod .pm .pl);
44 push(@exts, ''); # I should have put a .pl on makedocs
50 '../cgi-bin/modules/',
57 getopts("hn", \%opts);
60 for my $target (@targets) {
61 # try to find the source
65 SEARCH: for my $ext (@exts) {
66 (my $file = $base) =~ s/\.html$/$ext/;
67 for my $dir (@search) {
74 $source or die "Cannot find source for $target\n";
75 if (!-e $target || -M $target > -M $source) {
76 my $cmd = "pod2html --infile=$source --outfile=$target --htmlroot=.";
77 $cmd .= " --podpath=".join(":", @search);
79 if (!$opts{n} and system $cmd) {
80 die "** makedocs failed\n";
85 # remove the pod2html caches - I don't care much if this fails
86 unlink 'pod2html-dircache', 'pod2html-itemcache';
90 Usage: $0 - make the documentation files
91 $0 -n - report what would be done to make the documentation files
92 $0 -h - produce this message
101 makedocs - produces HTML documentation from POD for BSE
109 Used during the BSE distribution build process to product HTML
110 versions of the POD documentation included with various parts of BSE.
112 Searches in various standard places for source pod/pl/pm files and
113 converts them into HTML.
117 C<makedocs> is typically run without options.
123 Report the actions that would be taken without actually performing the
128 Produces a brief usage message.
134 We're keeping a dependency list in this file, it should be elsewhere,
135 maybe we could parse MANIFEST.
139 Tony Cook <tony@develop-help.com>