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:
@@ -111,40 +111,6 @@ typedef uchar nhsym;
|
||||
|
||||
#include "coord.h"
|
||||
|
||||
#if defined(CROSSCOMPILE)
|
||||
struct cross_target_s {
|
||||
const char *build_date;
|
||||
const char *copyright_banner_c;
|
||||
const char *git_sha;
|
||||
const char *git_branch;
|
||||
const char *version_string;
|
||||
const char *version_id;
|
||||
unsigned long version_number;
|
||||
unsigned long version_features;
|
||||
unsigned long ignored_features;
|
||||
unsigned long version_sanity1;
|
||||
unsigned long version_sanity2;
|
||||
unsigned long version_sanity3;
|
||||
unsigned long build_time;
|
||||
};
|
||||
extern struct cross_target_s cross_target;
|
||||
#if defined(CROSSCOMPILE_TARGET) && !defined(MAKEDEFS_C)
|
||||
#define BUILD_DATE cross_target.build_date /* "Wed Apr 1 00:00:01 2020" */
|
||||
#define COPYRIGHT_BANNER_C cross_target.copyright_banner_c
|
||||
#define NETHACK_GIT_SHA cross_target.git_sha
|
||||
#define NETHACK_GIT_BRANCH cross_target.git_branch
|
||||
#define VERSION_ID cross_target.version_id
|
||||
#define IGNORED_FEATURES cross_target.ignored_features
|
||||
#define VERSION_FEATURES cross_target.version_features
|
||||
#define VERSION_NUMBER cross_target.version_number
|
||||
#define VERSION_SANITY1 cross_target.version_sanity1
|
||||
#define VERSION_SANITY2 cross_target.version_sanity2
|
||||
#define VERSION_SANITY3 cross_target.version_sanity3
|
||||
#define VERSION_STRING cross_target.version_string
|
||||
#define BUILD_TIME cross_target.build_time /* (1574157640UL) */
|
||||
#endif /* CROSSCOMPILE_TARGET && !MAKEDEFS_C */
|
||||
#endif /* CROSSCOMPILE */
|
||||
|
||||
/*
|
||||
* Automatic inclusions for the subsidiary files.
|
||||
* Please don't change the order. It does matter.
|
||||
@@ -356,6 +322,26 @@ struct savefile_info {
|
||||
#define SFI1_ZEROCOMP (1L << 2)
|
||||
#endif
|
||||
|
||||
/* This is used to store some build-info data that used
|
||||
to be present in makedefs-generated header file date.h */
|
||||
|
||||
struct nomakedefs_s {
|
||||
const char *build_date;
|
||||
const char *copyright_banner_c;
|
||||
const char *git_sha;
|
||||
const char *git_branch;
|
||||
const char *version_string;
|
||||
const char *version_id;
|
||||
unsigned long version_number;
|
||||
unsigned long version_features;
|
||||
unsigned long ignored_features;
|
||||
unsigned long version_sanity1;
|
||||
unsigned long version_sanity2;
|
||||
unsigned long version_sanity3;
|
||||
unsigned long build_time;
|
||||
};
|
||||
extern struct nomakedefs_s nomakedefs;
|
||||
|
||||
/*
|
||||
* Configurable internal parameters.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user