@REM  SCCS Id: @(#)nhsetup.bat  3.4     $Date: 2003/06/12 15:35:06 $
@REM  Copyright (c) NetHack PC Development Team 1993, 1996, 2002
@REM  NetHack may be freely redistributed.  See license for details. 
@REM  Win32 setup batch file for Falcon's Eye, see Install.nt
@REM
@echo off

set _pause=

:nxtcheck
echo Checking to see if 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\wizard.des goto :err_dir
if not exist ..\..\util\makedefs.c goto :err_dir
if not exist ..\..\sys\winnt\winnt.c goto :err_dir
if not exist ..\..\win\jtp\jtp_win.c goto err_dir
if not exist ..\..\win\jtp\gamedata\defaults.nh goto err_dir
if not exist ..\..\win\jtp\gamedata\config\jtp_opts.txt goto err_dir
if not exist ..\..\win\jtp\gamedata\graphics\jtp_nh_1.pcx goto err_dir
if not exist ..\..\win\jtp\gamedata\sound\nethack.mid goto err_dir
echo Directories look ok.

:do_tty
if NOT exist ..\..\compiled\*.* mkdir ..\..\compiled

echo Copying MSYS Makefile - Makefile.msys to ..\..\src\Makefile
if NOT exist ..\..\src\Makefile goto :domsys
copy ..\..\src\Makefile ..\..\src\Makefile-orig >nul
echo      Your existing
echo           ..\..\src\Makefile
echo      has been renamed to
echo           ..\..\src\Makefile-orig
:domsys
copy Makefile.msys ..\..\src\Makefile >nul
echo MSYS Makefile copied ok.

goto :done

:err_win
echo Some of the files needed to build graphical NetHack
echo for Windows are not in the expected places.
echo Check "Install.nt" for a list of the steps required 
echo to build NetHack.
goto :fini

:err_data
echo A required file ..\..\dat\data.bas seems to be missing.
echo Check "Files." in the root directory for your NetHack distribution
echo and make sure that all required files exist.
goto :fini

:err_dir
echo Your directories are not set up properly, please re-read the
echo documentation and sys/winnt/Install.nt.
goto :fini

:done
echo done!
echo.
echo Proceed with the next step documented in Install.nt 
echo.

:fini
:end
set _pause=Y
if "%0"=="nhsetup" set _pause=N
if "%0"=="NHSETUP" set _pause=N
if "%_pause%"=="Y" pause
set _pause=
