GNU make looks first for a file called GNUmakefile, ahead of looking for Makefile and then makefile. Renaming sys/windows/Makefile.mingw32 to sys/windows/GNUmakefile allows: o src/GNUmakefile (for use by GNU make) and src/Makefile (for use Microsoft nmake) to both reside in the src folder during build. o src/GNUmakefile will be used by GNU make, without having to explicitly specify "-f GNUmakefile" on the GNU make command line. o src/Makefile will be used by Microsoft nmake, without having to explicitly specify "-f Makefile" on the Microsoft nmake command line. For the gcc build, the movemement of sys/windows/GNUmakefile needs to be copied to src/GNUmakefile as part of the build process (see sys/windows/build-msys2.txt). For the Microsoft Visual Studio command line build with nmake, sys/windows/Makefile.nmake needs to be copied to src/Makefile as part of the build process (see sys/windows/build-nmake.txt). They are both copied to the src folder from their respective repository source file names when the nhsetup.bat file is used.
77 lines
2.4 KiB
Batchfile
Executable File
77 lines
2.4 KiB
Batchfile
Executable File
@REM NetHack 3.7 nhsetup.bat $NHDT-Date: 1596498315 2020/08/03 23:45:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.40 $ */
|
|
@REM Copyright (c) NetHack Development Team 1993-2024
|
|
@REM NetHack may be freely redistributed. See license for details.
|
|
@REM Win32 setup batch file, see Install.windows for details
|
|
@REM
|
|
@echo off
|
|
pushd %~dp0
|
|
set WIN32PATH=..\..\win\win32
|
|
set BINPATH=..\..\binary
|
|
set VCDir=
|
|
|
|
goto :main
|
|
|
|
:dirname
|
|
rem Get the dirname of the second argument and set the variable who's
|
|
rem name was specified in the first argument.
|
|
call set %~1=%%~dp2
|
|
call set %~1=%%%~1:~0,-1%%
|
|
goto :EOF
|
|
|
|
:main
|
|
|
|
echo Checking to see if source tree directories are set up properly...
|
|
if not exist ..\..\include\hack.h goto :err_dir
|
|
if not exist ..\..\src\hack.c goto :err_dir
|
|
if not exist ..\..\dat\wizard1.lua goto :err_dir
|
|
if not exist ..\..\util\makedefs.c goto :err_dir
|
|
if not exist ..\..\sys\windows\windsys.c goto :err_dir
|
|
if not exist ..\..\win\win32\mhmain.c goto :err_dir
|
|
echo Directories look ok.
|
|
|
|
:movemakes
|
|
echo Moving Makefiles into ..\..\src for those not using Visual Studio
|
|
REM Some file movement for those that still want to use MAKE or NMAKE and a Makefile
|
|
:do_tty
|
|
if NOT exist %BINPATH%\*.* mkdir %BINPATH%
|
|
if NOT exist %BINPATH%\license copy ..\..\dat\license %BINPATH%\license >nul
|
|
|
|
echo Copying Microsoft Makefile - Makefile.nmake to ..\..\src\Makefile
|
|
if NOT exist ..\..\src\Makefile goto donenmake
|
|
copy ..\..\src\Makefile ..\..\src\Makefile-orig >nul
|
|
echo Your existing
|
|
echo ..\..\src\Makefile
|
|
echo has been renamed to
|
|
echo ..\..\src\Makefile-orig
|
|
:donenmake
|
|
copy /Y Makefile.nmake ..\..\src\Makefile >nul
|
|
echo Microsoft nmake Makefile.nmake copy to ..\..\src\Makefile completed.
|
|
|
|
echo Copying mingw-w64 GNUmakefile to ..\..\src\GNUmakefile
|
|
copy /Y GNUmakefile ..\..\src\GNUmakefile >nul
|
|
echo Copying mingw-w64 GNUmakefile.depend to ..\..\src\GNUmakefile.depend
|
|
copy /Y GNUmakefile.depend ..\..\src\GNUmakefile.depend >nul
|
|
echo mingw-w64 Makefile copies to ..\..\src completed.
|
|
|
|
echo Done copying files.
|
|
goto :done
|
|
|
|
:err_dir
|
|
echo Your directories are not set up properly, please re-read the
|
|
echo documentation and sys/windows/Install.windows.
|
|
goto :fini
|
|
|
|
:done
|
|
echo done!
|
|
echo.
|
|
echo Proceed with the next step documented in Install.windows
|
|
echo.
|
|
|
|
:fini
|
|
:end
|
|
set _pause=N
|
|
for %%x in (%cmdcmdline%) do if /i "%%~x"=="/c" set _pause=Y
|
|
if "%_pause%"=="Y" pause
|
|
set _pause=
|
|
popd
|