Add Unix-style man pages for most of the Mercury development tools.

scripts/c2init.in:
scripts/mmake.in:
scripts/msc.in:
	Small changes to the help messages to make them come out
	better when converted to man pages.

scripts/mgnuc.in:
	Add a `--help' option.
This commit is contained in:
Fergus Henderson
1997-02-07 14:17:41 +00:00
parent cb5b100205
commit 8ce103cc76
4 changed files with 108 additions and 82 deletions

View File

@@ -11,23 +11,28 @@
# This script outputs an appropriate init.c, given the .c files.
# Type `c2init --help' for usage message.
#
# Environment variables: MERCURY_MOD_LIB_DIR, MERCURY_MOD_LIB_MODS,
# MERCURY_MKINIT.
Usage="\
Usage: c2init [options] modules ...
# IMPORTANT: the manpage is produced automatically from this help
# message, so if you change the help message, don't forget to check
# that the manpage still looks OK.
Help="\
Name: c2init - Create Mercury initialization file.
Usage: c2init [options] modules ...
Options:
-l, --library
Don't generate a \`main()' function.
Instead, generate a function
mercury_main(int argc, char **argv, char *stack_bottom);
(declared in \"init.h\") that can be called from C code.
-c <n>, --max-calls <n>
Break up the initialization into groups of at most <n> function calls.
(Default value of <n> is 40.)
-w <label>, --entry-point <label>
Set entry point to <label>.
(Default value is \`mercury__io__run_0_0'.)"
-l, --library
Don't generate a \`main()' function.
Instead, generate a function
mercury_main(int argc, char **argv, char *stack_bottom);
(declared in \"init.h\") that can be called from C code.
-c <n>, --max-calls <n>
Break up the initialization into groups of at most <n> function
calls. (Default value of <n> is 40.)
-w <label>, --entry-point <label>
Set entry point to <label>.
(Default value is \`mercury__io__run_0_0'.)
Environment variables:
MERCURY_MOD_LIB_DIR, MERCURY_MOD_LIB_MODS, MERCURY_MKINIT.
"
MERCURY_MOD_LIB_DIR=${MERCURY_MOD_LIB_DIR=@LIBDIR@/modules}
MERCURY_MOD_LIB_MODS=${MERCURY_MOD_LIB_MODS=$MERCURY_MOD_LIB_DIR/*}
@@ -48,12 +53,13 @@ while true; do
-l-|--no-library)
library_opt=""; shift;;
-h|--help|"-?")
echo "$Usage"
echo "$Help"
exit 0;;
--)
shift; break;;
-*)
echo "$Usage" 1>&2;
echo "`basename $0`: invalid option \`$1'" 1>&2;
echo "Try \`$0 --help' for help." 1>&2;
exit 1;;
*)
break;;

View File

@@ -6,36 +6,32 @@
# Public License - see the file COPYING in the Mercury distribution.
#---------------------------------------------------------------------------#
#
# MGNUC - Mercury GNU C
#
# Usage: mgnuc [<options>] [-- <gcc options>] files...
# Options:
# -v, --verbose
# Echo gcc command before executing it.
# --no-ansi
# Don't pass -ansi.
# --no-check
# Don't pass any of the -W options.
# -s <grade>, --grade <grade>
# Select optimization/debug/gc options according to <grade>, which
# must be one of debug, none, jump, asm_jump, reg, fast, or asm_fast,
# or one of those with .gc appended.
#
# This runs gcc with all warnings enabled, except for the following
# exceptions:
#
# -Wredundant-decls causes too many complaints in system header files
# -Wconversion really only intended to help people using `unprotoize'
# -Waggregate-return not useful, IMHO
#
# -Wcast-align causes redundant warnings in memory.c
# -pedantic causes unsuppressable warnings about LVALUE_CAST()
# -Wnested-externs causes unsuppressable warnings about callentry()
# -Wid-clash-31 causes warnings about entry_mercury__xxx ...
# -Wenum-clash is for C++ only
# -Wunused causes various spurious warnings
#
# Environment variables: MERCURY_C_INCL_DIR, MERCURY_DEFAULT_GRADE.
# IMPORTANT: the manpage is produced automatically from this help
# message, so if you change the help message, don't forget to check
# that the manpage still looks OK.
Help="\
Name: mgnuc - Mercury front-end to GNU C
Usage: mgnuc [<options>] [-- <gcc options>] files...
Options:
-s <grade>, --grade <grade>
Select optimization/debug/gc options according to <grade>,
which must be one of debug, none, jump, asm_jump, reg, fast,
or asm_fast, or one of those with .gc and/or .prof appended.
-v, --verbose
Echo gcc command before executing it.
--no-ansi
Don't pass \`-ansi' to gcc.
--no-check
Don't enable any of gcc's warnings.
Description:
This runs gcc with the appropriate options for compiling Mercury
programs in the specified grade.
Normally it invokes gcc in ANSI mode with almost all warnings enabled,
but this can be changed using the \`--no-ansi' or \`--no-check'
options.
Environment variables:
MERCURY_C_INCL_DIR, MERCURY_DEFAULT_GRADE.
"
# *************************************************************************
# *** IMPORTANT NOTE: any changes to this file may also require similar ***
@@ -59,6 +55,19 @@ case "$CC" in
CHECK_OPTS="
-Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wtraditional
-Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wno-unused"
# Note: we do not enable the following gcc warnings:
# -Wredundant-decls causes too many complaints in system header files
# -Wconversion really only intended to help people using \`unprotoize'
# -Waggregate-return not useful, IMHO
# -Wcast-align causes redundant warnings in memory.c
# -pedantic causes unsuppressable warnings about LVALUE_CAST()
# -Wnested-externs causes unsuppressable warnings about callentry()
# -Wid-clash-31 causes warnings about entry_mercury__xxx ...
# -Wenum-clash is for C++ only
# -Wunused causes various spurious warnings
OPT_OPTS="-O2 -fomit-frame-pointer -DSPEED"
COMPILER=gcc
;;
@@ -86,6 +95,10 @@ assemble=false
while : ; do
case "$1" in
-h|--help|"-?")
echo "$Help"
exit 0
;;
--assemble)
assemble=true
shift

View File

@@ -12,6 +12,42 @@
#
#-----------------------------------------------------------------------------#
# IMPORTANT: the manpage is produced automatically from this help
# message, so if you change the help message, don't forget to check
# that the manpage still looks OK.
Help="\
Name: mmake -- Mercury Make
Usage: mmake [<mmake options>] [-- <make options>] <target>...
Options:
-s, --save-makefile:
Save the generated makefile to \`Mmake.makefile'.
-v, --verbose:
Print verbose progress messages.
-h, --help:
Print this usage message.
Targets:
<module>.depend:
Make the file \`<module>.dep'. This step is required
in preparation for the targets below.
<module>:
Compile and link a Mercury program with main module
\`<module>.m' to produce an executable.
<module>.nu:
Compile and link a Mercury program with NU-Prolog
rather than with the Mercury compiler.
<module>.sicstus:
Compile and link a Mercury program with SICStus Prolog
rather than with the Mercury compiler.
<module>.nu.debug:
<module>.sicstus.debug:
Debugging versions of the above.
clean:
Remove intermediate files.
realclean:
Remove all automatically-generated files: intermediate files,
dependency files, and executables.
"
MMAKE_MAKE=${MMAKE_MAKE=@GNU_MAKE@}
MMAKE_DIR=${MMAKE_DIR=@LIBDIR@/mmake}
MMAKE_VARS=${MMAKE_VARS=$MMAKE_DIR/Mmake.vars}
@@ -26,40 +62,8 @@ save_makefile=false
while [ $# -gt 0 ]; do
case $1 in
-h|--help)
#-----------------------------------------------------------------------------#
cat << 'EOF'
Usage: mmake [<mmake options>] [-- <make options>] <target>...
Options:
-s, --save-makefile:
Save the generated makefile to `Mmake.makefile'.
-v, --verbose:
Print verbose progress messages.
-h, --help:
Print this usage message.
Targets:
<module>.depend:
Make the file `<module>.dep'. This step is required
in preparation for the targets below.
<module>:
Compile and link a Mercury program with main module
`<module>.m' to produce an executable.
<module>.nu:
Compile and link a Mercury program with NU-Prolog
rather than with the Mercury compiler.
<module>.sicstus:
Compile and link a Mercury program with SICStus Prolog
rather than with the Mercury compiler.
<module>.nu.debug:
<module>.sicstus.debug:
Debugging versions of the above.
clean:
Remove intermediate files.
realclean:
Remove all automatically-generated files: intermediate files,
dependency files, and executables.
EOF
#-----------------------------------------------------------------------------#
exit
echo "$Help"
exit 0
;;
-s|--save-makefile)
save_makefile=true

View File

@@ -48,8 +48,11 @@ while true; do
done
if [ $# -lt 1 ] || $help; then
# IMPORTANT: the manpage is produced automatically from this help
# message, so if you change the help message, don't forget to check
# that the manpage still looks OK.
cat << 'EOF'
MSC - Mercury SICStus Compiler.
Name: msc - Mercury SICStus Compiler.
Compiles Mercury programs to SICStus Prolog object code (*.ql).
Usage: msc [<options>] file(s)
Options: