diff options
author | Ian Lynagh <igloo@earth.li> | 2009-12-31 15:50:04 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2009-12-31 15:50:04 +0000 |
commit | a74ef5d0b9a5a8db3fe98fb0d671b35970cdc05c (patch) | |
tree | 0c5c7d2d19435a83f6c6d036655f22cf58019b74 | |
parent | 479b0241032c8b02999e0852f63d57fe3584edf9 (diff) | |
download | haskell-a74ef5d0b9a5a8db3fe98fb0d671b35970cdc05c.tar.gz |
Use a shell script, rather than perl script, to make flags.xsl
-rw-r--r-- | docs/man/gen_flags.xsl.sh (renamed from docs/man/gen_flags.xsl.pl) | 45 | ||||
-rw-r--r-- | docs/man/ghc.mk | 4 |
2 files changed, 27 insertions, 22 deletions
diff --git a/docs/man/gen_flags.xsl.pl b/docs/man/gen_flags.xsl.sh index a331792f0d..28627ea5df 100644 --- a/docs/man/gen_flags.xsl.pl +++ b/docs/man/gen_flags.xsl.sh @@ -1,15 +1,15 @@ -#!/usr/bin/perl -w +#!/bin/sh -use strict; +if [ "$#" -ne 2 ] +then + echo "Usage: $0 <ghc commands> <libdir>" + exit 1 +fi -if ($#ARGV ne 1) { - die "Usage: $0 <ghc commands> <libdir>\n" -} +GHC_COMMANDS="$1" +LIBDIR="$2" -my @ghc_commands = split / /, $ARGV[0]; -my $libdir = $ARGV[1]; - -print <<'EOF'; +cat <<'EOF' <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE xsl:stylesheet [ ]> @@ -31,18 +31,22 @@ 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 +STARTED=0 + +for GHC_COMMAND in $GHC_COMMANDS +do + if [ "$STARTED" -ne 0 ] + then + echo ".br" + fi + STARTED=1 + cat <<EOF +.B $GHC_COMMAND .RI [ option | filename ]... EOF -} +done -print <<'EOF'; +cat <<'EOF' .SH DESCRIPTION This manual page documents briefly the @@ -107,8 +111,9 @@ interface files .SH FILES EOF -print ".I $libdir"; -print <<'EOF'; + +echo ".I $LIBDIR" +cat <<'EOF' .SH COPYRIGHT 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. |