cross-compiles need not build host native lua library

Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020
This commit is contained in:
nhmall
2020-10-11 09:08:27 -04:00
parent 3e66cbd781
commit 75f852f277
2 changed files with 7 additions and 3 deletions

View File

@@ -94,6 +94,7 @@ DATNODLB = $(VARDATND) license symbols
DATDLB = $(DATHELP) dungeon.lua tribute $(SPEC_LEVS) $(QUEST_LEVS) $(VARDATD)
DAT = $(DATNODLB) $(DATDLB)
TOPLUALIB = lib/lua/liblua.a
ALLDEP = $(GAME) recover Guidebook $(VARDAT) spec_levs check-dlb
# first target is also the default target for 'make' without any arguments
@@ -104,7 +105,7 @@ all: $(ALLDEP)
$(GAME): lua_support
( cd src ; $(MAKE) $(GAME) )
lua_support: lib/lua/liblua.a include/nhlua.h
lua_support: $(TOPLUALIB) include/nhlua.h
@true
lib/lua-$(LUA_VERSION)/src/liblua.a: lib/lua-$(LUA_VERSION)/src/lua.h
( cd lib/lua-$(LUA_VERSION)/src \
@@ -112,7 +113,7 @@ lib/lua-$(LUA_VERSION)/src/liblua.a: lib/lua-$(LUA_VERSION)/src/lua.h
lib/lua/liblua.a: lib/lua-$(LUA_VERSION)/src/liblua.a
@( if [ ! -d lib/lua ] ; then mkdir -p lib/lua ; fi )
cp lib/lua-$(LUA_VERSION)/src/liblua.a $@
include/nhlua.h: lib/lua/liblua.a
include/nhlua.h: $(TOPLUALIB)
echo '/* nhlua.h - generated by top Makefile */' > $@
@echo '#include "../lib/lua-$(LUA_VERSION)/src/lua.h"' >> $@
@sed -e '/(lua_error)/!d' -e '/(lua_error)/s/;/ NORETURN;/1' \
@@ -207,7 +208,7 @@ dlb:
( cd util ; $(MAKE) dlb )
( cd dat ; LC_ALL=C ; ../util/dlb cf nhdat $(DATDLB) )
wasm:
wasm: include/nhlua.h
( cd src ; $(MAKE) $(WASM_TARGET) )
package: $(GAME) recover $(VARDAT) spec_levs

View File

@@ -184,6 +184,7 @@ override SYSOBJ= $(TARGETPFX)pcmain.o $(TARGETPFX)msdos.o \
$(TARGETPFX)tileset.o $(TARGETPFX)tile.o
override WINLIB=
override LUALIB=
override TOPLUALIB=
override GAMEBIN = $(TARGETPFX)nethack.exe
override PACKAGE = dospkg
override PREGAME += mkdir -p $(TARGETDIR) ;
@@ -273,6 +274,7 @@ override SYSOBJ = $(TARGETPFX)amidos.o $(TARGETPFX)amigst.o \
# ../util/txt2iff.o
override WINLIB=
override LUALIB=
override TOPLUALIB=
override GAMEBIN = $(TARGETPFX)nethack
override PACKAGE = amigapkg
override PREGAME += mkdir -p $(TARGETDIR) ;
@@ -375,6 +377,7 @@ override SYSOBJ= $(TARGETPFX)libnethackmain.o \
$(TARGETPFX)winshim.o
override WINLIB = emranlib
override LUALIB=
override TOPLUALIB=
override REGEXOBJ = $(TARGETPFX)posixregex.o
override WINOBJ=
# don't bother Making regular NetHack executable