makedefs6
Nethack miscellaneous build-time functions
Usage
makedefs {-o | -d | -e | -m | -v | -p | -q | -r | -h}
makedefs --input
file
--output
file
--command
Overview
Makedefs is a build-time tool used for a variety of NetHack(6) source file creation and modification tasks. For historical reasons, makedefs takes two types of command lines. When invoked with a short option, the files operated on are determined when makedefs is compiled. When invoked with a long option, the --input and --output options are used to specify the files for the --command. Each command is only available in one of the two formats.
Short commands
Upper and lower case are both accepted for the short commands.
-o-
Generate onames.h.
-d-
Generate data.base.
-e-
Generate dungeon.pdf. The input file dungeon.def is passed through the same logic as that used by the
--grepcommand; see the MDGREP FUNCTIONS section below for details.
-m-
Generate date.h and options file. It will read dat/gitinfo.txt, only if it is present, to obtain
githash=andgitbranch=info and include related preprocessor #defines in date.h file.
-p-
Generate pm.h
-q-
Generate the rumors file.
-s-
Generate the bogusmon, engrave, and epitaph files.
-1-
Generate the epitaph file.
-2-
Generate the engrave file.
-3-
Generate the bogusmon file.
-h-
Generate the
oraclesfile.
Long commands
--debug-
Show debugging output.
- --make [command]
-
Execute a short command. Command is given without preceding dash.
--inputfile-
Specify the input file for the command (if needed). If the file is - standard input is read.
--outputfile-
Specify the output file for the command (if needed). If the file is - standard output is written.
- --svs [delimiter]
-
Generate a version string to standard output without a trailing newline. If specified, the delimiter is used between each part of the version string.
--grep-
Filter the input file to the output file. See the MDGREP FUNCTIONS section below for information on controlling the filtering operation.
--grep-showvars-
Show the name and value for each variable known to the grep option.
--grep-trace-
Turn on debug tracing for the grep function (
--grepmust be specified as well).
--grep-definedsymbol-
Exit shell true (0) if symbol is known and defined, otherwise exit shell false (1).
--grep-definesymbol-
Force the value of symbol to be "defined." Symbol must already be known to
makedefs.
--grep-undefsymbol-
Force the definition of symbol to be "undefined." Symbol must already be known to
makedefs.
Mdgrep functions
The --grep command (and certain other commands) filter their input, on a line-by-line basis, according to control lines embedded in the input and on information gleaned from the NetHack(6) configuration. This allows certain changes such as embedding platform-specific documentation into the master documentation files.
Rules:
- -
-
The default conditional state is printing enabled.
- -
-
Any line NOT starting with a caret (^) is either suppressed or passed through unchanged depending on the current conditional state.
- -
-
Any line starting with a caret is a control line; as in C, zero or more spaces may be embedded in the line almost anywhere (except immediately after the caret); however the caret must be in column 1.
- -
-
Conditionals may be nested.
- -
-
Makedefs will exit with an error code if any errors are detected; processing will continue (if it can) to allow as many errors as possible to be detected.
- -
-
Unknown identifiers are treated as both TRUE and as an error. Note that
--undefor#undefin the NetHack(6) configuration are different from unknown.
Control lines:
^^
|
a line starting with a (single) literal caret |
|---|---|
^#
|
a comment |
^?ID
|
if the ID is defined set the conditional state to TRUE |
^!ID
|
if the ID is not defined set the conditional state to TRUE |
^:
|
else; invert the conditional state |
^.
|
end the most recent conditional |