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:
nhmall
2021-08-17 14:43:29 -04:00
parent 61b6bab292
commit 9bb96322a8
50 changed files with 5745 additions and 4936 deletions

View File

@@ -383,7 +383,7 @@ RM_H = $(INCL)/align.h $(INCL)/rm.h
SKILLS_H = $(INCL)/skills.h
SP_LEV_H = $(INCL)/align.h $(INCL)/sp_lev.h
YOUPROP_H = $(PERMONST_H) $(MONDATA_H) $(INCL)/prop.h \
$(INCL)/pm.h $(INCL)/youprop.h
$(INCL)/youprop.h
YOU_H = $(MONST_H) $(YOUPROP_H) $(INCL)/align.h \
$(INCL)/attrib.h $(INCL)/you.h
DISPLAY_H = $(MONDATA_H) $(INCL)/vision.h $(INCL)/display.h
@@ -392,7 +392,7 @@ PCCONF_H = $(INCL)/micro.h $(INCL)/system.h $(INCL)/pcconf.h \
CONFIG_H = $(GLOBAL_H) $(INCL)/fnamesiz.h $(INCL)/tradstdc.h \
$(INCL)/config1.h $(INCL)/config.h
DECL_H = $(YOU_H) $(INCL)/spell.h $(INCL)/color.h \
$(INCL)/obj.h $(INCL)/onames.h $(INCL)/pm.h \
$(INCL)/obj.h $(INCL)/objects.h \
$(INCL)/decl.h
GLOBAL_H = $(PCCONF_H) $(INCL)/coord.h $(INCL)/global.h
HACK_H = $(CONFIG_H) $(INCL)/context.h $(DUNGEON_H) \
@@ -547,8 +547,8 @@ default: $(GAMEFILE)
util: $(O)utility.tag
$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/onames.h \
$(INCL)/pm.h $(TILEUTIL)
$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h $(INCL)/objects.h \
$(TILEUTIL)
$(subst /,\,echo utilities made > $@)
tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe

View File

@@ -50,8 +50,8 @@ the file NewInstall.unx.
6. Edit the top sections of the src and util Makefiles. (If you are doing
a full recompile, or if you got your files from someplace besides the
official distribution, type 'touch makedefs.c' to make sure certain files
(onames.h, pm.h) get remade instead of relying on the potentially
troublesome timestamps.) Then type 'make' in src and go get a cup of
get remade instead of relying on the potentially troublesome timestamps.)
Then type 'make' in src and go get a cup of
coffee or take a nap, depending on the speed of your system. You should
now have created the game executable.

View File

