Merge branch 'master' into paxed-new_lev_comp

Conflicts:
	.gitignore
	doc/fixes35.0
	include/obj.h
	include/patchlevel.h
	src/dig.c
	src/mklev.c
	src/rumors.c
	src/save.c
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
	util/makedefs.c
	win/win32/levstuff.mak
This commit is contained in:
Pasi Kallinen
2015-03-21 19:39:48 +02:00
49 changed files with 1670 additions and 350 deletions

View File

@@ -9,7 +9,7 @@ NHSROOT=..
# SHELL=E:/GEMINI2/MUPFEL.TTP
# UUDECODE=uudecode
VARDAT = data rumors quest.dat oracles options
VARDAT = bogusmon data engrave epitaph rumors quest.dat oracles options
all: $(VARDAT) spec_levs quest_levs dungeon
@@ -98,6 +98,15 @@ quest.dat: quest.txt ../util/makedefs
oracles: oracles.txt ../util/makedefs
../util/makedefs -h
engrave: engrave.txt ../util/makedefs
../util/makedefs -s
epitaph: epitaph.txt ../util/makedefs
../util/makedefs -s
bogusmon: bogusmon.txt ../util/makedefs
../util/makedefs -s
# note: 'options' should have already been made when include/date.h was created
options: ../util/makedefs
../util/makedefs -v

View File

@@ -56,7 +56,7 @@ VARDIR = $(HACKDIR)
# for Gnome
# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm
VARDATD = data oracles options quest.dat rumors
VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors
VARDAT = $(VARDATD) $(VARDATND)
# Some versions of make use the SHELL environment variable as the shell
@@ -109,6 +109,15 @@ manpages:
data: $(GAME)
( cd dat ; $(MAKE) data )
engrave: $(GAME)
( cd dat ; $(MAKE) engrave )
bogusmon: $(GAME)
( cd dat ; $(MAKE) bogusmon )
epitaph: $(GAME)
( cd dat ; $(MAKE) epitaph )
rumors: $(GAME)
( cd dat ; $(MAKE) rumors )
@@ -264,10 +273,10 @@ install: rootcheck $(GAME) recover $(VARDAT) dungeon spec_levs
# set up the game files
( $(MAKE) dofiles )
# set up some additional files
touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile
-( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
$(CHGRP) $(GAMEGRP) perm record logfile ; \
chmod $(VARFILEPERM) perm record logfile )
touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile
-( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile ; \
$(CHGRP) $(GAMEGRP) perm record logfile xlogfile ; \
chmod $(VARFILEPERM) perm record logfile xlogfile )
true; $(POSTINSTALL)
# and a reminder
@echo You may also want to reinstall the man pages via the doc Makefile.

View File

