add fetch
This commit is contained in:
74
sys/windows/vs/FetchPrereq/fetchprereq.nmake
Normal file
74
sys/windows/vs/FetchPrereq/fetchprereq.nmake
Normal file
@@ -0,0 +1,74 @@
|
||||
# NetHack 3.7 fetchprereq.nmake
|
||||
#==============================================================================
|
||||
#
|
||||
# The version of the game this Makefile was designed for
|
||||
NETHACK_VERSION="3.7.0"
|
||||
|
||||
# A brief version for use in macros
|
||||
NHV=$(NETHACK_VERSION:.=)
|
||||
NHV=$(NHV:"=)
|
||||
|
||||
# The version of Lua we want
|
||||
LUA_VERSION=5.4.6
|
||||
CURLLUASRC=https://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz
|
||||
CURLLUADST=lua-$(LUA_VERSION).tar.gz
|
||||
|
||||
# The version of pdcursesmod that we want
|
||||
PDCDIST=pdcursesmod
|
||||
PDCURSES_VERSION = 4.4.0
|
||||
PDCURL=https://github.com/Bill-Gray/PDCursesMod/archive/refs/tags/v
|
||||
CURLPDCSRC=$(PDCURL)$(PDCURSES_VERSION).zip
|
||||
CURLPDCDST=$(PDCDIST)
|
||||
|
||||
#
|
||||
# relative directories from root of NetHack tree.
|
||||
#
|
||||
|
||||
LIBSDIR=lib # libraries and external bits
|
||||
SUBMSDIR=submodules # NetHack git submodules
|
||||
ROOTDIR=..\..\..\.. # root of NetHack tree relative to project file
|
||||
LIBDIR=$(ROOTDIR)\$(LIBSDIR)
|
||||
SUBMDIR=$(ROOTDIR)\$(SUBMSDIR)
|
||||
|
||||
|
||||
default: fetchall
|
||||
|
||||
fetchall: libdir fetch-Lua fetch-pdcurses ..\..\..\..\include\nhlua.h
|
||||
|
||||
fetch-lua: fetch-actual-Lua
|
||||
|
||||
fetch-Lua: fetch-actual-Lua
|
||||
|
||||
fetch-actual-Lua:
|
||||
cd $(LIBDIR)
|
||||
curl --insecure -R -O $(CURLLUASRC)
|
||||
tar zxf lua-$(LUA_VERSION).tar.gz
|
||||
if exist lua-$(LUA_VERSION).tar.gz del lua-$(LUA_VERSION).tar.gz
|
||||
cd ..\sys\windows\vs\fetchprereq
|
||||
@echo Lua has been fetched into $(LIBDIR)\lua-$(LUA_VERSION)
|
||||
|
||||
fetch-pdcurses:
|
||||
cd $(LIBDIR)
|
||||
curl --insecure -L -R $(PDCURL)$(PDCURSES_VERSION).zip -o $(PDCDIST).zip
|
||||
if not exist $(PDCDIST)\*.* mkdir $(PDCDIST)
|
||||
tar -C $(PDCDIST) --strip-components=1 -xvf $(CURLPDCDST).zip
|
||||
if exist $(CURLPDCDST).zip del $(CURLPDCDST).zip
|
||||
cd ..\sys\windows\vs\fetchprereq
|
||||
@echo $(PDCDIST) has been fetched into $(LIBDIR)\$(PDCDIST)
|
||||
|
||||
..\..\..\..\include\nhlua.h:
|
||||
@echo /* nhlua.h - generated by Makefile from fetchprereq.nmake */ > $@
|
||||
@echo #include "lua.h" >> $@
|
||||
@echo LUA_API int (lua_error) (lua_State *L) NORETURN; >> $@
|
||||
@echo #include "lualib.h" >> $@
|
||||
@echo #include "lauxlib.h" >> $@
|
||||
@echo /*nhlua.h*/ >> $@
|
||||
|
||||
libdir:
|
||||
@if not exist $(LIBDIR)\*.* echo creating directory $(LIB:\=/)
|
||||
@if not exist $(LIBDIR)\*.* mkdir $(LIBDIR)
|
||||
|
||||
clean:
|
||||
|
||||
rebuild:
|
||||
|
||||
Reference in New Issue
Block a user