Merge branch 'NetHack-3.7' into header-order3.7

This commit is contained in:
nhmall
2020-07-07 20:10:25 -04:00
23 changed files with 248 additions and 118 deletions

View File

@@ -1,4 +1,4 @@
# NetHack 3.6 Makefile.GCC $NHDT-Date: 1519600525 2018/02/25 23:15:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.34 $
# NetHack 3.6 Makefile.GCC $NHDT-Date: 1594155873 2020/07/07 21:04:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.51 $
# Copyright (c) NetHack PC Development Team 1996-2019.
# PC NetHack 3.6 Makefile for djgpp V2
#
@@ -38,11 +38,17 @@ GAMEDIR =../binary
ADD_CURSES=Y
PDCURSES_TOP=../../pdcurses
#---------------------------------------------------------------
ifeq "$(LUA_VERSION)" "5.3.5"
LUAVER=5.3.5
else
LUAVER=5.4.0
endif
#---------------------------------------------------------------
# Location of LUA
#
# Original source needs to be obtained from:
# http://www.lua.org/ftp/lua-5.3.5.tar.gz
# http://www.lua.org/ftp/lua-5.4.0.tar.gz
#
# This build assumes that the LUA sources are located
# at the specified location. If they are actually elsewhere
@@ -50,8 +56,7 @@ PDCURSES_TOP=../../pdcurses
# successfully build NetHack-3.7.
#
ADD_LUA=Y
LUATOP=../lib/lua535
LUATOP=../lib/lua$(subst .,, $(LUAVER))
#
#==============================================================================
# This marks the end of the BUILD DECISIONS section.
@@ -300,12 +305,12 @@ ALLOBJ = $(VOBJ) $(SOBJ) $(TILOBJ) $(TILOBJ2) $(VVOBJ)
#===============-=================================================
# LUA library
# Source from http://www.lua.org/ftp/lua-5.3.5.tar.gz
# Source from http://www.lua.org/ftp/lua-5.4.0.tar.gz
#=================================================================
LUASRC = $(LUATOP)/src
LUALIB = $(O)lua535s.a
LUADLL = $(O)lua535.a
LUALIB = $(O)lua$(subst .,, $(LUAVER))s.a
LUADLL = $(O)lua$(subst .,, $(LUAVER)).a
LUAINCL = -I$(LUASRC)
#LUAFLAGS = unix added -lm here?
LUATARGETS = lua.exe luac.exe $(LUADLL) $(LUALIB)
@@ -951,14 +956,14 @@ $(PATCHLEV_H):
lua.exe: $(O)lua.o $(LUALIB)
$(link) $(LFLAGS) -o$@ $(O)lua.o $(LUALIB)
luac.exe: $(O)luac.o $(O)lua535s.a
luac.exe: $(O)luac.o $(O)lua$(subst .,, $(LUAVER))s.a
$(link) $(LFLAGSU) -o$@ $(O)luac.o $(LUALIB)
$(O)lua535.a: $(LUAOBJFILES)
$(O)lua$(subst .,, $(LUAVER)).a: $(LUAOBJFILES)
$(cc) -shared -Wl,--export-all-symbols \
-Wl,--add-stdcall-alias -o $@ $<
$(O)lua535s.a: $(LUAOBJFILES)
$(O)lua$(subst .,, $(LUAVER))s.a: $(LUAOBJFILES)
ar rcS $@ $(LUAOBJFILES1)
ar rcS $@ $(LUAOBJFILES2)
ar rcs $@ $(LUAOBJFILES3)

View File

@@ -312,13 +312,19 @@ $(HOST_O)prereq.tag: $(INCL)/nhlua.h hobj.tag $(U)makedefs \
$(HOST_O)utility.tag $(DAT)/nhdat
echo prereq done >$@
ifeq "$(LUA_VERSION)" "5.3.5"
LUAVER=5.3.5
else
LUAVER=5.4.0
endif
$(INCL)/nhlua.h:
cd $(INCL); \
echo '/* nhlua.h - generated by Makefile1.cross */' > $@; \
echo '#include "../lib/lua-5.3.5/src/lua.h"' >> $@; \
sed -e '/(lua_error)/!d' -e '/(lua_error)/s/;/ NORETURN;/1' < $(LIB)/lua-5.3.5/src/lua.h >> $@; \
echo '#include "../lib/lua-5.3.5/src/lualib.h"' >> $@; \
echo '#include "../lib/lua-5.3.5/src/lauxlib.h"' >> $@; \
echo '#include "../lib/lua-$(LUAVER)/src/lua.h"' >> $@; \
sed -e '/(lua_error)/!d' -e '/(lua_error)/s/;/ NORETURN;/1' < $(LIB)/lua-$(LUAVER)/src/lua.h >> $@; \
echo '#include "../lib/lua-$(LUAVER)/src/lualib.h"' >> $@; \
echo '#include "../lib/lua-$(LUAVER)/src/lauxlib.h"' >> $@; \
echo '/*nhlua.h*/' >> $@; \
cd $(SRC)