@@ -13,8 +13,10 @@
#
#==============================================================================
# This is used for building two versions of NetHack:
#
# A tty port utilizing the Win32 Console I/O subsystem, Console
# NetHack;
#
# A Win32 native port built on the Windows API, Graphical NetHack or
# NetHackW.
#
@@ -181,43 +183,73 @@ guilibs = $(winlibs)
# End of VS2013 and greater stuff
#=============================================
#
#=============================================
# Visual Studio versions >= 2013 specific stuff
#=============================================
!IF "$(TARGET_CPU)" == ""
TARGET_CPU=x86
!ENDIF
# Common compiler flags:
# -c - compile without linking
# -W3 - Set warning level to level 3 (-W4 for 64-bit compilations)
# -Zi - generate debugging information
# -Od - disable all optimizations
# -Ox - use maximum optimizations
# -Zd - generate only public symbols and line numbers for debugging
# -GS - enable security checks
#
ccommon=-c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -c
lflags=/INCREMENTAL:NO /NOLOGO
!IF "$(TARGET_CPU)" == "x86"
cflags = $(ccommon) -D_X86_=1 -DWIN32 -D_WIN32 -W3
scall = -Gz
!ELSEIF "$(TARGET_CPU)" == "x64"
cflags = $(ccommon) -D_AMD64_=1 -DWIN64 -D_WIN64 -DWIN32 -D_WIN32
cflags = $(cflags) -W4
scall =
!ENDIF
# declarations for use on Intel x86 systems
!IF "$(TARGET_CPU)" == "x86"
DLLENTRY = @12
!ENDIF
# declarations for use on AMD64 systems
!IF "$(TARGET_CPU)" == "x64"
DLLENTRY =
!ENDIF
# for Windows applications
conlflags = $(lflags) -subsystem:console,$(EXEVER)
guilflags = $(lflags) -subsystem:windows,$(EXEVER)
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
# basic subsystem specific libraries, less the C Run-Time
baselibs = kernel32.lib $(optlibs) $(winsocklibs) advapi32.lib
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
# for Windows applications that use the C Run-Time libraries
conlibs = $(baselibs)
guilibs = $(winlibs)
#
# End of VS2013 and greater stuff
#=============================================
#
#==========================================
# Exe File Info.
#==========================================
# Yacc/Lex ... if you got 'em.
#
# If you have yacc and lex programs (or work-alike such as bison
# and flex), comment out the upper two macros and uncomment
# the lower two.
#
DO_YACC = YACC_MSG
DO_LEX = LEX_MSG
#DO_YACC = YACC_ACT
#DO_LEX = LEX_ACT
# - Specify your yacc and lex programs (or work-alikes) here.
#YACC = bison -y
YACC = byacc
#YACC = yacc
#LEX = lex
LEX = flex
#
# - Specify your flex skeleton file (if needed).
#
FLEXSKEL =
#FLEXSKEL = -S../tools/flex.ske
YTABC = y_tab.c
YTABH = y_tab.h
LEXYYC = lexyy.c
# For the level compiler bits,
# we just defer to win\win32\dgnstuff.mak
# and win\win32\levstuff.mak
#
#
# Optional high-quality BSD random number generation routines
# (see pcconf.h). Set to nothing if not used.
@@ -451,19 +483,20 @@ U = $(UTIL)^\
MAKESRC = $(U)makedefs.c
SPLEVSRC = $(U)lev_yacc.c $(U)lev_$(LEX).c $(U)lev_main.c $(U)panic.c
DGNCOMPSRC = $(U)dgn_yacc.c $(U)dgn_$(LEX).c $(U)dgn_main.c
MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o
SPLEVOBJS = $(O)lev_yacc.o $(O)lev_$(LEX).o $(O)lev_main.o \
#SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \
# $(O)alloc.o $(O)decl.o $(O)drawing.o \
# $(O)monst.o $(O)objects.o $(O)panic.o
SPLEVOBJS = $(O)lev_yacc.o $(O)lev_lex.o $(O)lev_main.o \
$(O)alloc.o $(O)decl.o $(O)drawing.o \
$(O)monst.o $(O)objects.o $(O)panic.o
DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_$(LEX).o $(O)dgn_main.o \
DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_lex.o $(O)dgn_main.o \
$(O)alloc.o $(O)panic.o
RECOVOBJS = $(O)recover.o
TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
@@ -840,6 +873,14 @@ $(INCL)\vis_tab.h: $(U)makedefs.exe
$(SRC)\vis_tab.c: $(U)makedefs.exe
$(U)makedefs -z
$(DAT)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe
..\util\makedefs -s
$(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe
..\util\makedefs -s
$(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe
..\util\makedefs -s
#==========================================
# uudecode utility and uuencoded targets
#==========================================
@@ -890,71 +931,55 @@ $(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu
..\..\util\uudecode.exe splash.uu
chdir ..\..\src
#==========================================
#=================================================
# Level Compiler Stuff
#==========================================
#=================================================
#
# defer to the steps in ..\win\win32\levstuff.mak
#
LEVCFLAGS=-c -nologo -DWINVER=0x0400 -DWIN32 -D_WIN32 \
-D_MT -MT -I..\include -nologo -Z7 -Od -DDLB
$(U)lev_yacc.c $(INCL)\lev_comp.h: $(U)lev_comp.y
nmake -nologo -f ..\win\win32\levstuff.mak default
LEVCFLAGS=-c -nologo -DWIN32 -D_WIN32 -I$(INCL) -nologo -Z7 -Od -DDLB
$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c
$(O)lev_lex.o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \
$(U)lev_lex.c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_lex.c
$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H)
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c
$(U)levcomp.exe: $(SPLEVOBJS)
@echo Linking $@...
@$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
echo $(link)
echo $(lflagsUtil)
$(link) $(lflagsUtil) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ @<<$(@B).lnk
$(SPLEVOBJS:^ =^
)
<<
$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c
$(O)lev_$(LEX).o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \
$(U)lev_$(LEX).c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_$(LEX).c
$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H)
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c
$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
! IF "$(DO_YACC)"=="YACC_ACT"
chdir $(UTIL)
$(YACC) -d lev_comp.y
copy $(YTABC) lev_yacc.c
copy $(YTABH) $(INCL)\lev_comp.h
@del $(YTABC)
@del $(YTABH)
chdir $(SRC)
! ELSE
@echo $(U)lev_comp.y has changed.
@echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC).
@echo ---
@echo For now, we will copy the prebuilt lev_yacc.c and
@echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
@copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul
@copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul
@echo /**/ >>$(U)lev_yacc.c
@echo /**/ >>$(INCL)\lev_comp.h
! ENDIF
$(U)lev_$(LEX).c: $(U)lev_comp.l
! IF "$(DO_LEX)"=="LEX_ACT"
chdir $(UTIL)
$(LEX) $(FLEXSKEL) lev_comp.l
copy $(LEXYYC) $@
@del $(LEXYYC)
chdir $(SRC)
! ELSE
@echo $(U)lev_comp.l has changed. To update $@ run $(LEX).
@echo ---
@echo For now, we will copy the prebuilt lev_lex.c
@echo from $(SSYS) into $(UTIL) and use it.
@copy $(SSYS)\lev_lex.c $@ >nul
@echo /**/ >>$@
! ENDIF
#==========================================
#=================================================
# Dungeon Compiler Stuff
#==========================================
#=================================================
#
# defer to the steps in ..\win\win32\dgnstuff.mak
#
$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
nmake -nologo -f ..\win\win32\dgnstuff.mak default
$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c
$(O)dgn_lex.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \
$(U)dgn_lex.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_lex.c
$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c
$(U)dgncomp.exe: $(DGNCOMPOBJS)
@echo Linking $@...
@@ -963,56 +988,9 @@ $(U)dgncomp.exe: $(DGNCOMPOBJS)
)
<<
$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c
$(O)dgn_$(LEX).o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \
$(U)dgn_$(LEX).c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_$(LEX).c
$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c
@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c
$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
! IF "$(DO_YACC)"=="YACC_ACT"
chdir $(UTIL)
$(YACC) -d dgn_comp.y
copy $(YTABC) dgn_yacc.c
copy $(YTABH) $(INCL)\dgn_comp.h
@del $(YTABC)
@del $(YTABH)
chdir $(SRC)
! ELSE
@echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and
@echo $(INCL)\dgn_comp.h run $(YACC).
@echo ---
@echo For now, we will copy the prebuilt $(U)dgn_yacc.c and
@echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
@copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul
@copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
@echo /**/ >>$(U)dgn_yacc.c
@echo /**/ >>$(INCL)\dgn_comp.h
! ENDIF
$(U)dgn_$(LEX).c: $(U)dgn_comp.l
! IF "$(DO_LEX)"=="LEX_ACT"
chdir $(UTIL)
$(LEX) $(FLEXSKEL) dgn_comp.l
copy $(LEXYYC) $@
@del $(LEXYYC)
chdir $(SRC)
! ELSE
@echo $(U)dgn_comp.l has changed. To update $@ run $(LEX).
@echo ---
@echo For now, we will copy the prebuilt dgn_lex.c
@echo from $(SSYS) into $(UTIL) and use it.
@copy $(SSYS)\dgn_lex.c $@ >nul
@echo /**/ >>$@
! ENDIF
#==========================================
#=================================================
# Create directory for holding object files
#==========================================
#=================================================
$(O)obj.tag:
@if not exist $(OBJ)\*.* echo creating directory $(OBJ)
@@ -1050,7 +1028,7 @@ envchk:
#==========================================
#===========================================
# Header files NOT distributed in ..\include
# Header files NOT distributed in $(INCL)
#===========================================
$(INCL)\win32api.h: $(NTSYS)\win32api.h
@@ -1081,7 +1059,7 @@ $(DAT)\porthelp: $(NTSYS)\porthelp
nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \
$(DAT)\license $(O)sp_lev.tag
$(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(O)sp_lev.tag
cd $(DAT)
echo data >dlb.lst
echo oracles >>dlb.lst
@@ -1091,6 +1069,9 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
if exist porthelp echo porthelp >>dlb.lst
echo quest.dat >>dlb.lst
echo rumors >>dlb.lst
echo engrave >>dlb.lst
echo epitaph >>dlb.lst
echo bogusmon >>dlb.lst
echo help >>dlb.lst
echo hh >>dlb.lst
echo cmdhelp >>dlb.lst
@@ -1238,6 +1219,9 @@ spotless: clean
if exist $(U)*.map del $(U)*.map
if exist $(DAT)\data del $(DAT)\data
if exist $(DAT)\rumors del $(DAT)\rumors
if exist $(DAT)\engrave del $(DAT)\engrave
if exist $(DAT)\epitaph del $(DAT)\epitaph
if exist $(DAT)\bogusmon del $(DAT)\bogusmon
if exist $(DAT)\???-fil?.lev del $(DAT)\???-fil?.lev
if exist $(DAT)\???-goal.lev del $(DAT)\???-goal.lev
if exist $(DAT)\???-loca.lev del $(DAT)\???-loca.lev
@@ -1321,6 +1305,14 @@ clean:
if exist $(O)sp_lev.tag del $(O)sp_lev.tag
if exist $(O)uudecode.MAP del $(O)uudecode.MAP
if exist $(O)uudecode.PDB del $(O)uudecode.PDB
rem
rem defer to the steps in ..\win\win32\levstuff.mak
rem
nmake -nologo -f ..\win\win32\levstuff.mak clean
rem
rem defer to the steps in ..\win\win32\dgnstuff.mak
rem
nmake -nologo -f ..\win\win32\dgnstuff.mak clean
! IF ("$(WINPFLAG)"!="")
if exist $(TILEBMP16) del $(TILEBMP16)