# # # Import qw( date env revision version ); # $verfile = SourcePath("version.sgml"); open(FILE, ">$verfile") || die "Cannot open '$verfile': $!"; print FILE <<_EOF_; _EOF_ close(FILE); Ignore("#$verfile"); # # # @doc_dirs = qw( design ); # Find internal dependencies in .sgml files: # # # # # This only finds one per line, and assumes that anything # defined as a SYSTEM entity is, in fact, a file included # somewhere in the document. sub scansgml { my @includes = (); do { if (//i) { push(@includes, $1); } elsif (/]*\sfileref="([^"]*)"/) { push(@includes, "design/$1"); } } while (); @includes; } $env->QuickScan(\&scansgml, "scons.mod"); $env->QuickScan(\&scansgml, "copyright.sgml"); foreach $doc (@doc_dirs) { my $main = "$doc/main.sgml"; my $out = "main.out"; $env->QuickScan(\&scansgml, $main); $env->Command("HTML/$doc/book1.html", $main, qq(jw -b html -o %>:d %<)); $env->Command("PS/$doc.ps", $main, [qq(jw -b ps -o %>:d %<), qq(mv %>:d/main.ps %>), ]); $env->Command("PDF/$doc.pdf", $main, [qq(jw -b pdf -o %>:d %<), qq(mv %>:d/main.pdf %>), # qq(rm -f %>:d/$out), ]); }