2
0

build.info 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. SUBDIRS = man1
  2. {-
  3. use File::Spec::Functions qw(:DEFAULT abs2rel rel2abs);
  4. use File::Basename;
  5. foreach my $section ((1, 3, 5, 7)) {
  6. my @htmlfiles = ();
  7. my @manfiles = ();
  8. my %podfiles =
  9. map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod");
  10. my %podinfiles =
  11. map { $_ => 1 } glob catfile($sourcedir, "man$section", "*.pod.in");
  12. foreach (keys %podinfiles) {
  13. (my $p = $_) =~ s|\.in$||i;
  14. $podfiles{$p} = 1;
  15. }
  16. foreach my $p (sort keys %podfiles) {
  17. my $podfile = abs2rel($p, $sourcedir);
  18. my $podname = basename($podfile, '.pod');
  19. my $podinfile = $podinfiles{"$p.in"} ? "$podfile.in" : undef;
  20. my $podname = basename($podfile, ".pod");
  21. my $htmlfile = abs2rel(catfile($buildtop, "doc", "html", "man$section",
  22. "$podname.html"),
  23. catdir($buildtop, "doc"));
  24. my $manfile = abs2rel(catfile($buildtop, "doc", "man", "man$section",
  25. "$podname.$section"),
  26. catdir($buildtop, "doc"));
  27. # The build.info format requires file specs to be in Unix format.
  28. # Especially, since VMS file specs use [ and ], the build.info parser
  29. # will otherwise get terribly confused.
  30. if ($^O eq 'VMS') {
  31. $htmlfile = VMS::Filespec::unixify($htmlfile);
  32. $manfile = VMS::Filespec::unixify($manfile);
  33. $podfile = VMS::Filespec::unixify($podfile);
  34. $podinfile = VMS::Filespec::unixify($podinfile)
  35. if defined $podinfile;
  36. } elsif ($^O eq 'MSWin32') {
  37. $htmlfile =~ s|\\|/|g;
  38. $manfile =~ s|\\|/|g;
  39. $podfile =~ s|\\|/|g;
  40. $podinfile =~ s|\\|/|g
  41. if defined $podinfile;
  42. }
  43. push @htmlfiles, $htmlfile;
  44. push @manfiles, $manfile;
  45. $OUT .= << "_____";
  46. DEPEND[$htmlfile]=$podfile
  47. GENERATE[$htmlfile]=$podfile
  48. DEPEND[$manfile]=$podfile
  49. GENERATE[$manfile]=$podfile
  50. _____
  51. $OUT .= << "_____" if $podinfile;
  52. DEPEND[$podfile]=$podinfile ../configdata.pm
  53. GENERATE[$podfile]=$podinfile
  54. _____
  55. }
  56. $OUT .= "HTMLDOCS[man$section]=" . join(" \\\n", @htmlfiles) . "\n";
  57. $OUT .= "MANDOCS[man$section]=" . join(" \\\n", @manfiles) . "\n";
  58. }
  59. -}