(from <Someone>)

Here's the gcc makefile. I also cleaned up the batch file a
little and added instructions to install.nt.

I copied most of the items from the existing Makefiles,
including the 32x32 tile support, even though that is not
available. This way comparing the makefiles is easiest :-)
This commit is contained in:
nethack.allison
2002-03-07 13:01:17 +00:00
parent 364a4fa882
commit 2ca54bdc0d
2 changed files with 62 additions and 39 deletions

View File

@@ -25,7 +25,7 @@ continue to contribute to the win32 port, and that invitation was accepted.
You can build either the TTY version of NetHack or the Windows Graphical You can build either the TTY version of NetHack or the Windows Graphical
version. In either case you will need one of the following build version. In either case you can use one of the following build
environments: environments:
o A copy of Microsoft Visual C V6.0 SP3 or later. Things may work with o A copy of Microsoft Visual C V6.0 SP3 or later. Things may work with
@@ -39,6 +39,15 @@ environments:
registration at: registration at:
http://www.borland.com/bcppbuilder/freecompiler/. http://www.borland.com/bcppbuilder/freecompiler/.
Additionally, you can build a TTY version of NetHack with the following
build environment:
o A copy of MinGW 1.0. MinGW is a collection of header files and import
libraries with which native Windows32 programs can be made; MinGW 1.0
ships with the GNU Compiler Collection.
You can download MinGW at
http://www.mingw.org/
FIRST STEP: FIRST STEP:
@@ -80,6 +89,7 @@ I. Dispelling the Myths:
o Microsoft Visual C++ V6.0 SP3 or greater o Microsoft Visual C++ V6.0 SP3 or greater
o Borland C 5.5.1 o Borland C 5.5.1
o MinGW 1.0 with GCC 2.95.3-6
The Microsoft Visual C Makefile was created for use with MS NMAKE The Microsoft Visual C Makefile was created for use with MS NMAKE
which is provided with the Microsoft compiler. The supplied Makefile which is provided with the Microsoft compiler. The supplied Makefile
@@ -89,6 +99,9 @@ I. Dispelling the Myths:
The Borland C Makefile was created for use with Borland MAKE The Borland C Makefile was created for use with Borland MAKE
which is provided with the Borland compiler. which is provided with the Borland compiler.
The GCC Makefile was created for use with GNU Make version 3.79.1,
which comes with the MinGW package.
You may find it useful to obtain copies of lex (flex) and yacc (bison, You may find it useful to obtain copies of lex (flex) and yacc (bison,
or byacc). While not strictly necessary to compile nethack, they are or byacc). While not strictly necessary to compile nethack, they are
required should you desire to make any changes to the level and dungeon required should you desire to make any changes to the level and dungeon
@@ -104,12 +117,14 @@ Setting Up
1. It almost goes without saying that you should make sure that your tools 1. It almost goes without saying that you should make sure that your tools
are set up and running correctly. That includes ensuring that all the are set up and running correctly. That includes ensuring that all the
necessary environment variables for the compiler environment necessary environment variables for the compiler environment
are set correctly. ( Examples: For the Microsoft compiler by are set correctly. (Examples: For the Microsoft compiler by
executing vcvars32.bat, which is probably in the bin directory of executing vcvars32.bat, which is probably in the bin directory of
your compilers directory tree. For the Borland Makefile, you can your compilers directory tree. For the Borland Makefile, you can
simply invoke the Make utility from the Makefile's directory (For simply invoke the Make utility from the Makefile's directory (For
the standard Borland compiler installation you can just the standard Borland compiler installation you can just
use the explicit path "c:\borland\bcc55\bin\make /f Makefile.bcc") use the explicit path "c:\borland\bcc55\bin\make /f Makefile.bcc".
For the GCC Makefile, add <mingw>\bin to your path, where <mingw> is
your MinGW root directory.)
2. Make sure all the NetHack files are in the appropriate directory 2. Make sure all the NetHack files are in the appropriate directory
structure. You should have a main directory with subdirectories structure. You should have a main directory with subdirectories
@@ -183,7 +198,10 @@ Compiling
For Borland compiler: For Borland compiler:
make /f Makefile.bcc install make /f Makefile.bcc install
If you get any errors along the way then something has not been set For GCC:
make -f Makefile.gcc install
If you get any errors along the way then something has not been set
up correctly. The time it takes to compile depends on your particular up correctly. The time it takes to compile depends on your particular
machine of course, but you should be able to go for lunch and return machine of course, but you should be able to go for lunch and return
to find everything finished. The less memory, and slower your machine, to find everything finished. The less memory, and slower your machine,
@@ -239,10 +257,13 @@ Notes:
For Borland compiler: For Borland compiler:
make /f Makefile.bcc make /f Makefile.bcc
If you add, delete, or reorder monsters or For GCC:
objects, or you change the format of saved level files, delete any save make -f Makefile.gcc
and bones files. (Trying to use such files sometimes produces amusing
confusions on the game's part, but usually crashes.) If you add, delete, or reorder monsters or objects, or you change the
format of saved level files, delete any save and bones files. (Trying
to use such files sometimes produces amusing confusions on the game's
part, but usually crashes.)
If you made changes to any of the level compiler software, you may have If you made changes to any of the level compiler software, you may have
to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the

View File

@@ -1,54 +1,67 @@
@REM SCCS Id: @(#)nhsetup.bat 2002/03/06 @REM SCCS Id: @(#)nhsetup.bat 2002/03/07
@REM Copyright (c) NetHack PC Development Team 1993, 1996, 2002 @REM Copyright (c) NetHack PC Development Team 1993, 1996, 2002
@REM NetHack may be freely redistributed. See license for details. @REM NetHack may be freely redistributed. See license for details.
@REM Win32 setup batch file, see Install.nt for details @REM Win32 setup batch file, see Install.nt for details
@REM @REM
@echo off @echo off
set _opt=
set _donebor=
set _pause= set _pause=
:nxtcheck :nxtcheck
echo Checking to see if directories are set up properly echo Checking to see if directories are set up properly
if not exist ..\..\include\hack.h goto err_dir if not exist ..\..\include\hack.h goto :err_dir
if not exist ..\..\src\hack.c goto err_dir if not exist ..\..\src\hack.c goto :err_dir
if not exist ..\..\dat\wizard.des goto err_dir if not exist ..\..\dat\wizard.des goto :err_dir
if not exist ..\..\util\makedefs.c 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 ..\..\sys\winnt\winnt.c goto :err_dir
echo Directories look ok. echo Directories look ok.
:do_tty :do_tty
set _opt=NetHack for NT Console
if NOT exist ..\..\binary\*.* mkdir ..\..\binary if NOT exist ..\..\binary\*.* mkdir ..\..\binary
if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
echo Copying Microsoft Makefile - Makefile.msc to ..\..\src\Makefile. echo Copying Microsoft Makefile - Makefile.msc to ..\..\src\Makefile.
if NOT exist ..\..\src\Makefile goto :domsc
copy ..\..\src\Makefile ..\..\src\Makefile-orig >nul
echo Your existing
echo ..\..\src\Makefile
echo has been renamed to
echo ..\..\src\Makefile-orig
:domsc
copy Makefile.msc ..\..\src\Makefile >nul copy Makefile.msc ..\..\src\Makefile >nul
echo Microsoft Makefile copied ok. echo Microsoft Makefile copied ok.
echo Copying Borland Makefile - Makefile.bcc to ..\..\src\Makefile.bcc echo Copying Borland Makefile - Makefile.bcc to ..\..\src\Makefile.bcc
if NOT exist ..\..\src\Makefile.bcc goto dobor if NOT exist ..\..\src\Makefile.bcc goto :dobor
copy ..\..\src\Makefile.bcc ..\..\src\Makefile.bcc-orig >nul copy ..\..\src\Makefile.bcc ..\..\src\Makefile.bcc-orig >nul
echo Your existing echo Your existing
echo ..\..\src\Makefile.bcc echo ..\..\src\Makefile.bcc
echo has been renamed to echo has been renamed to
echo ..\..\src\Makefile.bcc-orig echo ..\..\src\Makefile.bcc-orig
echo Borland Makefile copied ok.
:dobor :dobor
copy Makefile.bcc ..\..\src\Makefile.bcc >nul copy Makefile.bcc ..\..\src\Makefile.bcc >nul
set _donebor=Y echo Borland Makefile copied ok.
echo Copying MinGW Makefile - Makefile.gcc to ..\..\src\Makefile.gcc
if NOT exist ..\..\src\Makefile.gcc goto :dogcc
copy ..\..\src\Makefile.gcc ..\..\src\Makefile.gcc-orig >nul
echo Your existing
echo ..\..\src\Makefile.gcc
echo has been renamed to
echo ..\..\src\Makefile.gcc-orig
:dogcc
copy Makefile.gcc ..\..\src\Makefile.gcc >nul
echo MinGW Makefile copied ok.
:do_win :do_win
set _opt=Graphical NetHack for Windows if not exist ..\..\win\win32\nethack.dsw goto :err_win
if not exist ..\..\win\win32\nethack.dsw goto err_win
echo. echo.
echo Copying Visual C project files to ..\..\build directory echo Copying Visual C project files to ..\..\build directory
REM copy ..\..\win\win32\winnt.dsw ..\.. >nul
echo Copying ..\..\win\win32\nethack.dsw ..\..\nethack.dsw echo Copying ..\..\win\win32\nethack.dsw ..\..\nethack.dsw
copy ..\..\win\win32\nethack.dsw ..\.. >nul copy ..\..\win\win32\nethack.dsw ..\.. >nul
if NOT exist ..\..\binary\*.* echo Creating ..\..\binary directory if NOT exist ..\..\binary\*.* echo Creating ..\..\binary directory
if NOT exist ..\..\binary\*.* mkdir ..\..\binary if NOT exist ..\..\binary\*.* mkdir ..\..\binary
if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
if NOT exist ..\..\build\*.* echo Creating ..\..\binary directory if NOT exist ..\..\build\*.* echo Creating ..\..\build directory
if NOT exist ..\..\build\*.* mkdir ..\..\build if NOT exist ..\..\build\*.* mkdir ..\..\build
copy ..\..\win\win32\dgncomp.dsp ..\..\build >nul copy ..\..\win\win32\dgncomp.dsp ..\..\build >nul
copy ..\..\win\win32\dgnstuff.dsp ..\..\build >nul copy ..\..\win\win32\dgnstuff.dsp ..\..\build >nul
@@ -65,35 +78,26 @@ copy ..\..\win\win32\tiles.mak ..\..\build >nul
copy ..\..\win\win32\tilemap.dsp ..\..\build >nul copy ..\..\win\win32\tilemap.dsp ..\..\build >nul
copy ..\..\win\win32\uudecode.dsp ..\..\build >nul copy ..\..\win\win32\uudecode.dsp ..\..\build >nul
copy ..\..\win\win32\nethackw.dsp ..\..\build >nul copy ..\..\win\win32\nethackw.dsp ..\..\build >nul
if "%_donebor%"=="Y" goto done
if NOT exist ..\..\src\Makefile.bcc goto dobor
copy ..\..\src\Makefile.bcc ..\..\src\Makefile.bcc-orig >nul
echo Your existing
echo ..\..\src\Makefile.bcc
echo has been renamed to
echo ..\..\src\Makefile.bcc-orig
:dobor
copy Makefile.bcc ..\..\src\Makefile.bcc >nul
goto done goto :done
:err_win :err_win
echo Some of the files needed to build graphical NetHack echo Some of the files needed to build graphical NetHack
echo for Windows are not in the expected places. echo for Windows are not in the expected places.
echo Check "Install.nt" for a list of the steps required echo Check "Install.nt" for a list of the steps required
echo to build NetHack. echo to build NetHack.
goto fini goto :fini
:err_data :err_data
echo A required file ..\..\dat\data.bas seems to be missing. echo A required file ..\..\dat\data.bas seems to be missing.
echo Check "Files." in the root directory for your NetHack distribution echo Check "Files." in the root directory for your NetHack distribution
echo and make sure that all required files exist. echo and make sure that all required files exist.
goto fini goto :fini
:err_dir :err_dir
echo Your directories are not set up properly, please re-read the echo Your directories are not set up properly, please re-read the
echo documentation and sys/winnt/Install.nt. echo documentation and sys/winnt/Install.nt.
goto fini goto :fini
:done :done
echo done! echo done!
@@ -103,8 +107,6 @@ echo.
:fini :fini
:end :end
set _opt=
set _donebor=
set _pause=Y set _pause=Y
if "%0"=="nhsetup" set _pause=N if "%0"=="nhsetup" set _pause=N
if "%0"=="NHSETUP" set _pause=N if "%0"=="NHSETUP" set _pause=N