support use of git submodules with the Makefiles

git=1 when invoking make will use the submodule submodules/lua.

On windows, it will also use the submodule submodules/pdcurses.
This commit is contained in:
nhmall
2022-02-04 14:48:29 -05:00
parent 8499c71fcc
commit b8489de8eb
6 changed files with 381 additions and 78 deletions

View File

@@ -68,6 +68,17 @@ GAMEGRP = games
# you're reading this in Makefile augmented by hints, that may not be true).
#
ifeq "$(GIT)" "1"
ifndef GITSUBMODULES
GITSUBMODULES=1
endif
endif
ifeq "$(git)" "1"
ifndef GITSUBMODULES
GITSUBMODULES=1
endif
endif
#-INCLUDE multiw-2.370
# compiler.370 contains compiler detection and adjustments common
@@ -237,10 +248,21 @@ POSTINSTALL+= sed -i -e 's;^GDBPATH=/usr/bin/gdb;\#GDBPATH=/usr/bin/gdb;' \
-e 's;PANICTRACE_GDB=1;PANICTRACE_GDB=0;' $(INSTDIR)/sysconf;
endif
# Lua
# when building liblua.a, avoid warning that use of tmpnam() should be
# replaced by mkstemp(); the lua code doesn't use nethack's config.h so
# this needs to be passed via make rather than defined in unixconf.h
SYSCFLAGS=-DLUA_USE_POSIX
SYSCFLAGS=-DLUA_USE_LINUX
ifdef GITSUBMODULES
LUAFLAGS=CC='$(CC)' SYSCFLAGS='$(SYSCFLAGS)'
ifneq "$(CCISCLANG)" ""
# clang
LUAFLAGS +=CWARNGCC=''
endif # clang
override LUAHEADERS = submodules/lua
override LUA2NHTOP = ../..
override LUAMAKEFLAGS=$(LUAFLAGS)
endif # GITSUBMODULES
# Only needed for GLIBC stack trace:
LFLAGS=-rdynamic