some sys/windows build updates

Place built libraries for Lua and pdcurses into lib instead of the
more transient src/o subfolder.

Remove a kludge involving sys/windows/stub-pdcscrn.c.

Don't link pdcurses into NetHackW.exe (required a couple of stubs
since NetHack.exe and NetHackW.exe currently share object files
under the visual studio nmake build.

(Note: This may require a couple of follow-on minor modifications
to the mingw build. If so, the CI will flag that for us after this
commit)
This commit is contained in:
nhmall
2022-03-09 12:02:37 -05:00
parent e3490743e0
commit fa4ad397dc
3 changed files with 241 additions and 215 deletions

View File

@@ -108,91 +108,6 @@ INTERNET_AVAILABLE=Y
GIT_AVAILABLE=Y
!ENDIF
#==============================================================================
# Sanity checks for prerequisite Lua and pdcurses
#
LUA_MAY_PROCEED=N
ADD_CURSES=N
# First, Lua
!IF "$(INTERNET_AVAILABLE)" == "Y"
!IF "$(GIT_AVAILABLE)" == "Y"
LUATOP=..\submodules\lua
LUASRC=$(LUATOP)
LUA_MAY_PROCEED=Y
!ELSE # GIT_AVAILABLE
LUATOP = ..\lib\lua-$(LUAVER)
LUASRC = $(LUATOP)\src
LUA_MAY_PROCEED=Y
!ENDIF # GIT_AVAILABLE
!ELSE # INTERNET_AVAILABLE is not Y below
# The internet is not available for obtaining Lua using either
# method (git or download). Check to see if it is available already, with
# precedence given to ../submodules, then ../lib.
#
!IF EXIST("..\submodules\lua\lua.h")
LUATOP=..\submodules\lua
LUASRC=$(LUATOP)
LUA_MAY_PROCEED=Y
!ELSEIF EXIST("..\lib\lua-$(LUAVER)\src\lua.h")
LUATOP = ..\lib\lua-$(LUAVER)
LUASRC = $(LUATOP)\src
LUA_MAY_PROCEED=Y
!ENDIF # Lua sources
!IF "$(LUA_MAY_PROCEED)" == "Y"
!MESSAGE No internet connection was authorized in the Makefile,
!MESSAGE but a copy of lua-$(LUAVER) was found in $(LUATOP), so that will be used.
!ENDIF # LUA_MAY_PROCEED
!ENDIF # INTERNET_AVAILABLE
!IF "$(LUA_MAY_PROCEED)" != "Y"
!IF "$(INTERNET_AVAILABLE)" != "Y"
!MESSAGE Your Makefile settings do not allow use of the internet to obtain Lua
!ENDIF # INTERNET_AVAILABLE
!MESSAGE and no copy of Lua was found in either ..\submodules\lua or ..\lib\lua-$(LUAVER).
!MESSAGE Change your nmake command line to include:
!MESSAGE GIT=1
!MESSAGE or modify your Makefile to set the following:
!MESSAGE INTERNET_AVAILABLE=Y
!MESSAGE GIT_AVAILABLE=Y
!ERROR Stopping because NetHack 3.7 requires Lua for its build.
!ENDIF # LUA_MAY_PROCEED
# Now, pdcurses
!IF "$(INTERNET_AVAILABLE)" == "Y"
!IF "$(GIT_AVAILABLE)" == "Y"
PDCURSES_TOP=..\submodules\pdcurses
ADD_CURSES=Y
!ELSE # GIT_AVAILABLE
PDCURSES_TOP=..\lib\pdcurses
ADD_CURSES=Y
!ENDIF # GIT_AVAILABLE
!ELSE # INTERNET_AVAILABLE is not Y below
# Your Makefile settings do not allow pdcurses to be obtained by
# git or by download. Check to see if it is available at one of
# the expected locations already, with precedence given to ../submodules,
# then ../lib.
#
!IF EXIST("..\submodules\pdcurses\curses.h")
PDCURSES_TOP=..\submodules\pdcurses
ADD_CURSES=Y
!ELSEIF EXIST("..\lib\pdcurses\curses.h")
PDCURSES_TOP=..\lib\pdcurses
ADD_CURSES=Y
!ENDIF # pdcurses sources available somewhere
!IF "$(ADD_CURSES)" == "Y"
!MESSAGE Your Makefile settings do not allow pdcurses to be obtained by
!MESSAGE git or by download, but a copy of pdcurses was found in $(PDCURSES_TOP),
!MESSAGE so that will be used.
!ENDIF # ADD_CURSES == Y
!ENDIF # INTERNET_AVAILABLE
!IF "$(ADD_CURSES)" != "Y"
!MESSAGE NetHack 3.7 will be built without support for the curses window-port.
!ENDIF
#TEST_CROSSCOMPILE=Y
#==============================================================================
#
# The version of the game this Makefile was designed for
@@ -219,6 +134,8 @@ WCURSES = ..\win\curses # window port files (curses)
WSHR = ..\win\share # Tile support files
QT = ..\win\Qt # QT support files
X11 = ..\win\X11 # X11 support files
LIBDIR = ..\lib # libraries and external bits
SUBM = ..\submodules # NetHack git submodules
#
# Object directory.
@@ -226,6 +143,91 @@ X11 = ..\win\X11 # X11 support files
OBJ = o
#==============================================================================
# Sanity checks for prerequisite Lua and pdcurses
#
LUA_MAY_PROCEED=N
ADD_CURSES=N
# First, Lua
!IF "$(INTERNET_AVAILABLE)" == "Y"
!IF "$(GIT_AVAILABLE)" == "Y"
LUATOP=$(SUBM)\lua
LUASRC=$(LUATOP)
LUA_MAY_PROCEED=Y
!ELSE # GIT_AVAILABLE
LUATOP = $(LIBDIR)\lua-$(LUAVER)
LUASRC = $(LUATOP)\src
LUA_MAY_PROCEED=Y
!ENDIF # GIT_AVAILABLE
!ELSE # INTERNET_AVAILABLE is not Y below
# The internet is not available for obtaining Lua using either
# method (git or download). Check to see if it is available already, with
# precedence given to ../submodules, then ../lib.
#
!IF EXIST("$(SUBM)\lua\lua.h")
LUATOP=$(SUBM)\lua
LUASRC=$(LUATOP)
LUA_MAY_PROCEED=Y
!ELSEIF EXIST("$(LIBDIR)\lua-$(LUAVER)\src\lua.h")
LUATOP = $(LIBDIR)\lua-$(LUAVER)
LUASRC = $(LUATOP)\src
LUA_MAY_PROCEED=Y
!ENDIF # Lua sources
!IF "$(LUA_MAY_PROCEED)" == "Y"
!MESSAGE No internet connection was authorized in the Makefile,
!MESSAGE but a copy of lua-$(LUAVER) was found in $(LUATOP), so that will be used.
!ENDIF # LUA_MAY_PROCEED
!ENDIF # INTERNET_AVAILABLE
!IF "$(LUA_MAY_PROCEED)" != "Y"
!IF "$(INTERNET_AVAILABLE)" != "Y"
!MESSAGE Your Makefile settings do not allow use of the internet to obtain Lua
!ENDIF # INTERNET_AVAILABLE
!MESSAGE and no copy of Lua was found in either $(SUBM)\lua or $(LIBDIR)\lua-$(LUAVER).
!MESSAGE Change your nmake command line to include:
!MESSAGE GIT=1
!MESSAGE or modify your Makefile to set the following:
!MESSAGE INTERNET_AVAILABLE=Y
!MESSAGE GIT_AVAILABLE=Y
!ERROR Stopping because NetHack 3.7 requires Lua for its build.
!ENDIF # LUA_MAY_PROCEED
# Now, pdcurses
!IF "$(INTERNET_AVAILABLE)" == "Y"
!IF "$(GIT_AVAILABLE)" == "Y"
PDCURSES_TOP=$(SUBM)\pdcurses
ADD_CURSES=Y
!ELSE # GIT_AVAILABLE
PDCURSES_TOP=$(LIBDIR)\pdcurses
ADD_CURSES=Y
!ENDIF # GIT_AVAILABLE
!ELSE # INTERNET_AVAILABLE is not Y below
# Your Makefile settings do not allow pdcurses to be obtained by
# git or by download. Check to see if it is available at one of
# the expected locations already, with precedence given to ../submodules,
# then ../lib.
#
!IF EXIST("$(SUBM)\pdcurses\curses.h")
PDCURSES_TOP=$(SUBM)\pdcurses
ADD_CURSES=Y
!ELSEIF EXIST("$(LIBDIR)\pdcurses\curses.h")
PDCURSES_TOP=$(LIBDIR)\pdcurses
ADD_CURSES=Y
!ENDIF # pdcurses sources available somewhere
!IF "$(ADD_CURSES)" == "Y"
!MESSAGE Your Makefile settings do not allow pdcurses to be obtained by
!MESSAGE git or by download, but a copy of pdcurses was found in $(PDCURSES_TOP),
!MESSAGE so that will be used.
!ENDIF # ADD_CURSES == Y
!ENDIF # INTERNET_AVAILABLE
!IF "$(ADD_CURSES)" != "Y"
!MESSAGE NetHack 3.7 will be built without support for the curses window-port.
!ENDIF
#TEST_CROSSCOMPILE=Y
#
#==========================================
# Exe File Info.
@@ -311,8 +313,8 @@ CROSSCOMPILE=
LUAVER=5.4.4
!ENDIF
LUALIB = $(O)lua$(LUAVER)-static.lib
LUADLL = $(O)lua$(LUAVER).dll
LUALIB = $(LIBDIR)\lua$(LUAVER)-static.lib
LUADLL = $(LIBDIR)\lua$(LUAVER).dll
LUAINCL = /I$(LUASRC)
LUATARGETS = lua.exe $(LUADLL) $(LUALIB)
@@ -364,7 +366,7 @@ PDCLIBOBJS = $(O)addch.o $(O)addchstr.o $(O)addstr.o $(O)attr.o $(O)beep.o \
PDCOBJS = $(O)pdcclip.o $(O)pdcdisp.o $(O)pdcgetsc.o $(O)pdckbd.o $(O)pdcscrn.o \
$(O)pdcsetsc.o $(O)pdcutil.o
PDCLIB = $(O)pdcurses.lib
PDCLIB = $(LIBDIR)\pdcurses.lib
PDCINCL = /I$(PDCURSES_TOP) /I$(PDCSRC) /I$(PDCWINCON)
@@ -509,7 +511,7 @@ OBJS = $(MDLIB) \
$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
$(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) $(VOBJ30) \
$(REGEX) $(CURSESOBJ)
$(REGEX)
WINDHDR = $(MSWSYS)\win10.h $(MSWSYS)\winos.h $(MSWSYS)\win32api.h
@@ -580,7 +582,7 @@ DATABASE = $(DAT)\data.base
#
#CTAGSCMD=ctags-orig.exe
!IF "$(CI_BUILD_DIR)" != ""
CTAGSCMD=..\lib\ctags\ctags.exe
CTAGSCMD=$(LIBDIR)\ctags\ctags.exe
!ELSE
CTAGSCMD=..\..\..\ctags\ctags.exe
!ENDIF
@@ -592,11 +594,11 @@ CTAGSOPT =--language-force=c --sort=no -D"Bitfield(x,n)=unsigned x : n" --excmd=
TINC = $(INCL:\=/)
TSRC = $(SRC:\=/)
cc=cl
cpp=cpp
link=link
rc=Rc
cc=cl.exe
cpp=cpp.exe
link=link.exe
librarian=lib.exe
rc=Rc.exe
# Before we get started, this section is used to determine the version of
# Visual Studio we are using. We set VSVER to 0000 to flag any version that
@@ -883,7 +885,7 @@ DLB =
#==========================================
{$(WCURSES)}.c{$(OBJ)}.o:
$(cc) -DPDC_NCMOUSE $(PDCINCL) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
@$(cc) -DPDC_NCMOUSE $(PDCINCL) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $<
#{$(WCURSES)}.txt{$(DAT)}.txt:
# @copy $< $@
@@ -921,7 +923,8 @@ DLB =
all : install
install: $(LUASRC)\lua.h $(PDCDEP) $(INCL)\nhlua.h $(O)envchk.tag $(O)obj.tag $(O)utility.tag \
install: $(O)envchk.tag $(O)libdir.tag $(O)objdir.tag $(LUASRC)\lua.h $(PDCDEP) \
$(INCL)\nhlua.h $(O)utility.tag \
$(DAT)\data $(DAT)\rumors $(DAT)\oracles $(DAT)\engrave \
$(DAT)\epitaph $(DAT)\bogusmon $(GAMEDIR)\NetHack.exe \
$(GAMEDIR)\NetHackW.exe $(O)install.tag
@@ -932,6 +935,8 @@ install: $(LUASRC)\lua.h $(PDCDEP) $(INCL)\nhlua.h $(O)envchk.tag $(O)obj.tag $(
$(LUASRC)\lua.h:
git submodule init ../submodules/lua
git submodule update --remote ../submodules/lua
#
#aka PDCDEP
$(PDCURSES_TOP)\curses.h:
git submodule init ../submodules/pdcurses
git submodule update --remote ../submodules/pdcurses
@@ -944,12 +949,12 @@ CURLPDCSRC=https://github.com/wmcbrine/PDCurses/archive/refs/tags/3.9.zip
CURLPDCDST=pdcurses.zip
$(LUASRC)\lua.h:
cd ..\lib
cd $(LIBDIR)
curl -L $(CURLLUASRC) -o $(CURLLUADST)
tar -xvf $(CURLLUADST)
cd ..\src
$(PDCURSES_TOP)\curses.h:
cd ..\lib
cd $(LIBDIR)
curl -L $(CURLPDCSRC) -o $(CURLPDCDST)
if not exist pdcurses\*.* mkdir pdcurses
tar -C pdcurses --strip-components=1 -xvf $(CURLPDCDST)
@@ -1005,8 +1010,8 @@ GAMEOBJ=$(GAMEOBJ:^ =^
$(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)consoletty.o $(O)guistub.o \
$(ALLOBJ) $(TTYOBJ) $(O)date.o $(O)console.res \
$(LUATARGETS) $(PDCLIB)
$(ALLOBJ) $(CURSESOBJ) $(TTYOBJ) $(O)date.o $(O)console.res \
$(LUALIB) $(PDCLIB)
@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) $(conlflags) /STACK:2048 /PDB:$(GAMEDIR)\$(@B).PDB /MAP:$(O)$(@B).MAP \
@@ -1014,6 +1019,7 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)consoletty.o $(O)guistub
$(conlibs) $(BCRYPT) -out:$@ @<<$(@B).lnk
$(GAMEOBJ)
$(TTYOBJ)
$(CURSESOBJ)
$(O)consoletty.o
$(O)tile.o
$(O)guistub.o
@@ -1033,11 +1039,11 @@ $(GAMEDIR)\NetHack.exe : $(O)gamedir.tag $(O)tile.o $(O)consoletty.o $(O)guistub
$(GAMEDIR)\NetHackW.exe : $(O)gamedir.tag $(O)tile.o $(O)ttystub.o \
$(ALLOBJ) $(GUIOBJ) $(O)date.o $(O)NetHackW.res \
$(O)gamedir.tag \
$(LUATARGETS)
$(LUALIB)
@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) $(guilflags) /STACK:2048 /PDB:$(GAMEDIR)\$(@B).PDB \
/MAP:$(O)$(@B).MAP $(LIBS) $(PDCLIB) $(LUALIB) \
/MAP:$(O)$(@B).MAP $(LIBS) $(LUALIB) \
$(guilibs) $(COMCTRL) $(BCRYPT) -out:$@ @<<$(@B).lnk
$(GAMEOBJ)
$(GUIOBJ)
@@ -1053,7 +1059,7 @@ $(O)gamedir.tag:
@echo directory created > $@
$(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\oracles \
$(O)sp_lev.tag $(DLB)
$(DLB)
! IF ("$(USE_DLB)"=="Y")
copy nhdat$(NHV) $(GAMEDIR)
copy $(DAT)\license $(GAMEDIR)
@@ -1099,9 +1105,6 @@ recover: $(U)recover.exe
if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR)
if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt
$(O)sp_lev.tag:
echo sp_levs done > $(O)sp_lev.tag
$(O)utility.tag: $(INCL)\nhlua.h $(U)tile2bmp.exe $(U)makedefs.exe
@echo utilities made >$@
@echo utilities made.
@@ -1122,10 +1125,12 @@ $(O)NetHackW.res: $(SRC)\tiles.bmp $(MSWIN)\NetHackW.rc \
$(MSWIN)\mnselcnt.bmp $(MSWIN)\mnunsel.bmp \
$(MSWIN)\petmark.bmp $(MSWIN)\pilemark.bmp $(MSWIN)\NetHack.ico \
$(MSWIN)\rip.bmp $(MSWIN)\splash.bmp
@$(rc) -r -fo$@ -i$(MSWIN) -dNDEBUG $(MSWIN)\NetHackW.rc
@echo Building resource file $@ from $**
@$(rc) -nologo -r -fo$@ -i$(MSWIN) -dNDEBUG $(MSWIN)\NetHackW.rc
$(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
@$(rc) -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc
@echo Building resource file $@ from $**
@$(rc) -nologo -r -fo$@ -i$(MSWSYS) -dNDEBUG $(MSWSYS)\console.rc
#
# Secondary Targets.
@@ -1136,7 +1141,7 @@ $(O)console.res: $(MSWSYS)\console.rc $(MSWSYS)\NetHack.ico
#==========================================
$(U)nhsizes3.exe: $(O)nhsizes3.o
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic$(HOST).o $(O)alloc$(HOST).o
@$(link) $(lflagsBuild) -out:$@ $(O)nhsizes.o $(O)panic$(HOST).o $(O)alloc$(HOST).o
$(O)nhsizes3.o: $(CONFIG_H) nhsizes3.c
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) -Fo$@ nhsizes3.c
@@ -1163,7 +1168,7 @@ $(O)makedefs.o: $(U)makedefs.c $(SRC)\mdlib.c $(CONFIG_H) $(INCL)\permonst.h \
# We build a temporary Makefile on-the-fly for compiling date.c and
# invoke nmake again.
#
$(O)date.o: $(HACKINCL) $(HACKSRC) $(HACKOBJ) $(ALLOBJ)
$(O)date.o: $(HACKINCL) $(HACKSRC) $(HACKOBJ) $(ALLOBJ) $(CURSESOBJ)
!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
@@ -1209,66 +1214,75 @@ $(O)uudecode.o: $(SSYS)\uudecode.c
@$(cc) $(cflagsBuild) $(CROSSCOMPILE) /D_CRT_SECURE_NO_DEPRECATE -Fo$@ $(SSYS)\uudecode.c
$(MSWSYS)\NetHack.ico : $(U)uudecode.exe $(MSWSYS)\nhico.uu
chdir $(MSWSYS)
..\..\util\uudecode.exe nhico.uu
chdir ..\..\src
@chdir $(MSWSYS)
@..\..\util\uudecode.exe nhico.uu
@chdir ..\..\src
$(MSWIN)\NetHack.ico : $(U)uudecode.exe $(MSWSYS)\nhico.uu
chdir $(MSWIN)
..\..\util\uudecode.exe ../../sys/windows/nhico.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe ../../sys/windows/nhico.uu
@chdir ..\..\src
$(MSWIN)\mnsel.bmp: $(U)uudecode.exe $(MSWIN)\mnsel.uu
chdir $(MSWIN)
..\..\util\uudecode.exe mnsel.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe mnsel.uu
@chdir ..\..\src
$(MSWIN)\mnselcnt.bmp: $(U)uudecode.exe $(MSWIN)\mnselcnt.uu
chdir $(MSWIN)
..\..\util\uudecode.exe mnselcnt.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe mnselcnt.uu
@chdir ..\..\src
$(MSWIN)\mnunsel.bmp: $(U)uudecode.exe $(MSWIN)\mnunsel.uu
chdir $(MSWIN)
..\..\util\uudecode.exe mnunsel.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe mnunsel.uu
@chdir ..\..\src
$(MSWIN)\petmark.bmp: $(U)uudecode.exe $(MSWIN)\petmark.uu
chdir $(MSWIN)
..\..\util\uudecode.exe petmark.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe petmark.uu
@chdir ..\..\src
$(MSWIN)\pilemark.bmp: $(U)uudecode.exe $(MSWIN)\pilemark.uu
chdir $(MSWIN)
..\..\util\uudecode.exe pilemark.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe pilemark.uu
@chdir ..\..\src
$(MSWIN)\rip.bmp: $(U)uudecode.exe $(MSWIN)\rip.uu
chdir $(MSWIN)
..\..\util\uudecode.exe rip.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe rip.uu
@chdir ..\..\src
$(MSWIN)\splash.bmp: $(U)uudecode.exe $(MSWIN)\splash.uu
chdir $(MSWIN)
..\..\util\uudecode.exe splash.uu
chdir ..\..\src
@chdir $(MSWIN)
@..\..\util\uudecode.exe splash.uu
@chdir ..\..\src
#=================================================
# Create directory for holding object files
#=================================================
$(O)obj.tag:
$(O)objdir.tag:
@if not exist $(OBJ)\*.* echo creating directory $(OBJ:\=/)
@if not exist $(OBJ)\*.* mkdir $(OBJ)
@echo directory created >$@
#==================================================================
# Create directory for holding built libraries (among other things)
#==================================================================
$(O)libdir.tag:
@if not exist $(LIBDIR)\*.* echo creating directory $(LIB:\=/)
@if not exist $(LIBDIR)\*.* mkdir $(LIBDIR)
@echo directory created >$@
#==========================================
# Notify of any CL environment variables
# in effect since they change the compiler
# options.
#==========================================
$(O)envchk.tag: $(O)obj.tag
$(O)envchk.tag: $(O)objdir.tag
! IF "$(TARGET_CPU)"=="x64"
@echo Windows x64 64-bit target build
! ELSE
@@ -1284,7 +1298,8 @@ $(O)envchk.tag: $(O)obj.tag
# @echo Warning, the CL Environment variable is defined:
# @echo CL=$(CL)
! ENDIF
echo envchk >$@
@echo "cflags=$(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET)"
@echo envchk >$@
#==========================================
#=========== SECONDARY TARGETS ============
@@ -1294,18 +1309,18 @@ fetch-lua: fetch-actual-Lua
fetch-Lua: fetch-actual-Lua
fetch-actual-Lua:
@if not exist ..\lib\*.* mkdir ..\lib
cd ..\lib
@if not exist $(LIBDIR)\*.* mkdir $(LIBDIR)
cd $(LIBDIR)
curl -R -O http://www.lua.org/ftp/lua-$(LUAVER).tar.gz
tar zxf lua-$(LUAVER).tar.gz
if exist lua-$(LUAVER).tar.gz del lua-$(LUAVER).tar.gz
if exist lua-$(LUAVER).tar del lua-$(LUAVER).tar
cd ..\src
@echo Lua has been fetched into ..\lib\lua-$(LUAVER)
@echo Lua has been fetched into $(LIBDIR)\lua-$(LUAVER)
fetch-pdcurses:
@if not exist ..\lib\*.* mkdir ..\lib
cd ..\lib
@if not exist $(LIBDIR)\*.* mkdir $(LIBDIR)
cd $(LIBDIR)
curl -L -R https://codeload.github.com/wmcbrine/PDCurses/zip/master -o pdcurses.zip
powershell -command "Expand-Archive -Path .\pdcurses.zip -DestinationPath ./pdcurses-temp"
if exist .\pdcurses\* rd .\pdcurses /s /Q
@@ -1314,7 +1329,7 @@ fetch-pdcurses:
if exist .\pdcurses-temp\* rd .\pdcurses-temp /s /Q
if exist .\pdcurses.zip del .\pdcurses.zip
cd ..\src
@echo pdcurses has been fetched into ..\lib\pdcurses
@echo pdcurses has been fetched into $(LIBDIR)\pdcurses
#==========================================
# DLB utility and nhdatNNN file creation
@@ -1351,31 +1366,32 @@ $(DAT)\porthelp: $(MSWSYS)\porthelp
nhdat$(NHV): $(U)dlb.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) $(DAT)\quest.lua \
$(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp $(DAT)\keyhelp \
$(DAT)\history $(DAT)\opthelp $(DAT)\optmenu $(DAT)\wizhelp $(DAT)\porthelp \
$(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute $(O)sp_lev.tag
cd $(DAT)
echo data >dlb.lst
echo oracles >>dlb.lst
if exist options echo options >>dlb.lst
if exist ttyoptions echo ttyoptions >>dlb.lst
if exist guioptions echo guioptions >>dlb.lst
if exist porthelp echo porthelp >>dlb.lst
echo rumors >>dlb.lst
echo help >>dlb.lst
echo hh >>dlb.lst
echo cmdhelp >>dlb.lst
echo keyhelp >>dlb.lst
echo history >>dlb.lst
echo opthelp >>dlb.lst
echo optmenu >>dlb.lst
echo wizhelp >>dlb.lst
echo license >>dlb.lst
echo engrave >>dlb.lst
echo epitaph >>dlb.lst
echo bogusmon >>dlb.lst
echo tribute >>dlb.lst
for %%N in (*.lua) do echo %%N >>dlb.lst
$(U)dlb cIf dlb.lst $(SRC)\nhdat
cd $(SRC)
$(DAT)\license $(DAT)\engrave $(DAT)\epitaph $(DAT)\bogusmon $(DAT)\tribute
@echo Building $@
@cd $(DAT)
@echo data >dlb.lst
@echo oracles >>dlb.lst
@if exist options @echo options >>dlb.lst
@if exist ttyoptions @echo ttyoptions >>dlb.lst
@if exist guioptions @echo guioptions >>dlb.lst
@if exist porthelp @echo porthelp >>dlb.lst
@echo rumors >>dlb.lst
@echo help >>dlb.lst
@echo hh >>dlb.lst
@echo cmdhelp >>dlb.lst
@echo keyhelp >>dlb.lst
@echo history >>dlb.lst
@echo opthelp >>dlb.lst
@echo optmenu >>dlb.lst
@echo wizhelp >>dlb.lst
@echo license >>dlb.lst
@echo engrave >>dlb.lst
@echo epitaph >>dlb.lst
@echo bogusmon >>dlb.lst
@echo tribute >>dlb.lst
@for %%N in (*.lua) do @echo %%N >>dlb.lst
@$(U)dlb cIf dlb.lst $(SRC)\nhdat
@cd $(SRC)
#==========================================
# Recover Utility
@@ -1383,7 +1399,7 @@ nhdat$(NHV): $(U)dlb.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) $(DAT)\quest
$(U)recover.exe: $(RECOVOBJS)
@echo Linking $(@:\=/)
$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(RECOVOBJS)
@$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(RECOVOBJS)
$(O)recover.o: $(CONFIG_H) $(U)recover.c $(MSWSYS)\win32api.h
@$(cc) $(cflagsBuild) -Fo$@ $(U)recover.c
@@ -1510,8 +1526,9 @@ $(SRC)\x11tiles: $(U)tile2x11.exe $(WSHR)\monsters.txt $(WSHR)\objects.txt \
# PDCurses
#===============================================================================
$(O)pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS)
lib -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS)
$(LIBDIR)\pdcurses.lib : $(PDCLIBOBJS) $(PDCOBJS)
@echo Building library $@ from $**
@$(librarian) -nologo /out:$@ $(PDCLIBOBJS) $(PDCOBJS)
$(O)pdcscrn.o : $(PDCURSES_HEADERS) $(PDCWINCON)\pdcscrn.c $(MSWSYS)\stub-pdcscrn.c
@$(cc) $(PDCINCL) $(cflagsBuild) $(CROSSCOMPILE) $(CROSSCOMPILE_TARGET) -Fo$@ $(MSWSYS)\stub-pdcscrn.c
@@ -1521,16 +1538,20 @@ $(O)pdcscrn.o : $(PDCURSES_HEADERS) $(PDCWINCON)\pdcscrn.c $(MSWSYS)\stub-pdcscr
#===============================================================================
lua.exe: $(O)lua.o $(LUALIB)
link /OUT:$@ $(O)lua.o $(LUALIB)
@echo Linking $(@:\=/)
@$(link) /OUT:$@ $(O)lua.o $(LUALIB)
#luac.exe: $(O)luac.o $(LUALIB)
# link /OUT:$@ $(O)luac.o $(LUALIB)
# @echo Linking $(@:\=/)
# @$(link) /OUT:$@ $(O)luac.o $(LUALIB)
$(O)lua$(LUAVER).dll: $(LUAOBJFILES)
link /DLL /IMPLIB:lua$(LUAVER).lib /OUT:$@ $(LUAOBJFILES)
$(LIBDIR)\lua$(LUAVER).dll: $(LUAOBJFILES)
@echo Linking $(@:\=/)
@$(link) /DLL /IMPLIB:$(LIBDIR)\lua$(LUAVER).lib /OUT:$@ $(LUAOBJFILES)
$(O)lua$(LUAVER)-static.lib: $(LUAOBJFILES)
lib /OUT:$@ $(LUAOBJFILES)
$(LIBDIR)\lua$(LUAVER)-static.lib: $(LUAOBJFILES)
@echo Building library $@ from $**
@$(librarian) /OUT:$@ $(LUAOBJFILES)
$(O)lua.o: $(LUASRC)\lua.c
#$(O)luac.o: $(LUASRC)\luac.c
@@ -1729,11 +1750,10 @@ spotless: clean
if exist $(DAT)\engrave del $(DAT)\engrave
if exist $(DAT)\epitaph del $(DAT)\epitaph
if exist $(DAT)\bogusmon del $(DAT)\bogusmon
if exist $(DAT)\dlb.lst del $(DAT)\dlb.lst
if exist $(DAT)\porthelp del $(DAT)\porthelp
if exist $(O)sp_lev.tag del $(O)sp_lev.tag
if exist nhdat$(NHV). del nhdat$(NHV).
if exist $(O)obj.tag del $(O)obj.tag
if exist $(O)objdir.tag del $(O)objdir.tag
if exist $(O)libdir.tag del $(O)libdir.tag
if exist $(O)gamedir.tag del $(O)gamedir.tag
if exist $(O)nh*key.lib del $(O)nh*key.lib
if exist $(O)nh*key.exp del $(O)nh*key.exp
@@ -1752,8 +1772,9 @@ spotless: clean
if exist $(U)uudecode.exe del $(U)uudecode.exe
if exist $(U)dlb.exe del $(U)dlb.exe
!IF "$(ADD_CURSES)" == "Y"
if exist $(O)pdcurses.lib del $(O)pdcurses.lib
if exist $(PDCLIB) del $(PDCLIB)
!ENDIF
if exist $(LUALIB) del $(LUALIB)
if exist $(DAT)\oracles del $(DAT)\oracles
if exist $(DAT)\rumors del $(DAT)\rumors
if exist $(DAT)\options del $(DAT)\options
@@ -1770,21 +1791,22 @@ clean:
if exist $(SRC)\*.lnk del $(SRC)\*.lnk
if exist $(SRC)\*.map del $(SRC)\*.map
if exist $(O)install.tag del $(O)install.tag
if exist $(O)dlb.MAP del $(O)dlb.MAP
if exist $(O)dlb.PDB del $(O)dlb.PDB
if exist $(O)gamedir.tag del $(O)gamedir.tag
if exist $(O)makedefs.MAP del $(O)makedefs.MAP
if exist $(O)makedefs.PDB del $(O)makedefs.PDB
if exist $(O)NetHack.MAP del $(O)NetHack.MAP
if exist $(O)envchk.tag del $(O)envchk.tag
if exist $(O)obj.tag del $(O)obj.tag
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
if exist $(SRC)\tiles.bmp del $(SRC)\tiles.bmp
if exist $(O)console.res del $(O)console.res
if exist $(O)NetHack.res del $(O)NetHack.res
if exist $(O)NetHackW.res del $(O)NetHackW.res
if exist $(O)dlb.MAP del $(O)dlb.MAP
if exist $(DAT)\dlb.lst del $(DAT)\dlb.lst
if exist $(O)dlb.PDB del $(O)dlb.PDB
if exist $(O)gamedir.tag del $(O)gamedir.tag
if exist $(O)makedefs.MAP del $(O)makedefs.MAP
if exist $(O)makedefs.PDB del $(O)makedefs.PDB
if exist $(O)NetHack.MAP del $(O)NetHack.MAP
if exist $(O)envchk.tag del $(O)envchk.tag
if exist $(O)objdir.tag del $(O)objdir.tag
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
if exist $(SRC)\tiles.bmp del $(SRC)\tiles.bmp
if exist $(O)console.res del $(O)console.res
if exist $(O)NetHack.res del $(O)NetHack.res
if exist $(O)NetHackW.res del $(O)NetHackW.res
#===================================================================
# OTHER DEPENDENCIES

View File

@@ -1,15 +0,0 @@
/*
* Use this stub to insert a needed pragma prior
* to compiling $(PDCWINCON)\pdcscrn.c in the
* PDCurses distribution.
*
* We don't want to ask NetHack builders to
* modify the PDCurses distribution in any way,
* we only ask that they have the original intact
* PDCurses source tree available during the build.
*
*/
#pragma warning(disable : 4996)
#include "pdcscrn.c"

View File

@@ -198,4 +198,23 @@ set_keyhandling_via_option(void)
{
return 1;
}
#ifdef CURSES_GRAPHICS
struct window_procs curses_procs = {0};
int curses_read_attrs(const char *attrs)
{
return 0;
}
char *
curses_fmt_attrs(char *outbuf)
{
int attr = iflags.wc2_petattr;
outbuf[0] = '\0';
Sprintf(outbuf, "+unknown [%d]", attr);
return &outbuf[1];
}
#endif
#endif /* TTYSTUBS */