View File

@@ -43,11 +43,17 @@ PDCURSES_TOP=../lib/pdcurses
# Set top of djgpp if not specified through ENV variables prior to make:
#DJGPP_TOP = $(HOME)/lib/djgpp
#---------------------------------------------------------------
ifeq "$(LUA_VERSION)" "5.3.5"
LUAVER=5.3.5
else
LUAVER=5.4.0
endif
#---------------------------------------------------------------
# Location of LUA
#
# Original source needs to be obtained from:
# http://www.lua.org/ftp/lua-5.3.5.tar.gz
# http://www.lua.org/ftp/lua-5.4.0.tar.gz
#
# This build assumes that the LUA sources are located
# at the specified location. If they are actually elsewhere
@@ -55,7 +61,7 @@ PDCURSES_TOP=../lib/pdcurses
# successfully build NetHack-3.7.
#
ADD_LUA=Y
LUATOP=../lib/lua-5.3.5
LUATOP=../lib/lua-$(LUAVER)
#
#
#==============================================================================
@@ -308,18 +314,18 @@ ALLOBJ = $(VOBJ) $(SOBJ) $(TILOBJ) $(TILOBJ2) $(VVOBJ)
ifeq "$(ADD_LUA)" "Y"
#===============-=================================================
# LUA library
# Source from http://www.lua.org/ftp/lua-5.3.5.tar.gz
# Source from http://www.lua.org/ftp/lua-5.4.0.tar.gz
#=================================================================
LUASRC = $(LUATOP)/src
LUALIB = $(O)lua535s.a
#LUADLL = $(O)lua535.a
LUALIB = $(O)lua$(subst .,, $(LUAVER))s.a
#LUADLL = $(O)lua$(subst .,, $(LUAVER)).a
LUAINCL = -I$(LUASRC)
#LUAFLAGS = unix added -lm here?
LUATARGETS = lua.exe luac.exe $(LUALIB)
#LUATARGETS = $(LUADLL) $(LUALIB)
LUASRCFILES = lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c \
LUASRCFILES = lapi.c lauxlib.c lbaselib.c lcode.c \
lcorolib.c lctype.c ldblib.c ldebug.c ldo.c \
ldump.c lfunc.c lgc.c linit.c liolib.c llex.c \
lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c \
@@ -327,7 +333,7 @@ LUASRCFILES = lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c \
ltable.c ltablib.c ltm.c lundump.c lutf8lib.c \
lvm.c lzio.c
LUAOBJFILES1 = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o $(O)lbitlib.o \
LUAOBJFILES1 = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o \
$(O)lcode.o $(O)lcorolib.o $(O)lctype.o $(O)ldblib.o
LUAOBJFILES2 = $(O)ldebug.o $(O)ldo.o $(O)ldump.o $(O)lfunc.o \
$(O)lgc.o $(O)linit.o $(O)liolib.o $(O)llex.o
@@ -336,7 +342,7 @@ LUAOBJFILES3 = $(O)lmathlib.o $(O)lmem.o $(O)loadlib.o $(O)lobject.o \
LUAOBJFILES4 = $(O)lstring.o $(O)lstrlib.o $(O)ltable.o $(O)ltablib.o \
$(O)ltm.o $(O)lundump.o $(O)lutf8lib.o $(O)lvm.o $(O)lzio.o
#LUAOBJFILES = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o $(O)lbitlib.o \
#LUAOBJFILES = $(O)lapi.o $(O)lauxlib.o $(O)lbaselib.o \
# $(O)lcode.o $(O)lcorolib.o $(O)lctype.o $(O)ldblib.o \
# $(O)ldebug.o $(O)ldo.o $(O)ldump.o $(O)lfunc.o \
# $(O)lgc.o $(O)linit.o $(O)liolib.o $(O)llex.o \
@@ -345,9 +351,13 @@ LUAOBJFILES4 = $(O)lstring.o $(O)lstrlib.o $(O)ltable.o $(O)ltablib.o \
# $(O)lstring.o $(O)lstrlib.o $(O)ltable.o $(O)ltablib.o \
# $(O)ltm.o $(O)lundump.o $(O)lutf8lib.o $(O)lvm.o $(O)lzio.o
LUALIBOBJS = $(LUAOBJFILES1) $(LUAOBJFILES2) $(LUAOBJFILES3) $(LUAOBJFILES4)
ifeq "$(LUAVER)" "5.3.5"
LUASRCFILES = $(LUASRCFILES) lbitlib.c
LUAOBJFILES1 = $(LUAOBJFILES1) $(O)lbitlib.o
endif
LUALIBOBJS = $(LUAOBJFILES1) $(LUAOBJFILES2) $(LUAOBJFILES3) $(LUAOBJFILES4)
endif
ifeq "$(ADD_CURSES)" "Y"
#==========================================
# PDCurses build macros