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

View File

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

View File

@@ -48,8 +48,11 @@ while true; do
done done
if [ $# -lt 1 ] || $help; then 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' cat << 'EOF'
MSC - Mercury SICStus Compiler. Name: msc - Mercury SICStus Compiler.
Compiles Mercury programs to SICStus Prolog object code (*.ql). Compiles Mercury programs to SICStus Prolog object code (*.ql).
Usage: msc [<options>] file(s) Usage: msc [<options>] file(s)
Options: Options: