some Makefile.mingw32 tweaking
This commit is contained in:
@@ -98,6 +98,7 @@ endif
|
|||||||
#
|
#
|
||||||
LUA_MAY_PROCEED=N
|
LUA_MAY_PROCEED=N
|
||||||
ADD_CURSES=N
|
ADD_CURSES=N
|
||||||
|
PDCURSES_TOP=
|
||||||
|
|
||||||
# First, Lua
|
# First, Lua
|
||||||
ifeq "$(INTERNET_AVAILABLE)" "Y"
|
ifeq "$(INTERNET_AVAILABLE)" "Y"
|
||||||
@@ -116,17 +117,14 @@ else # INTERNET_AVAILABLE not
|
|||||||
# precedence given to ../submodules, then ../lib.
|
# precedence given to ../submodules, then ../lib.
|
||||||
#
|
#
|
||||||
ifneq ("$(wildcard ../submodules/lua/lua.h)", "")
|
ifneq ("$(wildcard ../submodules/lua/lua.h)", "")
|
||||||
$(info Here- ../submodules/lua/lua.h)
|
|
||||||
LUATOP=../submodules/lua
|
LUATOP=../submodules/lua
|
||||||
LUASRC=$(LUATOP)
|
LUASRC=$(LUATOP)
|
||||||
LUA_MAY_PROCEED=Y
|
LUA_MAY_PROCEED=Y
|
||||||
else ifneq ("$(wildcard ../lib/lua-$(LUAVER)/src/lua.h)", "")
|
else ifneq ("$(wildcard ../lib/lua-$(LUAVER)/src/lua.h)", "")
|
||||||
$(info Here- ../lib/lua-$(LUAVER)/src/lua.h)
|
|
||||||
LUATOP = ../lib/lua-$(LUAVER)
|
LUATOP = ../lib/lua-$(LUAVER)
|
||||||
LUASRC = $(LUATOP)/src
|
LUASRC = $(LUATOP)/src
|
||||||
LUA_MAY_PROCEED=Y
|
LUA_MAY_PROCEED=Y
|
||||||
else
|
else
|
||||||
$(info NO MATCH)
|
|
||||||
endif # Lua sources
|
endif # Lua sources
|
||||||
ifeq "$(LUA_MAY_PROCEED)" "Y"
|
ifeq "$(LUA_MAY_PROCEED)" "Y"
|
||||||
$(info No internet connection was authorized in the Makefile,)
|
$(info No internet connection was authorized in the Makefile,)
|
||||||
@@ -139,7 +137,7 @@ ifneq "$(INTERNET_AVAILABLE)" "Y"
|
|||||||
$(info Your Makefile settings do not allow use of the internet to obtain Lua)
|
$(info Your Makefile settings do not allow use of the internet to obtain Lua)
|
||||||
endif # INTERNET_AVAILABLE
|
endif # INTERNET_AVAILABLE
|
||||||
$(info and no copy of Lua was found in either ../submodules/lua or ../lib/lua-$(LUAVER).)
|
$(info and no copy of Lua was found in either ../submodules/lua or ../lib/lua-$(LUAVER).)
|
||||||
$(info Change youf make command line to include:)
|
$(info Change your make command line to include:)
|
||||||
$(info GIT=1)
|
$(info GIT=1)
|
||||||
$(info or modify your Makefile to set the following:)
|
$(info or modify your Makefile to set the following:)
|
||||||
$(info INTERNET_AVAILABLE=Y)
|
$(info INTERNET_AVAILABLE=Y)
|
||||||
@@ -162,11 +160,10 @@ else # INTERNET_AVAILABLE is not Y below
|
|||||||
# the expected locations already, with precedence given to ../submodules,
|
# the expected locations already, with precedence given to ../submodules,
|
||||||
# then ../lib.
|
# then ../lib.
|
||||||
#
|
#
|
||||||
|
ifneq ("$(wildcard ../submodules/pdcurses/curses.h)", "")
|
||||||
ifeq (,$(wildcard ../submodules/pdcurses/curses.h))
|
|
||||||
PDCURSES_TOP=../submodules/pdcurses
|
PDCURSES_TOP=../submodules/pdcurses
|
||||||
ADD_CURSES=Y
|
ADD_CURSES=Y
|
||||||
else ifeq (,$(wildcard ../lib/pdcurses/curses.h))
|
else ifneq ("$(wildcard ../lib/pdcurses/curses.h)", "")
|
||||||
PDCURSES_TOP=../lib/pdcurses
|
PDCURSES_TOP=../lib/pdcurses
|
||||||
ADD_CURSES=Y
|
ADD_CURSES=Y
|
||||||
endif # pdcurses sources available somewhere
|
endif # pdcurses sources available somewhere
|
||||||
@@ -182,6 +179,19 @@ ifneq "$(ADD_CURSES)" "Y"
|
|||||||
$(info NetHack 3.7 will be built without support for the curses window-port.)
|
$(info NetHack 3.7 will be built without support for the curses window-port.)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq "$(INTERNET_AVAILABLE)" "Y"
|
||||||
|
ifeq "$(GIT_AVAILABLE)" "Y"
|
||||||
|
GIT_HASH := $(shell echo `git rev-parse --verify HEAD` 2>&1)
|
||||||
|
GIT_BRANCH := $(shell echo `git rev-parse --abbrev-ref HEAD` 2>&1)
|
||||||
|
ifdef GIT_HASH
|
||||||
|
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
|
||||||
|
endif
|
||||||
|
ifdef GIT_BRANCH
|
||||||
|
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
# The version of the game this Makefile was designed for
|
# The version of the game this Makefile was designed for
|
||||||
@@ -336,7 +346,7 @@ $(ULUADLL) $(LUAIMP): $(LUAOBJS) | $(OLUA)
|
|||||||
$(ld) $(LDFLAGS) -fPIC -shared -Wl,--export-all-symbols -Wl,--add-stdcall-alias \
|
$(ld) $(LDFLAGS) -fPIC -shared -Wl,--export-all-symbols -Wl,--add-stdcall-alias \
|
||||||
-Wl,--out-implib=$(LUAIMP) $^ -o$(ULUADLL)
|
-Wl,--out-implib=$(LUAIMP) $^ -o$(ULUADLL)
|
||||||
|
|
||||||
$(LUASTATIC): $(LUAOBJS) | $(OLUA)
|
$(LUASTATIC): $(LUAOBJS) | $(OLUA)
|
||||||
ar rcs $@ $^
|
ar rcs $@ $^
|
||||||
|
|
||||||
$(OLUA)/%.o: $(LUASRC)/%.c | $(OLUA)
|
$(OLUA)/%.o: $(LUASRC)/%.c | $(OLUA)
|
||||||
@@ -658,25 +668,21 @@ $(DLB): $(U)dlb.exe $(DLBLST) | $(GAMEDIR)
|
|||||||
CLEAN_DIR += $(ODLB)
|
CLEAN_DIR += $(ODLB)
|
||||||
CLEAN_FILE += $(DTARGETS) $(DLBOBJS) $(INCL)/date.h
|
CLEAN_FILE += $(DTARGETS) $(DLBOBJS) $(INCL)/date.h
|
||||||
|
|
||||||
#==========================================
|
#============================================
|
||||||
# Fetching other sources
|
# Fetching other source files that are needed
|
||||||
#==========================================
|
#============================================
|
||||||
|
|
||||||
ifeq "$(INTERNET_AVAILABLE)" "Y"
|
ifeq "$(INTERNET_AVAILABLE)" "Y"
|
||||||
ifeq "$(GIT_AVAILABLE)" "Y"
|
ifeq "$(GIT_AVAILABLE)" "Y"
|
||||||
|
|
||||||
fetchlua:
|
fetchlua:
|
||||||
mkdir -p ../lib
|
@if [ ! -f $(LUASRC)/lua.h ] ; then \
|
||||||
if [ ! -f "$(LUASRC)/lua.h" ]; then \
|
git submodule init ../submodules/lua && \
|
||||||
git submodule init ../submodules/lua; \
|
git submodule update --remote ../submodules/lua ; fi
|
||||||
git submodule update --remote ../submodules/lua; \
|
|
||||||
fi
|
|
||||||
fetchpdcurses:
|
fetchpdcurses:
|
||||||
mkdir -p ../lib
|
@if [ ! -f $(PDCURSES_TOP)/curses.h ] ; then \
|
||||||
if [ ! -f "$(PDCURSES_TOP)/curses.h" ]; then \
|
git submodule init ../submodules/pdcurses && \
|
||||||
git submodule init ../submodules/pdcurses; \
|
git submodule update --remote ../submodules/pdcurses ; fi
|
||||||
git submodule update --remote ../submodules/pdcurses; \
|
|
||||||
fi
|
|
||||||
else # GIT_AVAILABLE no
|
else # GIT_AVAILABLE no
|
||||||
CURLLUASRC=http://www.lua.org/ftp/lua-5.4.4.tar.gz
|
CURLLUASRC=http://www.lua.org/ftp/lua-5.4.4.tar.gz
|
||||||
CURLLUADST=lua-5.4.4.tar.gz
|
CURLLUADST=lua-5.4.4.tar.gz
|
||||||
@@ -685,21 +691,21 @@ CURLPDCSRC=https://github.com/wmcbrine/PDCurses/archive/refs/tags/3.9.zip
|
|||||||
CURLPDCDST=pdcurses.zip
|
CURLPDCDST=pdcurses.zip
|
||||||
|
|
||||||
fetchlua:
|
fetchlua:
|
||||||
mkdir -p ../lib
|
@if [ ! -f $(LUASRC)/lua.h ] ; then \
|
||||||
if [ ! -f "$(LUASRC)/lua.h" ]; then \
|
mkdir -p ../lib ; \
|
||||||
cd ../lib; \
|
cd ../lib ; \
|
||||||
curl -L $(CURLLUASRC) -o $(CURLLUADST); \
|
curl -L $(CURLLUASRC) -o $(CURLLUADST) ; \
|
||||||
/c/Windows/System32/tar -xvf $(CURLLUADST); \
|
/c/Windows/System32/tar -xvf $(CURLLUADST) ; \
|
||||||
cd ../src; \
|
cd ../src ; \
|
||||||
fi
|
fi
|
||||||
fetchpdcurses:
|
fetchpdcurses:
|
||||||
mkdir -p ../lib
|
mkdir -p ../lib
|
||||||
if [ ! -f "$(PDCURSES_TOP)/curses.h" ]; then \
|
@if [ ! -f $(PDCURSES_TOP)/curses.h ] ; then \
|
||||||
cd ../lib; \
|
cd ../lib ; \
|
||||||
curl -L $(CURLPDCSRC) -o $(CURLPDCDST); \
|
curl -L $(CURLPDCSRC) -o $(CURLPDCDST) ; \
|
||||||
mkdir -p pdcurses; \
|
mkdir -p pdcurses ; \
|
||||||
/c/Windows/System32/tar -C pdcurses --strip-components=1 -xvf $(CURLPDCDST); \
|
/c/Windows/System32/tar -C pdcurses --strip-components=1 -xvf $(CURLPDCDST) ; \
|
||||||
cd ../src; \
|
cd ../src ; \
|
||||||
fi
|
fi
|
||||||
endif # GIT_AVAILABLE
|
endif # GIT_AVAILABLE
|
||||||
endif # INTERNET_AVAILABLE
|
endif # INTERNET_AVAILABLE
|
||||||
@@ -749,7 +755,7 @@ $(ONHW)/%.o: $(SRC)/%.c $(NHLUAH) | $(ONHW)
|
|||||||
# to ensure that date.c is always recompiled again after anything else that
|
# to ensure that date.c is always recompiled again after anything else that
|
||||||
# was just recompiled. date.h is not used in the build of NetHack 3.7.
|
# was just recompiled. date.h is not used in the build of NetHack 3.7.
|
||||||
#
|
#
|
||||||
$(ONHW)/date.o: $(SRC)/date.c $(NHWOBJS)
|
$(ONHW)/date.o: $(SRC)/date.c $(NHWOBJS) | $(ONHW)
|
||||||
$(cc) $(CFLAGSW) $(GITHASH) $(GITBRANCH) $< -o$@
|
$(cc) $(CFLAGSW) $(GITHASH) $(GITBRANCH) $< -o$@
|
||||||
|
|
||||||
$(ONHW)/cppregex.o: $(SSYS)/cppregex.cpp $(NHLUAH) | $(ONHW)
|
$(ONHW)/cppregex.o: $(SSYS)/cppregex.cpp $(NHLUAH) | $(ONHW)
|
||||||
@@ -820,7 +826,7 @@ $(ONH)/%.o: $(SRC)/%.c $(NHLUAH) | $(ONH)
|
|||||||
# to ensure that date.c is always recompiled again after anything else that
|
# to ensure that date.c is always recompiled again after anything else that
|
||||||
# was just recompiled. date.h is not used in the build of NetHack 3.7.
|
# was just recompiled. date.h is not used in the build of NetHack 3.7.
|
||||||
#
|
#
|
||||||
$(ONH)/date.o: $(SRC)/date.c $(NHOBJS) $(NHRES)
|
$(ONH)/date.o: $(SRC)/date.c $(NHOBJS) $(NHRES) | $(ONH)
|
||||||
$(cc) $(CFLAGSNH) $(GITHASH) $(GITBRANCH) $< -o$@
|
$(cc) $(CFLAGSNH) $(GITHASH) $(GITBRANCH) $< -o$@
|
||||||
|
|
||||||
$(ONH)/cppregex.o: $(SSYS)/cppregex.cpp $(NHLUAH) | $(ONH)
|
$(ONH)/cppregex.o: $(SSYS)/cppregex.cpp $(NHLUAH) | $(ONH)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ OBJS4DEP = $(MOBJS) $(ROBJS) \
|
|||||||
$(TMOBJS) $(UOBJS) $(DLBOBJS) $(NHWOBJS) $(NHOBJS)
|
$(TMOBJS) $(UOBJS) $(DLBOBJS) $(NHWOBJS) $(NHOBJS)
|
||||||
DEP_TARGETS = $(OBJS4DEP:o=d)
|
DEP_TARGETS = $(OBJS4DEP:o=d)
|
||||||
|
|
||||||
depend: $(DEP_TARGETS)
|
depend: fetchlua fetchpdcurses $(DEP_TARGETS)
|
||||||
@cat $(DEP_TARGETS) > .depend
|
@cat $(DEP_TARGETS) > .depend
|
||||||
|
|
||||||
cleandep:
|
cleandep:
|
||||||
|
|||||||
Reference in New Issue
Block a user