compile NetHack-3.7 without makedefs-generated .h files
This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:
date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.
pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.
onames.h dependency and its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.
artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.
makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.
The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
makedefs -d (database)
makedefs -r (rumors)
makedefs -h (oracles)
makedefs -s (epitaphs, engravings, bogusmons)
date.c
Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)
nethack --dumpenums (optional, but on by default)
Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.
Uncomment #define NODUMPENUMS in config.h to disable this.
The updates to sys/windows/Makefile.gcc have not been tested yet.
This commit is contained in:
@@ -124,13 +124,10 @@ steps to be carried out:
|
||||
|
||||
1. Compile and link util/makedefs.
|
||||
2. Run makedefs repeatedly with different command line options to produce
|
||||
several output files that are required for:
|
||||
(a) additional build steps to follow, including some header
|
||||
files: pm.h, onames.h, date.h.
|
||||
(b) creation of files, containing information required by,
|
||||
or about the game during its execution, that are stored in a
|
||||
portable, platform-independent way, that need to be inserted
|
||||
into the game package.
|
||||
several required output files that contain information required by the
|
||||
game, or contain information about the game during its execution, that
|
||||
are stored in a portable, platform-independent way, that need to be
|
||||
inserted into the game package (makedefs -d, -z, -r, -h, -s).
|
||||
3. Compile and link several less critical utilities such as uudecode,
|
||||
tile-generation utilities, and so forth, all of which need to execute
|
||||
on the build platform during the build process to produce output files
|
||||
@@ -261,14 +258,18 @@ On the HOST, here are the mandatory things that have to be built.
|
||||
from sources: util/makedefs.c, src/mdlib.c, src/monst.c, src/objects.c
|
||||
|
||||
b) Execute HOST native makedefs utility, util/makedefs, as follows:
|
||||
util/makedefs -v
|
||||
util/makedefs -o
|
||||
util/makedefs -p
|
||||
util/makedefs -z
|
||||
util/makedefs -d
|
||||
util/makedefs -r
|
||||
util/makedefs -h
|
||||
util/makedefs -s
|
||||
Required for complete packaging of the game, but not the C source
|
||||
game compile:
|
||||
util/makedefs -d
|
||||
util/makedefs -r
|
||||
util/makedefs -h
|
||||
util/makedefs -s
|
||||
|
||||
For reference purposes, but no longer a required prerequisite for the
|
||||
game compile process:
|
||||
util/makedefs -v
|
||||
util/makedefs -o
|
||||
util/makedefs -p
|
||||
|
||||
c) Using the HOST native compiler, build these additional utilities if your
|
||||
target platform requires components that they produce. It is important
|
||||
|
||||
Reference in New Issue
Block a user