From a74ef5d0b9a5a8db3fe98fb0d671b35970cdc05c Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 31 Dec 2009 15:50:04 +0000 Subject: Use a shell script, rather than perl script, to make flags.xsl --- docs/man/gen_flags.xsl.pl | 284 --------------------------------------------- docs/man/gen_flags.xsl.sh | 289 ++++++++++++++++++++++++++++++++++++++++++++++ docs/man/ghc.mk | 4 +- 3 files changed, 291 insertions(+), 286 deletions(-) delete mode 100644 docs/man/gen_flags.xsl.pl create mode 100644 docs/man/gen_flags.xsl.sh diff --git a/docs/man/gen_flags.xsl.pl b/docs/man/gen_flags.xsl.pl deleted file mode 100644 index a331792f0d..0000000000 --- a/docs/man/gen_flags.xsl.pl +++ /dev/null @@ -1,284 +0,0 @@ -#!/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 - diff --git a/docs/man/gen_flags.xsl.sh b/docs/man/gen_flags.xsl.sh new file mode 100644 index 0000000000..28627ea5df --- /dev/null +++ b/docs/man/gen_flags.xsl.sh @@ -0,0 +1,289 @@ +#!/bin/sh + +if [ "$#" -ne 2 ] +then + echo "Usage: $0 " + exit 1 +fi + +GHC_COMMANDS="$1" +LIBDIR="$2" + +cat <<'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 + +STARTED=0 + +for GHC_COMMAND in $GHC_COMMANDS +do + if [ "$STARTED" -ne 0 ] + then + echo ".br" + fi + STARTED=1 + cat < + + + + +.SH FILES +EOF + +echo ".I $LIBDIR" +cat <<'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 + diff --git a/docs/man/ghc.mk b/docs/man/ghc.mk index 65ec327da5..c6eca0870b 100644 --- a/docs/man/ghc.mk +++ b/docs/man/ghc.mk @@ -24,8 +24,8 @@ $(MAN_PATH): docs/man/flags.xsl docs/man/flags.xml endif # Insert the commands and the library directory into the man page -docs/man/flags.xsl: docs/man/gen_flags.xsl.pl - $(PERL) $< "$(MAN_GHC_COMMANDS)" "$(libdir)" > $@ +docs/man/flags.xsl: docs/man/gen_flags.xsl.sh + $(SHELL) $< "$(MAN_GHC_COMMANDS)" "$(libdir)" > $@ # Re-use the flags documentation from the user's guide by injecting some # entities after the XML declaration to make it a stand-alone document. -- cgit v1.2.1