#!/usr/bin/perl -w use strict; if ($#ARGV ne 1) { die "Usage: $0 \n" } my @ghc_commands = split / /, $ARGV[0]; my $libdir = $ARGV[1]; print <<'EOF'; .\" .\" This is a generated file. Changes might get clobbered. Edit at own's risk. .\" .TH GHC 1 "2002-10-25" "Glasgow FP Suite" "Glasgow Haskell Compiler" .SH NAME GHC \- the Glasgow Haskell Compiler .SH SYNOPSIS EOF my $started = 0; for my $ghc_command (@ghc_commands) { print ".br\n" if $started; $started = 1; print <<"EOF"; .B $ghc_command .RI [ option | filename ]... EOF } print <<'EOF'; .SH DESCRIPTION This manual page documents briefly the .B ghc and .B ghci commands. Note that .B ghci is not yet available on all architectures. Extensive documentation is available in various other formats including DVI, PostScript and HTML; see below. .PP Each of GHC's command line options is classified as either .IR static " or " dynamic . A static flag may only be specified on the command line, whereas a dynamic flag may also be given in an \f(CROPTIONS\fP pragma in a source file or set from the GHCi command-line with \f(CR:set\fP. As a rule of thumb, all the language options are dynamic, as are the warning options and the debugging options. The rest are static, with the notable exceptions of .BR \-v ", " \-cpp ", " \-fasm ", " \-fvia\-C ", and " \-#include . The OPTIONS sections lists the status of each flag. .PP Common suffixes of file names for Haskell are: .TP .B .hs Haskell source code; preprocess, compile .TP .B .lhs literate Haskell source; unlit, preprocess, compile .TP .B .hi Interface file; contains information about exported symbols .TP .B .hc intermediate C files .TP .BI . x _o way .I x object files; common ways are: .BR p ", " u ", " s .TP .BI . x _hi way .I x interface files .SH OPTIONS .SH FILES EOF print ".I $libdir"; print <<'EOF'; .SH COPYRIGHT Copyright 2002, The University Court of the University of Glasgow. .br All rights reserved. .SH AUTHOR This manual page was generated from the XML documentation of GHC with blood, sweat, tears and a breaks-if-you-look-at-it-the-wrong-way XSL stylesheet originally written by Michael Weber <michaelw@debian.org> for the Debian GNU/Linux system (but may be used by others). .\" End .SS .SS .nh .hy .SH .SH .TP .rj [] \fB \fP \fI \fP \f(CR \fP EOF