From 14d55c5bdba177a1a6b8830bd173fdb7226ddb8d Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 14 Aug 2020 18:23:31 -0400 Subject: [PATCH] make sys/msdos/msdos-cross-compile.sh build msdos NetHack entirely - should work on linux or MacOS to build an msdos zipfile distribution - no longer requires env variables be set ahead of it because it will set some defaults within - you must have zip and unzip on your system though - you have to "make fetch-lua" first if you haven't already done that - script takes care of obtaining the djgpp-cross-compiler etc, then uses it to build msdos NetHack - to clean and rebuild from scratch: make -f sys/msdos/Makefile1.cross clean --- sys/msdos/Makefile1.cross | 3 ++- sys/msdos/msdos-cross-compile.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/msdos/Makefile1.cross b/sys/msdos/Makefile1.cross index 9bf2a52f5..eb62bd337 100644 --- a/sys/msdos/Makefile1.cross +++ b/sys/msdos/Makefile1.cross @@ -569,7 +569,8 @@ $(HOST_O)panic.o: $(CONFIG_H) $(U)panic.c #========================================== clean: - rm ./host_o/*.o + -rm $(HOBJ)/*.o + -rm ./msdos_o/*.o if [ -f $(HOST_O)prereq.tag ]; then rm $(HOST_O)prereq.tag; fi; if [ -f hobj.tag ]; then rm hobj.tag; fi; if [ -f $(HOST_O)utility.tag ]; then rm $(HOST_O)utility.tag; fi; diff --git a/sys/msdos/msdos-cross-compile.sh b/sys/msdos/msdos-cross-compile.sh index 6580664eb..fc3fc31db 100644 --- a/sys/msdos/msdos-cross-compile.sh +++ b/sys/msdos/msdos-cross-compile.sh @@ -7,6 +7,14 @@ else export DJGPP_TOP="$TRAVIS_BUILD_DIR/lib/djgpp" fi +if [ -z "$GCCVER" ]; then + export GCCVER=gcc1010 +fi + +if [ -z "$LUA_VERSION" ]; then + export LUA_VERSION=5.4.0 +fi + if [ ! -d "$(pwd)/lib" ]; then echo "Set up for Unix build and 'make fetch-lua' first." exit 1 @@ -17,9 +25,15 @@ DJGPP_URL="https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/" if [ "$(uname)" = "Darwin" ]; then #Mac DJGPP_FILE="djgpp-osx-$GCCVER.tar.bz2" + if [ -z "HINTS" ]; then + export HINTS=macOS.2020 + fi elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ]; then #Linux DJGPP_FILE="djgpp-linux64-$GCCVER.tar.bz2" + if [ -z "$HINTS" ]; then + export HINTS=linux.2020 + fi elif [ "$(expr substr $(uname -s) 1 10)" = "MINGW32_NT" ]; then #mingw DJGPP_FILE="djgpp-mingw-$GCCVER-standalone.zip"