@@ -464,7 +464,7 @@ CONFIG_H = ../src/config.h-t
HACK_H = ../src/hack.h-t
# all .c that are part of the main NetHack program and are not operating- or
# windowing-system specific
# windowing-system specific. Do not include date.c in this list.
HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
botl.c cmd.c dbridge.c decl.c detect.c dig.c display.c dlb.c do.c \
do_name.c do_wear.c dog.c dogmove.c dokick.c dothrow.c drawing.c \
@@ -514,7 +514,7 @@ VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(CHAINSRC) $(GENCSRC)
CSOURCES = $(HACKCSRC) $(SYSCSRC) $(WINCSRC) $(CHAINSRC) $(GENCSRC)
# all .h files except date.h, onames.h, and pm.h which would
# all .h files except date.h, which would
# cause dependency loops if run through "make depend"
# and dgn_file.h, special level & dungeon files.
#
@@ -522,19 +522,22 @@ HACKINCL = align.h artifact.h artilist.h attrib.h botl.h \
color.h config.h config1.h context.h coord.h decl.h \
display.h dlb.h dungeon.h engrave.h extern.h flag.h fnamesiz.h \
func_tab.h global.h warnings.h hack.h lint.h mextra.h mfndpos.h \
micro.h mkroom.h \
monattk.h mondata.h monflag.h monst.h obj.h objclass.h \
optlist.h patchlevel.h pcconf.h permonst.h prop.h rect.h \
region.h sym.h defsym.h rm.h sp_lev.h spell.h sys.h system.h \
tcap.h timeout.h tradstdc.h trap.h unixconf.h vision.h vmsconf.h \
wintty.h wincurs.h winX.h winprocs.h wintype.h you.h youprop.h
micro.h mkroom.h monattk.h mondata.h monflag.h monst.h monsters.h \
obj.h objects.h objclass.h optlist.h patchlevel.h pcconf.h \
permonst.h prop.h rect.h region.h sym.h defsym.h rm.h sp_lev.h \
spell.h sys.h system.h tcap.h timeout.h tradstdc.h trap.h unixconf.h \
vision.h vmsconf.h wintty.h wincurs.h winX.h winprocs.h wintype.h \
you.h youprop.h
HSOURCES = $(HACKINCL) date.h onames.h pm.h dgn_file.h
HSOURCES = $(HACKINCL) dgn_file.h
# the following .o's _must_ be made before any others (for makedefs)
FIRSTOBJ = monst.o objects.o
HOSTOBJ = $(FIRSTOBJ) alloc.o drawing.o
#
# $(TARGETPFX)date.o is not included in this list
#
HOBJ = $(TARGETPFX)allmain.o $(TARGETPFX)alloc.o \
$(TARGETPFX)apply.o $(TARGETPFX)artifact.o $(TARGETPFX)attrib.o \
$(TARGETPFX)ball.o $(TARGETPFX)bones.o $(TARGETPFX)botl.o \
@@ -576,6 +579,9 @@ HOBJ = $(TARGETPFX)allmain.o $(TARGETPFX)alloc.o \
$(TARGETPFX)write.o $(TARGETPFX)zap.o \
$(REGEXOBJ) $(RANDOBJ) $(SYSOBJ) $(WINOBJ) $(HINTOBJ) \
$(TARGETPFX)version.o
#
DATE_O = $(TARGETPFX)date.o
# the .o files from the HACKCSRC, SYSSRC, and WINSRC lists
# first target is also the default target for 'make' without any arguments
@@ -588,40 +594,40 @@ pregame:
$(GAME): pregame $(SYSTEM)
@echo "$(GAME) is up to date."
Sysunix: $(HOSTOBJ) $(HOBJ) $(BUILDMORE) Makefile
Sysunix: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Linking $(GAME)."
$(AT)$(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \
$(HOBJ) $(WINLIB) $(TARGET_LIBS) $(LUALIB)
$(HOBJ) $(DATE_O) $(WINLIB) $(TARGET_LIBS) $(LUALIB)
@touch Sysunix
Sys3B2: $(HOSTOBJ) $(HOBJ) $(BUILDMORE) Makefile
Sys3B2: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Linking $(GAME)."
$(AT)$(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \
$(HOBJ) $(WINLIB) $(LUALIB) -lmalloc
$(HOBJ) $(DATE_O) $(WINLIB) $(LUALIB) -lmalloc
@touch Sys3B2
Sysatt: $(HOSTOBJ) $(HOBJ) $(BUILDMORE) Makefile
Sysatt: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Loading $(GAME)."
$(AT)$(LD) $(TARGET_LFLAGS) /lib/crt0s.o /lib/shlib.ifile -o $(GAMEBIN) \
$(HOSTOBJ) $(HOBJ) $(LUALIB)
$(HOSTOBJ) $(HOBJ) $(DATE_O) $(LUALIB)
@touch Sysatt
Systos: $(HOSTOBJ) $(HOBJ) $(BUILDMORE) Makefile
Systos: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Linking $(GAME)."
$(AT)$(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \
$(HOBJ) $(WINLIB) $(LUALIB)
$(HOBJ) $(DATE_O) $(WINLIB) $(LUALIB)
@touch Systos
SysV-AT: DUMB.Setup $(HOSTOBJ) $(HOBJ) $(BUILDMORE) Makefile
SysV-AT: DUMB.Setup $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Linking $(GAME)."
$(AT)$(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAMEBIN) \
$(HOBJ) $(WINLIB) $(LUALIB)
$(HOBJ) $(DATE_O) $(WINLIB) $(LUALIB)
@touch SysV-AT
SysBe: $(HOSTOBJ) $(HOBJ) $(BUILDMORE) Makefile
SysBe: $(HOSTOBJ) $(HOBJ) $(DATE_O) $(BUILDMORE) Makefile
@echo "Linking $(GAME)."
$(AT)$(TARGET_LINK) $(TARGET_LFLAGS) -o $(GAME) \
$(HOBJ) $(WINLIB) $(TARGET_LIBS) $(LUALIB)
$(HOBJ) $(DATE_O) $(WINLIB) $(TARGET_LIBS) $(LUALIB)
@xres -o $(GAME) ../win/BeOS/nethack.rsrc
@mimeset -f $(GAME)
@touch SysBe
@@ -696,11 +702,12 @@ qt_yndlg.moc : ../win/Qt/qt_yndlg.h
# build monst.o and objects.o before executing '$(MAKE) makedefs'
$(MAKEDEFS): $(FIRSTOBJ) \
../util/makedefs.c ../src/mdlib.c $(CONFIG_H) \
../include/permonst.h \
../include/objclass.h ../include/sym.h ../include/defsym.h \
../include/artilist.h ../include/dungeon.h ../include/obj.h \
../include/monst.h ../include/you.h ../include/flag.h \
../include/dlb.h ../include/patchlevel.h
../include/permonst.h ../include/monsters.h \
../include/objclass.h ../include/objects.h ../include/sym.h \
../include/defsym.h ../include/artilist.h \
../include/dungeon.h ../include/obj.h ../include/monst.h \
../include/you.h ../include/flag.h ../include/dlb.h \
../include/patchlevel.h
@( cd ../util ; $(MAKE) makedefs )
# Source files created by 'makedefs' at build time.
@@ -711,18 +718,24 @@ $(MAKEDEFS): $(FIRSTOBJ) \
# process of building it for foo.h.)
../include/onames.h: $(MAKEDEFS)
@( cd ../util ; $(MAKE) ../include/onames.h )
../include/pm.h: $(MAKEDEFS) ../include/onames.h
../include/pm.h: $(MAKEDEFS)
@( cd ../util ; $(MAKE) ../include/pm.h )
# Created at build time for configurations which support tiles,
# but not by makedefs so not connected to the others.
tile.c: ../win/share/tilemap.c $(HACK_H)
@( cd ../util ; $(MAKE) ../src/tile.c )
../win/gnome/gn_rip.h: ../win/X11/rip.xpm
cp ../win/X11/rip.xpm ../win/gnome/gn_rip.h
$(TARGETPFX)sfstruct.o: sfstruct.c $(HACK_H)
# date.c should be recompiled any time any of the source or include code
# is modified.
$(TARGETPFX)date.o: date.c $(HACK_H) $(HACKCSRC) $(HOBJ)
$(TARGET_CC) $(TARGET_CFLAGS) $(GITHASH) $(GITBRANCH) -c -o $@ date.c
# date.h should be remade any time any of the source or include code
# is modified. Unfortunately, this would make the contents of this
# file far more complex. Since "hack.h" depends on most of the include
@@ -731,9 +744,7 @@ $(TARGETPFX)sfstruct.o: sfstruct.c $(HACK_H)
# Do NOT include ../dat/gitinfo.txt as either a prerequisite or target.
# 'makedefs -v' processes it when present and ignores it if not.
#
# hack.h depends on makedefs' output, so we know makedefs will be
# up to date before being executed
../include/date.h: $(VERSOURCES) $(HACK_H)
../include/date.h: ../util/makedefs $(VERSOURCES) $(HACK_H)
-$(SHELL) ../sys/unix/gitinfo.sh $(GITINFO) #before 'makedefs -v'
../util/makedefs -v
@@ -800,14 +811,14 @@ $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \
../include/dungeon.h ../include/mkroom.h \
../include/objclass.h ../include/youprop.h ../include/prop.h \
../include/permonst.h ../include/monattk.h \
../include/monflag.h ../include/mondata.h ../include/pm.h \
../include/monflag.h ../include/mondata.h \
../include/wintype.h ../include/context.h \
../include/sym.h ../include/defsym.h ../include/rm.h \
../include/botl.h ../include/rect.h ../include/region.h \
../include/decl.h ../include/quest.h ../include/spell.h \
../include/color.h ../include/obj.h ../include/engrave.h \
../include/you.h ../include/attrib.h ../include/monst.h \
../include/mextra.h ../include/skills.h ../include/onames.h \
../include/mextra.h ../include/skills.h ../include/monsters.h \
../include/timeout.h ../include/trap.h ../include/flag.h \
../include/vision.h ../include/display.h ../include/winprocs.h \
../include/sys.h
@@ -1097,8 +1108,9 @@ $(TARGETPFX)mondata.o: mondata.c $(HACK_H)
$(TARGETPFX)monmove.o: monmove.c $(HACK_H) ../include/mfndpos.h \
../include/artifact.h
$(TARGETPFX)monst.o: monst.c $(CONFIG_H) ../include/permonst.h \
../include/align.h ../include/monattk.h ../include/monflag.h \
../include/sym.h ../include/defsym.h ../include/color.h
../include/monsters.h ../include/align.h ../include/monattk.h \
../include/monflag.h ../include/sym.h ../include/defsym.h \
../include/color.h
$(TARGETPFX)mplayer.o: mplayer.c $(HACK_H)
$(TARGETPFX)mthrowu.o: mthrowu.c $(HACK_H)
$(TARGETPFX)muse.o: muse.c $(HACK_H)

View File

@@ -179,7 +179,7 @@ CALLOC = ../src/alloc.c panic.c
OALLOC = $(OBJDIR)/alloc.o panic.o
# object files for makedefs
MAKEOBJS = makedefs.o $(OMONOBJ)
MAKEOBJS = makedefs.o $(OMONOBJ) $(OBJDIR)/date.o
# object files for recovery utility
RECOVOBJS = recover.o
@@ -209,17 +209,19 @@ makedefs: $(MAKEOBJS) mdgrep.h
makedefs.o: makedefs.c ../src/mdlib.c $(CONFIG_H) ../include/permonst.h \
../include/objclass.h ../include/sym.h ../include/defsym.h \
../include/artilist.h ../include/dungeon.h ../include/obj.h \
../include/monst.h ../include/you.h ../include/flag.h \
../include/dlb.h ../include/patchlevel.h
../include/monst.h ../include/monsters.h ../include/objects.h \
../include/you.h ../include/flag.h ../include/dlb.h \
../include/patchlevel.h
$(CC) $(CFLAGS) -c makedefs.c -o $@
# Don't require perl to build; that is why mdgrep.h is spelled wrong below.
mdgreph: mdgrep.pl
perl mdgrep.pl
../include/onames.h: makedefs
# These are for reference purposes only. They aren't required in the build.
../include/onames.h: makedefs ../include/objects.h
./makedefs -o
../include/pm.h: makedefs
../include/pm.h: makedefs ../include/monsters.h
./makedefs -p
lintdefs:

View File

@@ -239,7 +239,6 @@
3186A37421A4B0FA0052BF02 /* attrib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = attrib.h; path = ../../include/attrib.h; sourceTree = "<group>"; };
3186A37521A4B0FA0052BF02 /* patchlevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = patchlevel.h; path = ../../include/patchlevel.h; sourceTree = "<group>"; };
3186A37621A4B0FA0052BF02 /* wincurs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wincurs.h; path = ../../include/wincurs.h; sourceTree = "<group>"; };
3186A37721A4B0FA0052BF02 /* pm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pm.h; path = ../../include/pm.h; sourceTree = "<group>"; };
3186A37921A4B0FA0052BF02 /* monattk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = monattk.h; path = ../../include/monattk.h; sourceTree = "<group>"; };
3186A37A21A4B0FA0052BF02 /* integer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = integer.h; path = ../../include/integer.h; sourceTree = "<group>"; };
3186A37B21A4B0FA0052BF02 /* region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = region.h; path = ../../include/region.h; sourceTree = "<group>"; };
@@ -254,7 +253,6 @@
3186A38721A4B0FB0052BF02 /* color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = color.h; path = ../../include/color.h; sourceTree = "<group>"; };
3186A38821A4B0FB0052BF02 /* artifact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = artifact.h; path = ../../include/artifact.h; sourceTree = "<group>"; };
3186A38A21A4B0FB0052BF02 /* system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = system.h; path = ../../include/system.h; sourceTree = "<group>"; };
3186A38B21A4B0FC0052BF02 /* onames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = onames.h; path = ../../include/onames.h; sourceTree = "<group>"; };
3186A38E21A4B0FC0052BF02 /* dlb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dlb.h; path = ../../include/dlb.h; sourceTree = "<group>"; };
3186A38F21A4B0FC0052BF02 /* monflag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = monflag.h; path = ../../include/monflag.h; sourceTree = "<group>"; };
3186A39121A4B0FC0052BF02 /* micro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = micro.h; path = ../../include/micro.h; sourceTree = "<group>"; };
@@ -687,11 +685,9 @@
3186A39B21A4B0FD0052BF02 /* windconf.h */,
3186A39521A4B0FC0052BF02 /* obj.h */,
3186A3A821A4B0FD0052BF02 /* objclass.h */,
3186A38B21A4B0FC0052BF02 /* onames.h */,
3186A37521A4B0FA0052BF02 /* patchlevel.h */,
3186A38121A4B0FB0052BF02 /* pcconf.h */,
3186A38321A4B0FB0052BF02 /* permonst.h */,
3186A37721A4B0FA0052BF02 /* pm.h */,
3186A37F21A4B0FA0052BF02 /* prop.h */,
3186A39E21A4B0FD0052BF02 /* quest.h */,
3186A37C21A4B0FA0052BF02 /* rect.h */,

View File

@@ -139,6 +139,16 @@ WINOBJ = $(sort $(WINOBJ0))
# prevent duplicates in VARDATND if both X11 and Qt are being supported
VARDATND += $(sort $(VARDATND0))
GIT_HASH := $(shell echo `git rev-parse --verify HEAD` 2>&1)
GIT_BRANCH := $(shell echo `git rev-parse --abbrev-ref HEAD` 2>&1)
ifdef GIT_HASH
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
endif
ifdef GIT_BRANCH
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
endif
ifdef WANT_LIBNH
CFLAGS += -DSHIM_GRAPHICS -DNOTTYGRAPHICS -DNOSHELL -DLIBNH
LIBNHSYSSRC = ../sys/libnh/libnhmain.c \

View File

@@ -139,6 +139,16 @@ WINOBJ = $(sort $(WINOBJ0))
# prevent duplicates in VARDATND if both X11 and Qt are being supported
VARDATND += $(sort $(VARDATND0))
GIT_HASH := $(shell echo `git rev-parse --verify HEAD` 2>&1)
GIT_BRANCH := $(shell echo `git rev-parse --abbrev-ref HEAD` 2>&1)
ifdef GIT_HASH
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
endif
ifdef GIT_BRANCH
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
endif
ifdef WANT_LIBNH
CFLAGS += -DSHIM_GRAPHICS -DNOTTYGRAPHICS -DNOSHELL -DLIBNH
LIBNHSYSSRC = ../sys/libnh/libnhmain.c \

View File

@@ -112,6 +112,10 @@ main(int argc, char *argv[])
if (argcheck(argc, argv, ARG_VERSION) == 2)
exit(EXIT_SUCCESS);
#ifndef NODUMPENUMS
if (argcheck(argc, argv, ARG_DUMPENUMS) == 2)
exit(EXIT_SUCCESS);
#endif
if (argcheck(argc, argv, ARG_SHOWPATHS) == 2) {
#ifdef CHDIR
chdirx((char *) 0, 0);

View File

@@ -172,7 +172,7 @@ HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
# .c files for this version (for date.h)
VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(RANDSRC) $(GENCSRC)
# all .h files except date.h, onames.h, pm.h, which would
# all .h files except date.h which would
# cause dependency loops if run through "make depend"
#
HACKINCL = align.h artifact.h artilist.h attrib.h color.h \
@@ -386,7 +386,7 @@ spotless : clean
# config.h timestamp
$(CONFIG_H) : $(INC)config.h $(INC)config1.h $(INC)tradstdc.h $(INC)global.h \
$(INC)coord.h $(INC)vmsconf.h $(INC)system.h $(INC)unixconf.h \
$(INC)micro.h $(INC)pcconf.h $(INC)windconf.h
$(INC)micro.h $(INC)pcconf.h $(INC)windconf.h $(INC)objects.h
$(TOUCH) $(CONFIG_H)
# hack.h timestamp
$(HACK_H) : $(INC)hack.h $(CONFIG_H) $(INC)align.h \
@@ -398,7 +398,7 @@ $(HACK_H) : $(INC)hack.h $(CONFIG_H) $(INC)align.h \
$(INC)spell.h $(INC)color.h $(INC)obj.h \
$(INC)you.h $(INC)attrib.h $(INC)monst.h \
$(INC)mextra.h $(INC)skills.h \
$(INC)onames.h $(INC)timeout.h $(INC)trap.h \
$(INC)monsters.h $(INC)timeout.h $(INC)trap.h \
$(INC)flag.h $(INC)rm.h $(INC)vision.h \
$(INC)display.h $(INC)engrave.h $(INC)rect.h $(INC)region.h \
$(INC)winprocs.h $(INC)wintty.h $(INC)sys.h

View File

@@ -239,9 +239,9 @@ Setting Up
If you are recompiling after patching your sources, or if you got
your files from somewhere other than the official distribution,
"touch makedefs.c" to ensure that certain files (onames.h and pm.h)
are remade, lest potentially troublesome timestamps fool your make
(or nmake) utility.
"touch makedefs.c" to ensure that certain files are remade,
lest potentially troublesome timestamps fool your make (or nmake)
utility.
Compiling

View File

@@ -36,12 +36,13 @@
#
# There are currently 4 decisions that you can choose to make.
# None of the 4 decisions are absolutely required because defaults are in place:
# 1. Where do you want your build to end up?
# 2. Do you want debug information in the executable?
# 3. Do you want to explicitly override auto-detection of a 32-bit or 64-bit target?
# 4. Do you want to include any optional interfaces in the port?
# 4a) curses
# 4b) Qt
# 1. Do you have git commands in your path and NetHack in a git repository?
# 2. Where do you want your build results to end up?
# 3. Do you want debug information in the executable?
# 4. Do you want to explicitly override auto-detection of a 32-bit or 64-bit target?
# 5. Do you want to include any optional interfaces in the port?
# 5a) curses
# 5b) Qt
#
# Mandatory LUA source Location
#
@@ -277,11 +278,53 @@ O = $(OBJ)/
U = $(UTIL)/
HACKINCL = $(INCL)/align.h $(INCL)/artifact.h $(INCL)/artilist.h \
$(INCL)/attrib.h $(INCL)/botl.h $(INCL)/color.h $(INCL)/config.h \
$(INCL)/config1.h $(INCL)/context.h $(INCL)/coord.h $(INCL)/decl.h \
$(INCL)/display.h $(INCL)/dlb.h $(INCL)/dungeon.h $(INCL)/engrave.h \
$(INCL)/extern.h $(INCL)/flag.h $(INCL)/fnamesiz.h $(INCL)/func_tab.h \
$(INCL)/global.h $(INCL)/warnings.h $(INCL)/hack.h $(INCL)/lint.h \
$(INCL)/mextra.h $(INCL)/mfndpos.h $(INCL)/micro.h $(INCL)/mkroom.h \
$(INCL)/monattk.h $(INCL)/mondata.h $(INCL)/monflag.h $(INCL)/monst.h \
$(INCL)/monsters.h $(INCL)/obj.h $(INCL)/objects.h $(INCL)/objclass.h \
$(INCL)/optlist.h $(INCL)/patchlevel.h $(INCL)/pcconf.h \
$(INCL)/permonst.h $(INCL)/prop.h $(INCL)/rect.h $(INCL)/region.h \
$(INCL)/sym.h $(INCL)/defsym.h $(INCL)/rm.h $(INCL)/sp_lev.h \
$(INCL)/spell.h $(INCL)/sys.h $(INCL)/system.h $(INCL)/tcap.h \
$(INCL)/timeout.h $(INCL)/tradstdc.h $(INCL)/trap.h \
$(INCL)/unixconf.h $(INCL)/vision.h $(INCL)/vmsconf.h \
$(INCL)/wintty.h $(INCL)/wincurs.h $(INCL)/winX.h \
$(INCL)/winprocs.h $(INCL)/wintype.h $(INCL)/you.h \
$(INCL)/youprop.h
# all .c that are part of the main NetHack program and are not operating- or
# windowing-system specific
HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
botl.c cmd.c dbridge.c decl.c detect.c dig.c display.c dlb.c do.c \
do_name.c do_wear.c dog.c dogmove.c dokick.c dothrow.c drawing.c \
dungeon.c eat.c end.c engrave.c exper.c explode.c extralev.c \
files.c fountain.c hack.c hacklib.c \
insight.c invent.c isaac64.c light.c \
lock.c mail.c makemon.c mcastu.c mdlib.c mhitm.c \
mhitu.c minion.c mklev.c mkmap.c mkmaze.c mkobj.c mkroom.c mon.c \
mondata.c monmove.c monst.c mplayer.c mthrowu.c muse.c music.c \
nhlua.c nhlsel.c nhlobj.c o_init.c objects.c objnam.c \
options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \
priest.c quest.c questpgr.c read.c rect.c region.c restore.c \
rip.c rnd.c role.c rumors.c save.c sfstruct.c \
shk.c shknam.c sit.c sounds.c \
sp_lev.c spell.c steal.c steed.c symbols.c sys.c teleport.c \
timeout.c topten.c track.c trap.c u_init.c \
uhitm.c vault.c version.c vision.c weapon.c were.c wield.c \
windows.c wizard.c worm.c worn.c write.c zap.c
#
# Utility Objects.
#
MAKEDEFSOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o
MAKEDEFSOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o \
$(O)date.o
RECOVOBJS = $(O)recover.o
@@ -491,21 +534,31 @@ endif
# Header file macros
#==========================================
ifdef GIT_HASH
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
endif
ifdef GIT_BRANCH
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
endif
CONFIG_H = $(INCL)/config.h $(INCL)/patchlevel.h \
$(INCL)/config1.h $(INCL)/tradstdc.h \
$(INCL)/global.h $(INCL)/fnamesiz.h $(INCL)/coord.h \
$(INCL)/vmsconf.h $(INCL)/system.h $(INCL)/unixconf.h \
$(INCL)/micro.h $(INCL)/pcconf.h $(INCL)/windconf.h
$(INCL)/micro.h $(INCL)/pcconf.h $(INCL)/windconf.h \
$(INCL)/objects.h
HACK_H = $(INCL)/hack.h $(CONFIG_H) $(INCL)/align.h $(INCL)/context.h \
$(INCL)/dungeon.h $(INCL)/sym.h $(INCL)/defsym.h \
$(INCL)/mkroom.h $(INCL)/objclass.h $(INCL)/youprop.h \
$(INCL)/prop.h $(INCL)/permonst.h $(INCL)/monattk.h \
$(INCL)/monflag.h $(INCL)/mondata.h $(INCL)/pm.h \
$(INCL)/monflag.h $(INCL)/mondata.h $(INCL)/monsters.h \
$(INCL)/wintype.h $(INCL)/decl.h $(INCL)/quest.h \
$(INCL)/spell.h $(INCL)/color.h $(INCL)/obj.h \
$(INCL)/objects.h \
$(INCL)/you.h $(INCL)/attrib.h $(INCL)/monst.h $(INCL)/lint.h \
$(INCL)/mextra.h $(INCL)/skills.h $(INCL)/onames.h \
$(INCL)/mextra.h $(INCL)/skills.h \
$(INCL)/timeout.h $(INCL)/trap.h $(INCL)/flag.h \
$(INCL)/rm.h $(INCL)/vision.h $(INCL)/display.h \
$(INCL)/engrave.h $(INCL)/rect.h $(INCL)/region.h \
@@ -805,8 +858,7 @@ recover: $(U)recover.exe
$(O)sp_lev.tag: $(O)utility.tag
$(subst /,\,echo sp_levs done > $(O)sp_lev.tag)
$(O)utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \
$(TILEUTIL16)
$(O)utility.tag: $(TILEUTIL16)
$(subst /,\,@echo utilities made >$@)
@echo utilities made.
@@ -840,11 +892,12 @@ gamedir.tag:
test -d $(GAMEDIR) && echo directory created > $@
$(GAMEDIR)/NetHack.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)consoletty.o $(O)guistub.o \
$(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)conres.o $(KEYDLLS) \
$(ALLOBJ) $(TTYOBJ) $(O)date.o $(GUIOBJ) $(O)conres.o $(KEYDLLS) \
$(LUATARGETS)
@echo Linking $@...
$(link) $(lflags) -o$@ $(ALLOBJ) $(TTYOBJ) $(O)consoletty.o $(O)tile.o \
$(O)guistub.o $(O)conres.o $(PDCLIB) $(LUALIB) $(conlibs) -static -lstdc++
$(O)guistub.o $(O)date.o $(O)conres.o $(PDCLIB) $(LUALIB) \
$(conlibs) -static -lstdc++
$(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
# NetHackW
@@ -860,7 +913,8 @@ $(GAMEDIR)/NetHackW.exe : gamedir.tag $(PDCLIB) $(O)tile.o $(O)ttystub.o \
$(ALLOBJ) $(TTYOBJ) $(GUIOBJ) $(O)winres.o $(KEYDLLS) \
$(LUATARGETS)
@echo Linking $@...
$(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o \
$(link) $(lflags) -mwindows -o$@ $(ALLOBJ) $(GUIOBJ) $(O)tile.o \
$(O)ttystub.o $(O)date.o \
$(O)winres.o $(PDCLIB) $(guilibs) $(LUALIB) -static -lstdc++
$(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
endif
@@ -922,9 +976,25 @@ $(O)makedefs.o: $(CONFIG_H) $(INCL)/monattk.h $(INCL)/monflag.h \
$(U)makedefs.c $(SRC)\mdlib.c
$(cc) $(CFLAGSU) -o$@ $(U)makedefs.c
ifeq "$(GIT_AVAILABLE)" "1"
GIT_HASH := $(shell echo `git rev-parse --verify HEAD` 2>&1)
GIT_BRANCH := $(shell echo `git rev-parse --abbrev-ref HEAD` 2>&1)
ifdef GIT_HASH
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
endif
ifdef GIT_BRANCH
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
endif
endif
$(O)date.o: $(HACKINCL) $(HACKSRC) $(HACKOBJ) $(ALLOBJ)
$(cc) $(CFLAGS) $(GITHASH) $(GITBRANCH) -o$@ $(SRC)/date.c
#
# date.h should be remade every time any of the source or include
# files is modified.
# if you are making date.h for reference purposes (it isn't required
# for the build anymore), it should be remade every time any of the
# source or include files is modified.
#
$(INCL)/date.h $(OPTIONS_FILE): $(U)makedefs.exe
@@ -1453,7 +1523,7 @@ $(O)termcap.o: ../win/tty/termcap.c $(HACK_H) $(INCL)/tcap.h
$(O)topl.o: ../win/tty/topl.c $(HACK_H) $(INCL)/tcap.h
$(cc) $(CFLAGS) -o$@ ../win/tty/topl.c
$(O)wintty.o: ../win/tty/wintty.c $(HACK_H) $(INCL)/dlb.h \
$(INCL)/date.h $(INCL)/tcap.h
$(INCL)/tcap.h
$(cc) $(CFLAGS) -o$@ ../win/tty/wintty.c
#$(O)Window.o: ../win/X11/Window.c $(INCL)/xwindowp.h $(INCL)/xwindow.h \
# $(CONFIG_H)
@@ -1702,7 +1772,7 @@ $(O)trap.o: trap.c $(HACK_H)
$(O)u_init.o: u_init.c $(HACK_H)
$(O)uhitm.o: uhitm.c $(HACK_H)
$(O)vault.o: vault.c $(HACK_H)
$(O)version.o: version.c $(HACK_H) $(INCL)/date.h
$(O)version.o: version.c $(HACK_H)
$(O)vision.o: vision.c $(HACK_H)
$(O)weapon.o: weapon.c $(HACK_H)
$(O)were.o: were.c $(HACK_H)

View File

@@ -1,5 +1,5 @@
# NetHack 3.7 Makefile.msc
# Copyright (c) NetHack PC Development Team 1993-2020
# Copyright (c) NetHack PC Development Team 1993-2021
#
#==============================================================================
# Build Tools Environment
@@ -65,12 +65,14 @@
# none of the 5 decisions are absolutely required because defaults
# are in place:
#
# 1. Where do you want your build results to end up?
# 2. Do you want to include the optional curses port?
# 3. Do you want to include compressed savefile support to
# 1. Do you have git commands in your path and NetHack in a
# git repository?
# 2. Where do you want your build results to end up?
# 3. Do you want to include the optional curses port?
# 4. Do you want to include compressed savefile support to
# transfer compressed savefiles between platforms?
# 4. Do you want debug information in the executable?
# 5. Do you want to explicitly override auto-detection of
# 5. Do you want debug information in the executable?
# 6. Do you want to explicitly override auto-detection of
# a 32-bit or 64-bit target?
#
# Mandatory Lua source Location (not optional)
@@ -82,16 +84,24 @@
#
#------------------------------------------------------------------------------
#==============================================================================
#
#------------------------------------------------------------------------------
# 1. Where do you want the game to be built (which folder)?
# 1. Do you have git commands available and NetHack in a git repository.
# If not, such as if you obtained the NetHack sources in a zip file download,
# set GIT_AVAILABLE = 0
#
GIT_AVAILABLE = 1
#
#------------------------------------------------------------------------------
# 2. Where do you want the game to be built (which folder)?
#
GAMEDIR = ..\binary # Default game build directory
#
#------------------------------------------------------------------------------
# OPTIONAL - Curses window port support
#
# 2. Uncomment these and set them appropriately if you want to
# 3. Uncomment these and set them appropriately if you want to
# include curses port support alongside TTY support in your
# NetHack.exe binary.
#
@@ -100,24 +110,24 @@ GAMEDIR = ..\binary # Default game build directory
# of your PDCurses C files.
#
#ADD_CURSES=Y
#PDCURSES_TOP=..\lib\pdcursesmod
#PDCURSES_TOP=..\lib\pdcurses
#
#------------------------------------------------------------------------------
# OPTIONAL - zlib support (to allow compressed savefile exchange across platforms
#
# 3. Location of zlib sources
# 4. Location of zlib sources
#
#
#ADD_ZLIB=Y
#ZLIBTOP=..\lib\zlib
#
#------------------------------------------------------------------------------
# 4. Do you want debug information available to the executable?
# 5. Do you want debug information available to the executable?
#
DEBUGINFO = Y
#
#------------------------------------------------------------------------------
# 5. This Makefile will attempt to auto-detect your selected target architecture
# 6. This Makefile will attempt to auto-detect your selected target architecture
# based on Visual Studio command prompt configuration settins etc.
# However, if you want to manually override generation of a
# 32-bit or 64-bit build target, you can uncomment the apppropriate
@@ -260,13 +270,55 @@ CROSSCOMPILE_TARGET=
CROSSCOMPILE=
!ENDIF
HACKINCL = $(INCL)\align.h $(INCL)\artifact.h $(INCL)\artilist.h \
$(INCL)\attrib.h $(INCL)\botl.h $(INCL)\color.h $(INCL)\config.h \
$(INCL)\config1.h $(INCL)\context.h $(INCL)\coord.h $(INCL)\decl.h \
$(INCL)\display.h $(INCL)\dlb.h $(INCL)\dungeon.h $(INCL)\engrave.h \
$(INCL)\extern.h $(INCL)\flag.h $(INCL)\fnamesiz.h $(INCL)\func_tab.h \
$(INCL)\global.h $(INCL)\warnings.h $(INCL)\hack.h $(INCL)\lint.h \
$(INCL)\mextra.h $(INCL)\mfndpos.h $(INCL)\micro.h $(INCL)\mkroom.h \
$(INCL)\monattk.h $(INCL)\mondata.h $(INCL)\monflag.h $(INCL)\monst.h \
$(INCL)\monsters.h $(INCL)\obj.h $(INCL)\objects.h $(INCL)\objclass.h \
$(INCL)\optlist.h $(INCL)\patchlevel.h $(INCL)\pcconf.h \
$(INCL)\permonst.h $(INCL)\prop.h $(INCL)\rect.h $(INCL)\region.h \
$(INCL)\sym.h $(INCL)\defsym.h $(INCL)\rm.h $(INCL)\sp_lev.h \
$(INCL)\spell.h $(INCL)\sys.h $(INCL)\system.h $(INCL)\tcap.h \
$(INCL)\timeout.h $(INCL)\tradstdc.h $(INCL)\trap.h \
$(INCL)\unixconf.h $(INCL)\vision.h $(INCL)\vmsconf.h \
$(INCL)\wintty.h $(INCL)\wincurs.h $(INCL)\winX.h \
$(INCL)\winprocs.h $(INCL)\wintype.h $(INCL)\you.h \
$(INCL)\youprop.h
# all .c that are part of the main NetHack program and are not operating- or
# windowing-system specific
HACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c \
botl.c cmd.c dbridge.c decl.c detect.c dig.c display.c dlb.c do.c \
do_name.c do_wear.c dog.c dogmove.c dokick.c dothrow.c drawing.c \
dungeon.c eat.c end.c engrave.c exper.c explode.c extralev.c \
files.c fountain.c hack.c hacklib.c \
insight.c invent.c isaac64.c light.c \
lock.c mail.c makemon.c mcastu.c mdlib.c mhitm.c \
mhitu.c minion.c mklev.c mkmap.c mkmaze.c mkobj.c mkroom.c mon.c \
mondata.c monmove.c monst.c mplayer.c mthrowu.c muse.c music.c \
nhlua.c nhlsel.c nhlobj.c o_init.c objects.c objnam.c \
options.c pager.c pickup.c pline.c polyself.c potion.c pray.c \
priest.c quest.c questpgr.c read.c rect.c region.c restore.c \
rip.c rnd.c role.c rumors.c save.c sfstruct.c \
shk.c shknam.c sit.c sounds.c \
sp_lev.c spell.c steal.c steed.c symbols.c sys.c teleport.c \
timeout.c topten.c track.c trap.c u_init.c \
uhitm.c vault.c version.c vision.c weapon.c were.c wield.c \
windows.c wizard.c worm.c worn.c write.c zap.c
#
# Utility Objects.
#
MAKESRC = $(U)makedefs.c
MAKEDEFSOBJS = $(O)makedefs.o $(O)monst$(HOST).o $(O)objects$(HOST).o
MAKEDEFSOBJS = $(O)makedefs.o $(O)monst$(HOST).o $(O)objects$(HOST).o \
$(O)date.o
RECOVOBJS = $(O)recover.o
@@ -333,6 +385,14 @@ TTYOBJ = $(O)topl.o $(O)getline.o $(O)wintty.o
MDLIB = $(O)mdlib.o
!IFDEF GIT_HASH
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
!ENDIF
!IFDEF GIT_BRANCH
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
!ENDIF
!IFNDEF ADD_CURSES
CURSESOBJ=
!ELSE
@@ -490,14 +550,14 @@ HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\lint.h $(INCL)\align.h \
$(INCL)\dungeon.h $(INCL)\mkroom.h \
$(INCL)\objclass.h $(INCL)\youprop.h $(INCL)\prop.h \
$(INCL)\permonst.h $(INCL)\monattk.h \
$(INCL)\monflag.h $(INCL)\mondata.h $(INCL)\pm.h \
$(INCL)\monflag.h $(INCL)\mondata.h \
$(INCL)\wintype.h $(INCL)\context.h \
$(INCL)\sym.h $(INCL)\defsym.h $(INCL)\rm.h \
$(INCL)\botl.h $(INCL)\rect.h \
$(INCL)\region.h $(INCL)\decl.h $(INCL)\quest.h \
$(INCL)\spell.h $(INCL)\color.h $(INCL)\obj.h \
$(INCL)\you.h $(INCL)\attrib.h $(INCL)\monst.h \
$(INCL)\mextra.h $(INCL)\skills.h $(INCL)\onames.h \
$(INCL)\mextra.h $(INCL)\skills.h \
$(INCL)\timeout.h $(INCL)\trap.h $(INCL)\flag.h \
$(INCL)\vision.h $(INCL)\display.h $(INCL)\engrave.h \
$(INCL)\winprocs.h $(INCL)\sys.h $(INCL)\wintty.h
@@ -918,7 +978,7 @@ GAMEOBJ=$(GAMEOBJ:^ =^
$(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)consoletty.o $(O)guistub.o \
$(ALLOBJ) $(TTYOBJ) $(O)console.res $(KEYDLLS) \
$(ALLOBJ) $(TTYOBJ) $(O)date.o $(O)console.res $(KEYDLLS) \
$(LUATARGETS) $(PDCLIB)
@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
@echo Linking $(@:\=/)
@@ -930,6 +990,7 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)consoletty.o $(O)guistub
$(O)consoletty.o
$(O)tile.o
$(O)guistub.o
$(O)date.o
$(O)console.res
<<
@if exist $(O)install.tag del $(O)install.tag
@@ -943,7 +1004,7 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)consoletty.o $(O)guistub
# objs: $(GAMEOBJ) $(GUIOBJ) $(O)tile.o $(O)ttystub.o
$(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \
$(ALLOBJ) $(GUIOBJ) $(O)NetHackW.res \
$(ALLOBJ) $(GUIOBJ) $(O)date.o $(O)NetHackW.res \
$(O)gamedir.tag $(KEYDLLS) \
$(LUATARGETS)
@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
@@ -955,6 +1016,7 @@ $(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \
$(GUIOBJ)
$(O)tile.o
$(O)ttystub.o
$(O)date.o
$(O)NetHackW.res
<<
@@ -1050,8 +1112,7 @@ recover: $(U)recover.exe
$(O)sp_lev.tag:
echo sp_levs done > $(O)sp_lev.tag
$(O)utility.tag: $(INCL)\nhlua.h $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \
$(U)tile2bmp.exe
$(O)utility.tag: $(INCL)\nhlua.h $(U)tile2bmp.exe $(U)makedefs.exe
@echo utilities made >$@
@echo utilities made.
@@ -1104,6 +1165,34 @@ $(O)makedefs.o: $(U)makedefs.c $(SRC)\mdlib.c $(CONFIG_H) $(INCL)\permonst.h \
@$(cc) -DENUM_PM $(cflagsBuild) $(CROSSCOMPILE) -Fo$@ $(U)makedefs.c
# @$(cc) -DENUM_PM $(cflagsBuild) $(CROSSCOMPILE) /EP -Fo$@ $(U)makedefs.c >makedefs.c.preprocessed
#
# This is awful, but it allows the GITHASH and GITBRANCH macros to be
# defined and utilized, using only build-in Windows and nmake commands,
# as well as the necessary git commands.
#
# We build a temporary Makefile on-the-fly for compiling date.c and
# invoke nmake again.
#
$(O)date.o: $(HACKINCL) $(HACKSRC) $(HACKOBJ) $(ALLOBJ)
!IF "$(GIT_AVAILABLE)" == "1"
@git rev-parse --verify HEAD 2>&1 >$(O)date1.tmp
@git rev-parse --abbrev-ref HEAD 2>&1 >$(O)date2.tmp
@echo.>date.nmk
@echo OBJ = $(OBJ)>>date.nmk
@echo O = ^$(OBJ)^^^\>>date.nmk
@echo cc = $(cc)>>date.nmk
@echo cflagsBuild = $(cflagsBuild) ^\>>date.nmk
@for /F "usebackq" %%A IN ("$(O)date1.tmp") DO @echo. -DNETHACK_GIT_SHA=\"%%A\" ^\>>date.nmk
@for /F "usebackq" %%A IN ("$(O)date2.tmp") DO @echo. -DNETHACK_GIT_BRANCH=\"%%A\">>date.nmk
@echo.>>date.nmk
@echo default: ^$(O)date.o>>date.nmk
@echo.>>date.nmk
@echo ^$(O)date.o: >>date.nmk
@echo. ^$(cc) ^$(cflagsBuild) -Fo^$@ date.c>>date.nmk
@echo.>>date.nmk
@$(MAKE) /NOLOGO /A -f date.nmk
!ENDIF
#
# date.h should be remade every time any of the source or include
# files is modified.
@@ -1349,7 +1438,7 @@ $(O)tilete32.o: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H)
#==========================================
$(U)gif2txt.exe: $(GIFREADERS_HOST) $(TEXT_IO)
@echo Linking $(@:\=/)
@echo Linking $(@:\=/)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
$(GIFREADERS_HOST:^ =^
)
@@ -1358,7 +1447,7 @@ $(U)gif2txt.exe: $(GIFREADERS_HOST) $(TEXT_IO)
<<
$(U)gif2tx32.exe: $(GIFREADERS32_HOST) $(TEXT_IO32)
@echo Linking $(@:\=/)
@echo Linking $(@:\=/)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
$(GIFREADERS32_HOST:^ =^
)
@@ -1367,7 +1456,7 @@ $(U)gif2tx32.exe: $(GIFREADERS32_HOST) $(TEXT_IO32)
<<
$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO)
@echo Linking $(@:\=/)
@echo Linking $(@:\=/)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
$(PPMWRITERS:^ =^
)
@@ -1380,7 +1469,7 @@ $(SRC)\tiles.bmp: $(U)tile2bmp.exe $(TILEFILES)
@$(U)tile2bmp $@
$(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO)
@echo Linking $(@:\=/)
@echo Linking $(@:\=/)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
$(O)tile2bmp.o
$(TEXT_IO:^ =^
@@ -1388,7 +1477,7 @@ $(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO)
<<
$(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32)
@echo Linking $(@:\=/)
@echo Linking $(@:\=/)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
$(O)til2bm32.o
$(TEXT_IO32:^ =^
@@ -1420,10 +1509,10 @@ $(O)tile2x11.o: $(X11)\tile2x11.c $(HACK_H) $(TILE_H) $(INCL)\tile2x11.h
$(SRC)\x11tiles: $(U)tile2x11.exe $(WSHR)\monsters.txt $(WSHR)\objects.txt \
$(WSHR)\other.txt \
$(WSHR)\monsters.txt
$(WSHR)\monsters.txt
$(U)tile2x11 $(WSHR)\monsters.txt $(WSHR)\objects.txt \
$(WSHR)\other.txt \
-grayscale $(WSHR)\monsters.txt
-grayscale $(WSHR)\monsters.txt
#===============================================================================
# PDCurses
@@ -1587,11 +1676,13 @@ $(O)monst.o: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \
$(O)objects_host.o: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ objects.c
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) /EP $(@B).c > $(O)$(@B).c.preproc
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $(@B).c
$(O)objects.o: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
@$(cc) $(cflagsBuild) -Fo$@ objects.c
@$(cc) $(cflagsBuild) /EP $(@B).c > $(O)$(@B).c.preproc
@$(cc) $(cflagsBuild) -Fo$@ $(@B).c
$(O)alloc_host.o: alloc.c $(CONFIG_H)
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ alloc.c
@@ -1948,6 +2039,8 @@ $(O)wc_chainout.o: ..\win\chain\wc_chainout.c $(HACK_H)
$(O)wc_trace.o: ..\win\chain\wc_trace.c $(HACK_H) $(INCL)\func_tab.h
# @$(cc) $(cflagsBuild) -Fo$@ ..\win\chain\wc_trace.c
$(O)allmain.o: allmain.c $(HACK_H)
@$(cc) $(cflagsBuild) /EP $(@B).c > $(O)$(@B).c.preproc
@$(cc) $(cflagsBuild) -Fo$@ $(@B).c
$(O)alloc.o: alloc.c $(CONFIG_H)
$(O)apply.o: apply.c $(HACK_H)
$(O)artifact.o: artifact.c $(HACK_H) $(INCL)\artifact.h $(INCL)\artilist.h
@@ -2064,7 +2157,7 @@ $(O)trap.o: trap.c $(HACK_H)
$(O)u_init.o: u_init.c $(HACK_H)
$(O)uhitm.o: uhitm.c $(HACK_H)
$(O)vault.o: vault.c $(HACK_H)
$(O)version.o: version.c $(HACK_H) $(INCL)\dlb.h $(INCL)\date.h
$(O)version.o: version.c $(HACK_H) $(INCL)\dlb.h
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ version.c
$(O)vision.o: vision.c $(HACK_H)
$(O)weapon.o: weapon.c $(HACK_H)

View File

@@ -219,10 +219,8 @@
<ClInclude Include="$(IncDir)windconf.h" />
<ClInclude Include="$(IncDir)obj.h" />
<ClInclude Include="$(IncDir)objclass.h" />
<ClInclude Include="$(IncDir)onames.h" />
<ClInclude Include="$(IncDir)patchlevel.h" />
<ClInclude Include="$(IncDir)permonst.h" />
<ClInclude Include="$(IncDir)pm.h" />
<ClInclude Include="$(IncDir)prop.h" />
<ClInclude Include="$(IncDir)quest.h" />
<ClInclude Include="$(IncDir)rect.h" />

View File

@@ -244,12 +244,10 @@
<ClInclude Include="$(IncDir)windconf.h" />
<ClInclude Include="$(IncDir)obj.h" />
<ClInclude Include="$(IncDir)objclass.h" />
<ClInclude Include="$(IncDir)onames.h" />
<ClInclude Include="$(IncDir)optlist.h" />
<ClInclude Include="$(IncDir)patchlevel.h" />
<ClInclude Include="$(IncDir)pcconf.h" />
<ClInclude Include="$(IncDir)permonst.h" />
<ClInclude Include="$(IncDir)pm.h" />
<ClInclude Include="$(IncDir)prop.h" />
<ClInclude Include="$(IncDir)quest.h" />
<ClInclude Include="$(IncDir)rect.h" />

View File

@@ -6,8 +6,6 @@
<Defs Include = "$(IncDir)date.h"/>
<!-- -o -->
<Defs Include = "$(IncDir)onames.h"/>
<!-- -p -->
<Defs Include = "$(IncDir)pm.h"/>
<!-- -r -->
<Defs Include = "$(DatDir)rumors"/>
<!-- -s -->

View File

@@ -55,9 +55,7 @@
<ClInclude Include="$(IncDir)windconf.h" />
<ClInclude Include="$(IncDir)obj.h" />
<ClInclude Include="$(IncDir)objclass.h" />
<ClInclude Include="$(IncDir)onames.h" />
<ClInclude Include="$(IncDir)permonst.h" />
<ClInclude Include="$(IncDir)pm.h" />
<ClInclude Include="$(IncDir)prop.h" />
<ClInclude Include="$(IncDir)quest.h" />
<ClInclude Include="$(IncDir)rect.h" />

View File

@@ -648,6 +648,11 @@ process_options(int argc, char * argv[])
reveal_paths();
nethack_exit(EXIT_SUCCESS);
}
#ifndef NODUMPENUMS
if (argcheck(argc, argv, ARG_DUMPENUMS) == 2) {
nethack_exit(EXIT_SUCCESS);
}
#endif
if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--;
argv++;