MAKEDEFS(6)

๐Ÿ“ฆ
version 5.0.0 ยท 2 versions
, in arch rolling

๐Ÿ› ๏ธ MAKEDEFS ๐Ÿ’… (section 6, Games Manual)

okay bestie, gather round, because this one is a build-time legend and honestly it's giving backstage-pass energy ๐ŸŽŸ๏ธโœจ

๐Ÿ’– NAME

makedefs โ€” the NetHack miscellaneous build-time functions, no cap ๐Ÿงฐ


โœจ SYNOPSIS

makedefs { -o | -d | -e | -m | -v | -p | -q | -r | -h }

makedefs --input file --output file --command

๐ŸŒธ DESCRIPTION

makedefs is a build-time tool, and it's literally the behind-the-scenes main character for a whole bunch of NetHack(6) source file creation and modification tasks ๐Ÿซถ

For historical reasons (iykyk ๐Ÿ˜ญ), makedefs takes two types of command lines:

  • when you invoke it with a short option, the files it operates on are determined when makedefs is compiled ๐Ÿ“ฆ
  • when you invoke it with a long option, --input and --output are what specify the files for the --command ๐ŸŽฏ

and here's the tea: each command is only available in one of the two formats. not both. pick your lane ๐Ÿšฆ


๐ŸŽ€ SHORT COMMANDS

Upper and lower case are both accepted for the short commands, so go off however you like โœจ

  • -o โ€” generate onames.h ๐Ÿ’–
  • -d โ€” generate data.base ๐Ÿ“
  • -e โ€” generate dungeon.pdf. the input file dungeon.def gets passed through the same logic as the --grep command uses; peep the MDGREP FUNCTIONS section below for the details ๐Ÿ‘€
  • -m โ€” generate date.h and the options file. it will read dat/gitinfo.txt, only if it is present, to obtain githash= and gitbranch= info and include the related preprocessor #defines in the 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 oracles file ๐Ÿ”ฎ

๐Ÿ’… LONG COMMANDS

  • --debug โ€” show debugging output ๐Ÿ›
  • --make [command] โ€” execute a short command. the command is given without a preceding dash, mkay ๐Ÿšซ
  • --input file โ€” specify the input file for the command (if needed). if the file is -, standard input is read ๐Ÿ“ฅ
  • --output file โ€” 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 info 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 (--grep must be specified as well, don't forget bestie) ๐Ÿ•ต๏ธ
  • --grep-defined symbol โ€” exit shell true (0) if symbol is known and defined, otherwise exit shell false (1) โœ…
  • --grep-define symbol โ€” force the value of symbol to be "defined." symbol must already be known to makedefs ๐ŸŒŸ
  • --grep-undef symbol โ€” force the definition of symbol to be "undefined." symbol must already be known to makedefs ๐ŸŒ‘

๐Ÿฆ‹ MDGREP FUNCTIONS

the --grep command (and certain other commands) filters their input, line by line, according to control lines embedded in the input and on information gleaned from the NetHack(6) configuration ๐Ÿงš

this is how you get cute little things like platform-specific documentation embedded 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 --undef or #undef in 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 ๐Ÿ
lowkey important: those unknown-identifier rules are not the same as --undef or #undef, so don't conflate them or you will be confused and sad ๐Ÿ˜ญ

๐Ÿ‘‘ AUTHOR

The NetHack Development Team ๐Ÿ’œ


This file is Copyright (C) Kenneth Lorber, 2024 for version NetHack-5:1.22. NetHack may be freely redistributed. See license for details. ๐Ÿ“œ


and that's the whole page, bestie!! ๐ŸŽ€ one last little sign-off: this one's from the NETHACK corner of the world, dated 26 April 2026, and it lives in section 6 of the Games Manual โ€” so if you ever need to find it again, that's where she'll be, slaying as always ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from