Install.nt and nhsetup.bat updates.

This commit is contained in:
nethack.allison
2002-03-02 17:19:27 +00:00
parent 38e60fa8d1
commit b8d702085f
2 changed files with 224 additions and 149 deletions

View File

@@ -4,25 +4,40 @@
Instructions for compiling and installing
NetHack 3.4 on a Windows NT, 2000, or XP system
==============================================================
Last revision: January 22, 2002
Last revision: March 2, 2002
{TODO: there are some TODO's in the text below to be resolved before release}
Credit for the porting of NetHack to the Win32 Console Subsystem goes to
the NT Porting Team started by Michael Allison.
Credit for the Win32 Graphical version of NetHack (aka Winhack or
Nethackw) goes to Alex Kompel who contributed the port.
Credit for the Win32 Graphical version of NetHack (aka
"NetHack for Windows" or Nethackw) goes to Alex Kompel who initially
developed and contributed the port.
The PC Windows porting team consisting of Michael Allison, Dave Cohrs,
Alex Kompel, Yitzhak Sapir, and Janet Walz integrated the tty version
and the graphical version into the NetHack 3.4.0 sources. Just as
the release of NetHack 3.4.0 was being prepared, Dion Nicolaas submitted
an entire win32 port of his own to the NetHack Development Team. Dion was
subsequently invited to join the PC Windows porting team where he could
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
version. In either case you will need:
version. In either case you will need one of the following build
environments:
o A copy of Microsoft Visual C V6.0 SP3 or later. Things may work with
an earlier version of the compiler, but the current code has not been
tested with an earlier compiler.
tested with an earlier version.
OR
o A copy of Borland C 5.5.1 command line tools. Borland has released its
command line tools to the public domain at
http://www.borland.com/bcppbuilder/freecompiler/.
o A version of a UUDECODE utility in your path. The Makefiles and
the VC Project files assume that a utility called uudecode.exe is
in your path. A version of uudecode.exe is required to be in
your path when you start the build process because 3 binary files
are distributed in uuencoded format and are required.
FIRST STEP:
@@ -37,22 +52,12 @@ For the graphical version (NetHackW)
cd sys\winnt
nhsetup WIN
The build subdirectory will be created off the top of the NetHack
source tree, and files appropriate for the selected build will be moved to the
appropriate place.
If you received some warning messages about not having
a uudecode utility, you must find a way to uudecode the following files
elsewhere and move the decoded version to its target directory:
win\win32\mnsel.uu ---> win\win32\mnsel.bmp
win\win32\mnunsel.uu ---> win\win32\mnunsel.bmp
sys\winnt\nhico.uu ---> win\win32\nethack.ico
(NOTE: The build directory is not part of the distribution.
It was created when you executed nhsetup.bat as part of
the FIRST STEP just above this.)
A "binary" directory will be created off the top of the NetHack source
tree to house the completed build for TTY and WIN.
If you specified "WIN", the build subdirectory will also be created off the
top of the NetHack source tree, and many files appropriate for that build
will be moved there.
If you wish to build the TTY version, proceed now to "BUILDING TTY VERSION."
If you wish to build the graphical version, proceed now to "BUILDING GRAPHICAL VERSION."
@@ -71,24 +76,24 @@ I. Dispelling the Myths:
as it looks, however it will behoove you to read this entire section
through before beginning the task.
We have provided a Makefile for building NetHack using the
following compiler:
We have provided a Makefile for each of the following compilers:
Microsoft Visual C++ V6.0 SP3 or greater
o Microsoft Visual C++ V6.0 SP3 or greater
o Borland C 5.5.1
The Makefile was created for use with MS NMAKE which is provided with
the Microsoft compiler.
The Microsoft Visual C Makefile was created for use with MS NMAKE
which is provided with the Microsoft compiler. The supplied Makefile
may work with earlier versions of the Microsoft 32-bit compiler, but
that has not been tested.
The supplied Makefile may work with earlier versions of the Microsoft
32-bit compiler, but that has not been tested.
The Borland C Makefile was created for use with Borland MAKE
which is provided with the Borland compiler.
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
required should you desire to make any changes to the level and dungeon
compilers.
To use the distributed NetHack icon, a version of uudecode is required
to decode sys\winnt\nhico.uu.
II. To compile your copy of NetHack on a 32 bit Windows machine (NT or 2000):
(Note: build has not been tested on Windows XP. That isn't to say that
@@ -99,12 +104,22 @@ Setting Up
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
necessary environment variables for the Microsoft compiler environment
are set correctly. ( For example, by executing vcvars32.bat, which
is probably in the bin directory of your compilers directory tree. )
are set correctly. ( Examples: For the Microsoft compiler by
executing vcvars32.bat, which is probably in the bin directory of
your compilers directory tree.)
For the Borland Makefile, you can simply
run the Makefile directory assuming all directories are properly set
in the Makefile's macro variables. For the standard Borland compiler
installation you can just run c:\borland\bcc55\bin\make)
2. Make sure all the NetHack files are in the appropriate directory
structure. You should have a main directory with subdirectories
dat, doc, include, src, sys\share, sys\winnt, util and win\tty.
dat, doc, include, src, sys\share, sys\winnt, util, win\tty, and
binary (The "binary" directory was created by nhsetup.bat earlier
if you followed the steps appropriately).
Other subdirectories may also be included in your distribution, but
they are not necessary for building the TTY version for the Win32
console subsystem. You can delete them to save space.
@@ -113,9 +128,9 @@ Setting Up
top
|
-------------------------------------------------
| | | | | | |
util dat doc include src sys win
----------------------------------------------------/ /-----
| | | | | | | |
util dat doc include src sys win binary
| |
------ -----
| | |
@@ -133,15 +148,7 @@ Setting Up
with them, so you may need to convert them. The compiler should not
have any problems with them however.
3. Go to the sys\winnt directory and run the nhsetup.bat batch file.
The necessary Makefile movements will be accomplished for you. It
will also verify that your directories are set up properly. It
will also attempt to uudecode the NetHack icon contained in the
file sys\winnt\nhico.uu. You must uudecode this file manually
if the batch file fails to do so, or if you have no uudecode
utility in your path.
4. Now go to the include subdirectory to check a couple of the header
3. Now go to the include subdirectory to check a couple of the header
files there. Things *should* work as they are, but since you have
probably set up your system in some sort of custom configuration
it doesn't hurt to check out the following:
@@ -149,39 +156,41 @@ Setting Up
First check config.h according to the comments to match your system and
desired set of features. Mostly you need to check the WIZARD option.
You may include all or as few of the special game features as you wish.
You may include all or as few of the special game features as you wish
(they are located last in the file).
5. Go to the src directory and edit the top of your Makefile.
Change the setting of (GAMEDIR) to reflect the directory where
you want NetHack to be installed.
4. Edit your Makefile.
ie. GAMEDIR = \games\nethackntty
For building the TTY version, ensure that GRAPHICAL is set to "N",
or commented out. (If you aren't building the TTY version, you are
currently reading the wrong section, and following the wrong set of
steps. In that case, you may wish to start reading from the top again.)
The directory you specify *MUST* exist for all remaining steps to be
successful. Be sure the directory you want the game installed
actually exists. If it doesn't, create it now. Do it before you forget:
mkdir \games\nethackntty
Optional:
Optional step:
If you elected not to use the high-quality BSD random number routines by
commenting out RANDOM in ntconf.h, comment out (or set equal
to nothing) the RANDOM macro in your Makefile.
commenting out RANDOM in ntconf.h, comment out (or set equal to nothing)
the RANDOM macro in your Makefile.
If you are recompiling after patching your sources, or if you got your
files from somewhere other than the official distribution, "touch
makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
lest potentially troublesome timestamps fool "nmake".
lest potentially troublesome timestamps fool your make (or nmake) utility.
Compiling
6. Now that everything is set up, and with your current directory set
to src (as instructed at the start of step 5), run "nmake install".
5. Now that everything is set up, change your current directory to src.
For Microsoft compiler:
nmake install
For Borland compiler:
make /f Makefile.bcc 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
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,
the longer the lunch you may take.
the longer the lunch you may take. :-)
In any case, it is likely that the command prompt window where you are
doing the compiling will be occupied for a while. If all goes well,
@@ -189,42 +198,49 @@ Compiling
Running NetHack
7. Make sure all of the support files -- Guidebook.txt, license,
6. Make sure all of the support files -- Guidebook.txt, license,
Defaults.nh, NetHack.exe, nhdat, and recover.exe -- were copied to the
game directory. If not, move them there yourself.
Edit Defaults.nh to reflect your particular setup and personal
preferences, by following the comments. As with all releases since
3.2.1, HACKDIR defaults to the same directory as that where the NetHack.exe
executable resides. You only need to set HACKDIR in Defaults.nh if,
3.2.1, HACKDIR defaults to the same directory as that where the NetHack.exe
executable resides. You only need to set HACKDIR in defaults.nh if,
for some reason, you wish to override that (be careful).
8a. Running from the command prompt:
7a. Running from the command prompt:
If you add the directory containing the NetHack executable
to your PATH, you can just type "nethack" or "nethack -umike"
to start it up. Alternatively, you can explicitly invoke it with
a command such as "c:\games\nethackntty\nethack" (specifying whatever
a command such as "c:\nethack\binary\nethack.exe" (specifying whatever
drive and directory your NetHack executable resides in) each time.
7b. Running from a Windows shortcut.
8b. Running from a Windows shortcut (win95 or NT4.x)
If you will be running it by launching it from program manager
or from a shortcut, just use the following information when
setting up the icon or shortcut.
If you will be running it by launching it from a shortcut, just
use the following information when setting up the shortcut.
Description : NetHack 3.4.0
Command Line : C:\GAMES\NETHACKNTTY\NETHACK.EXE
Command Line : C:\NETHACK\BINARY\NETHACK.EXE
(changing the directory to the appropriate one of course)
9. Play NetHack. If it works, you're done!
8. Play NetHack. If it works, you're done!
Notes:
1) To install an update of NetHack after changing something, enter "nmake"
from the src directory. If you add, delete, or reorder monsters or
1) To install an update of NetHack after changing something, change
your current directory to src and issue the appropriate command
for your compiler:
For Microsoft compiler:
nmake
For Borland compiler:
make /f Makefile.bcc
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.)
@@ -233,8 +249,9 @@ Notes:
to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the
util directory to ensure that they are remade.
2) The executable produced by this port is a 32-bit, flat-address space,
non-overlayed .exe file, which should run on any true Win32 environment.
2) The executable produced by the TTY build is a 32-bit, flat-address space,
non-overlayed .exe file, which should run on any true Win32 environment
with console I/O support.
------------------------------
@@ -246,23 +263,32 @@ This version of NetHack is a Win32 native port built on the Windows API.
I. Dispelling the Myths:
Compiling WIN32 is straightforward, as long as you have Visual C
correctly installed.
Compiling NetHack for Windows is straightforward, as long as you have
your compiler and tools correctly installed.
It is also assumed that you changed your directory to sys\winnt
and executed:
It is also assumed that you already changed your directory to
sys\winnt and executed:
nhsetup win
as described at the top of this document.
as described at the top of this document. If you didn't, you must
go back and do so before proceeding.
II. To compile your copy of NetHack on a Windows NT/2000/XP machine:
II. To compile your copy of NetHack for Windows on a
Windows NT/2000/XP machine:
Setting Up
1. It almost goes without saying that you should make sure that your tools
are set up and running correctly. (Examples: For the Microsoft Visual
Studio C compiler it should correctly fire up when you choose it in
your Start | Programs menus, and for Borland make sure that the compiler
is in your PATH)
2. Make sure all the NetHack files are in the appropriate directory
structure. You should have a main directory with subdirectories
dat, doc, include, src, sys\share, sys\winnt, util, win\win32,
and at this point, you should also have a build directory (created
by nhsetup.bat executed from sys\winnt.)
and at this point you should also have a build directory and a
binary directory (both created by nhsetup.bat executed from
sys\winnt earlier.)
Other subdirectories may also be included in your distribution, but
they are not necessary for building the graphical version of NetHack
@@ -290,58 +316,101 @@ Setting Up
Check the file "Files" in your top level directory for an exact
listing of what file is in which directory. In order for the
build process to work, all the source files must be in the proper
locations. Remember that nhsetup.bat moves many files around to
their intended locations.
locations. Remember that nhsetup.bat moves/copies many files around
to their intended locations for building NetHack.
3. Start the Visual C IDE. In the Visual C IDE Menus, choose:
File | Open Workspace
3. Ready your tool.
Microsoft compiler users, perform step 3a.
Borland compiler users, perform step 3b.
4. In the Visual C "Open Workspace" dialog box, navigate to the top
of your NetHack source directory.
a) Microsoft compiler:
Start the Visual C IDE. In the Visual C IDE Menus, choose:
File | Open Workspace
b) Borland compiler:
Chdir to the NetHack src directory:
chdir ../../src
if your current directory was still sys/winnt,
or:
chdir src
if your current directory was the top of the NetHack tree.
4. Set up for the build.
Microsoft compiler users, perform step 4a.
Borland compiler users, perform step 4b.
a) Microsoft compiler only:
o In the Visual C "Open Workspace" dialog box, navigate to the top
of your NetHack source directory.
In there, highlight "nethack.dsw" and click on Open.
In there, highlight "nethack.dsw" and click on Open.
Once the workspace has been opened, you should see the following
list in the Visual C selection window:
+ dgncomp files
+ dgnstuff files
+ dlb_main files
+ levcomp files
+ levstuff files
+ makedefs files
+ nethackw files
+ recover files
+ tile2bmp files
+ tilemap files
+ uudecode files
5. Once the workspace has been opened, you should see the following list
in the Visual C selection window:
+ dgncomp files
+ dgnstuff files
+ dlb_main files
+ levcomp files
+ levstuff files
+ makedefs files
+ nethackw files
+ recover files
+ tile2bmp files
+ tilemap files
o On the Visual C menus, choose:
Project | Set Active Project | nethackw
6. On the Visual C menus, choose:
Project | Set Active Project | nethackw
o On the Visual C menus again, choose either:
Build | Set Active Configuration | nethackw - Win32 Release
or
Build | Set Active Configuration | nethackw - Win32 Debug
7. On the Visual C menus again, choose either:
Build | Set Active Configuration | nethackw - Win32 Release
or
Build | Set Active Configuration | nethackw - Win32 Debug
The first will create the Release build of NetHackW which does
not contain all the debugging information and is smaller, and
runs quicker. The second will create the Debug build of NetHackW
and will spend a lot of time writing debug information to the disk
as the game is played. Unless you are debugging or enhancing NetHack
for Windows, choose the Release build.
o For Microsoft compiler build, you may now proceed to step 5.
b) Borland Compiler only:
o Edit the Makefile. Ensure the following are set correctly.
GRAPHICS should be set to "Y"
{TODO: put a list of other things to check in Makefile.bcc here}
Building
The first will create the Release build of NetHackW which does
not contain all the debugging information and is smaller, and
runs quicker. The second will create the Debug build of NetHackW.
Unless you are debugging NetHackW, choose the Release build.
5. Start your build.
Microsoft compiler users, perform step 5a.
Borland compiler users, perform step 5b.
8. On the Visual C menus once again, choose:
Build | Build nethackw.exe
a) Microsoft Compiler only:
o On the Visual C menus once again, choose:
Build | Build nethackw.exe
This starts the build. It is likely that the IDE message window
where you are doing the compiling will be occupied for a while.
If all goes well, you will get an NetHack executable called
nethackw.exe in the "binary" directory, along with all the support
files that it needs.
This starts the build. If all goes well, you will have a playable
game of netackw in the "binary" directory.
o For Microsoft compiler build, you may now proceed to step 6.
b) Borland Compiler only:
o With your current directory the NetHack src directory,
issue the following command:
make /f Makefile.bcc install
6. If all has gone well to this point, you should now have a playable
game of "NetHack for Windows" in the "binary" directory.
In any case, it is likely that the IDE message window where you are
doing the compiling will be occupied for a while. If all goes well,
you will get an NetHack executable called nethackw.exe in the "binary"
directory, along with all the support files that it needs.
Running NetHack
9. Make sure all of the support files -- Guidebook.txt, license,
Defaults.nh, nethackw.exe, nhdat, tiles.bmp, and recover.exe
7. Make sure all of the support files -- Guidebook.txt, license,
Defaults.nh, nethackw.exe, nhdat, and recover.exe
-- were copied to the binary directory.
(If not, find them in the tree and move them there yourself if they
exist. If they don't exist, something has gone wrong)
@@ -350,30 +419,29 @@ Running NetHack
preferences, by following the comments. As with all releases since
3.2.1, HACKDIR defaults to the same directory as that where the nethackw.exe
executable resides. You only need to set HACKDIR in Defaults.nh if,
for some reason, you wish to override that.
for some reason, you wish to override that (be careful).
10a. Running from the command prompt:
8. Running from the command prompt:
If you add the directory containing the NetHack executable
to your PATH,
You can just type "nethackw" to start it up. Alternatively, you
can explicitly invoke it with a command such as
"c:\games\nethack\nethackw" (specifying whatever drive and directory
your NetHack executable resides in) each time.
"c:\nethack\binary\nethackw.exe" (specifying whatever drive
and directory your NetHack executable resides in) each time.
10b. Running from a Windows shortcut (win95 or NT4.x)
9. Running from a Windows shortcut (win95 or NT4.x)
If you will be running it by launching it from program manager
or from a shortcut, just use the following information when
setting up the icon or shortcut.
Description : NetHack 3.4.0
Command Line : C:\GAMES\NETHACK\NETHACKW.EXE
Command Line : C:\NETHACK\BINARY\NETHACKW.EXE
(changing the directory in the Command Line to the appropriate one of course)
11. Play NetHack. If it works, you're done!
9. Play NetHack for Windows. If it works, you're done!
PROBLEMS
@@ -386,6 +454,6 @@ PROBLEMS
You may wish to vist the NetHack Development Team's website occasionally
to check for updates or known bugs. The website can be found at:
http://www.nethack.org
http://www.nethack.org/
Happy NetHacking!

View File

@@ -1,4 +1,4 @@
@REM SCCS Id: @(#)nhsetup.bat 2002/02/28
@REM SCCS Id: @(#)nhsetup.bat 2002/03/02
@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, see Install.nt for details
@@ -26,9 +26,14 @@ goto err_set
:do_tty
set opt=NetHack for NT Console
echo "Copying Makefile.NT to ..\..\src\Makefile"
copy makefile.NT ..\..\src\Makefile >nul
echo Makefile copied ok.
if NOT exist ..\..\binary\*.* mkdir ..\..\binary
if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
echo "Copying Makefile.nt to ..\..\src\Makefile"
copy Makefile.nt ..\..\src\Makefile >nul
echo Microsoft nmake Makefile copied ok.
echo "Copying Makefile.bcc to ..\..\src\Makefile.bcc"
copy Makefile.bcc ..\..\src\Makefile.bcc >nul
echo Borland make Makefile.bcc copied ok.
echo done!
echo.
echo Proceed with the next step documented in Install.nt
@@ -46,6 +51,8 @@ REM copy ..\..\win\win32\winnt.dsw ..\.. >nul
echo copy ..\..\win\win32\nethack.dsw ..\..
copy ..\..\win\win32\nethack.dsw ..\..
if NOT exist ..\..\binary\*.* mkdir ..\..\binary
if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
if NOT exist ..\..\build\*.* mkdir ..\..\build
copy ..\..\win\win32\dgncomp.dsp ..\..\build >nul
copy ..\..\win\win32\dgnstuff.dsp ..\..\build >nul
@@ -62,6 +69,10 @@ copy ..\..\win\win32\tiles.mak ..\..\build >nul
copy ..\..\win\win32\tilemap.dsp ..\..\build >nul
copy ..\..\win\win32\uudecode.dsp ..\..\build >nul
copy ..\..\win\win32\nethackw.dsp ..\..\build >nul
if NOT exist ..\..\src\Makefile.bcc goto dobor
copy ..\..\src\Makefile.bcc ..\..\src\Makefile.bcc-orig >nul
:dobor
copy Makefile.bcc ..\..\src\Makefile.bcc >nul
goto done
@@ -80,16 +91,15 @@ goto done
:err_dir
echo Your directories are not set up properly, please re-read the
echo documentation.
echo documentation and sys/winnt/Install.nt.
goto done
:err_set
echo.
echo Usage:
echo "%0 <TTY | win | CE >"
echo "%0 <tty | win>"
echo.
echo Run this batch file specifying one of the following:
echo tty, win, ce
echo Run this batch file specifying either "tty" or "win."
echo.
echo The tty argument is for preparing to build a console I/O TTY version
echo of NetHack.
@@ -97,9 +107,6 @@ echo.
echo The win argument is for preparing to build a graphical version
echo of NetHack.
echo.
echo The CE argument is for preparing to build a Windows CE version
echo of NetHack.
echo.
goto end
:done