diff -Naurd ../nethack-3.3.1/sys/winnt/console.rc ./sys/winnt/console.rc
--- ../nethack-3.3.1/sys/winnt/console.rc Thu Jan 1 01:00:00 1970
+++ ./sys/winnt/console.rc Fri Mar 22 14:40:55 2002
@@ -0,0 +1,11 @@
+/*	SCCS Id: @(#)console.rc	3.4	2002/02/14			*/
+/* Copyright (c) Yitzhak Sapir, 2002. 					*/
+/* NetHack may be freely redistributed.  See license for details. 	*/
+
+#include "windows.h"
+
+1 ICON DISCARDABLE "NetHack.ICO"
+
+
+/*console.rc*/
+
diff -Naurd ../nethack-3.3.1/sys/winnt/defaults.nh ./sys/winnt/defaults.nh
--- ../nethack-3.3.1/sys/winnt/defaults.nh Thu Jan 1 01:00:00 1970
+++ ./sys/winnt/defaults.nh Fri Mar 22 14:40:55 2002
@@ -0,0 +1,145 @@
+# Sample config file for win32 NetHack
+# A '#' at the beginning of a line means the rest of the line is a comment.
+#
+# Some options MUST be set in this file, other options can be toggled while
+# playing.  For a list of options available see the <opthelp.> file.
+#
+# To change the configuration, comment out the unwanted lines, and
+# uncomment the configuration you want.
+
+# *** OPTIONS ***
+#
+# Use the IBM character set rather than just plain ascii characters
+# for tty window-port.
+OPTIONS=IBMGraphics
+
+# *** Personal Preferences ***
+# Some options to set personal preferences.  Uncomment and change these to
+# suit your personal preference.  If several people are to use the same
+# configuration, options like these should not be set.
+#
+#OPTIONS=name:Janet,role:Valkyrie,race:Human,gender:female,align:lawful
+#OPTIONS=dogname:Fido,catname:Morris,fruit:guava
+#OPTIONS=horsename:Silver
+#OPTIONS=autopickup,pickup_types:$"=/!?+
+#OPTIONS=packorder:")[%?+/=!(*0_`
+#OPTIONS=scores:10 top/2 around/own
+#OPTIONS=nolegacy,noverbose
+#OPTIONS=menustyle:traditional
+
+#
+# General options.  You might also set "silent" so as not to attract
+# the boss's attention.
+#
+OPTIONS=time,noshowexp,number_pad,lit_corridor,rest_on_space
+#
+# If you want to get rid of "use #quit to quit..." use:
+#OPTIONS=suppress_alert:3.3.1
+#
+# Set some options to control graphical window-port (these will
+# be safely and silently ignored by the tty port)
+#
+# Map window settings
+# possible map_mode options include: tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|
+#                                    ascii7x12|ascii8x12|ascii16x12|ascii12x16|
+#                                    ascii10x18|fit_to_screen
+OPTIONS=map_mode:tiles,scroll_margin:5
+
+# Message window settings
+OPTIONS=font_message:Arial,font_size_message:9,align_message:top
+
+# Menu settings
+OPTIONS=font_menu:Arial,font_size_menu:9
+
+# Text settings
+OPTIONS=font_text:Courier New,font_size_text:9
+
+# Status window settings
+OPTIONS=font_status:Courier New,font_size_status:10
+
+# Other
+OPTIONS=hilite_pet,!toptenwin
+#OPTIONS=!splash_screen,player_selection:prompts
+
+# Status/message window colors
+# Possible color options include:
+# six digit hexadecimal RGB color value ("#8F8F8F"), black, red, green, brown,
+# blue, magenta, cyan, gray (or grey), orange, brightgreen, yellow, brightblue,
+# brightmagenta, brightcyan, white, trueblack, purple, silver, maroon, fuchsia,
+# lime, olive, navy, teal, aqua, activeborder, activecaption, appworkspace,
+# background, btnface, btnshadow, btntext, captiontext, graytext, highlight,
+# highlighttext, inactiveborder, inactivecaption, menu, menutext, scrollbar,
+# window, windowframe, windowtext.
+#OPTIONS=windowcolors:status windowtext/window message windowtext/window
+
+#
+#HACKDIR=c:\games\nethack
+# 
+# Note: On Windows HACKDIR defaults to the location 
+#       of the NetHack.exe or NetHackw.exe file. 
+#       Setting HACKDIR above will override that.
+#
+#   LEVELS and SAVE default to HACKDIR
+#
+#LEVELS=c:\games\nethack\bones
+#SAVE=c:\games\nethack\bones
+
+# *** CHARACTER GRAPHICS ***
+#
+# See the on-line help or the Guidebook for which symbols are in which
+# positions.
+#
+# If you merely set the IBMgraphics option as above, NetHack will use IBM
+# extended ASCII for dungeon characters.  If you don't like the selections,
+# you can make up your own via these graphics options, but you should still
+# set IBMgraphics if you are using IBM graphics characters to get the correct
+# processing.
+#
+# ================================================
+# An example using the IBM graphics character set:
+#DUNGEON=  032 179 196 218 191 192 217 197 193 194 \
+#	   180 195 249 239 239 254 254 240 241 249 \
+#	   177 177 060 062 060 062 220 124 190 035 \
+#	   244 247 249 247 042 042 186 205 046 035 \
+#	   247
+#
+#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
+#	   094 094 094 094 232 232 232 157 094 094 \
+#	   094 094
+#
+#EFFECTS=  179 196 092 047 042 033 041 040	   \
+#	   048 035 064 042			   \
+#	   047 045 092 058 058 092 045 047	   \
+#	   047 045 092 058 032 058 092 045 047
+#
+# ================================================
+# Some alternatives:
+#DUNGEON=  032 186 205 201 187 200 188 206 202 203 \
+#	   185 204 249 239 239 254 254 240 241 249 \
+#	   177 177 060 062 060 062 095 124 092 035 \
+#	   244 247 249 247 042 042 179 196 046 035 \
+#	   247
+#
+#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
+#	   094 094 094 094 094 034 094 094 094 094 \
+#	   094 094
+
+# ================================================
+# Here is a recommendation sent in by Michael Feir
+# for use by blind NetHack players.
+#
+#DUNGEON=  032 124 045 124 124 124 124 045 045 045 \
+#          124 124 046 045 124 043 043 046 035 035 \
+#          060 062 060 062 095 092 035 126 126 126 \
+#          126 042 042 035 035 032 035 126
+#
+#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
+#          094 094 094 094 094 094 094 094 094 094 \
+#          094 094
+#
+#EFFECTS=  124 095 092 047 042 033 041 040         \
+#          048 035 064 042                         \
+#          047 045 092 058 058 092 045 047         \
+#          047 045 092 058 032 058 092 045 047
+
+
diff -Naurd ../nethack-3.3.1/sys/winnt/Install.nt ./sys/winnt/Install.nt
--- ../nethack-3.3.1/sys/winnt/Install.nt Thu Aug 3 21:53:11 2000
+++ ./sys/winnt/Install.nt Fri Mar 22 14:40:55 2002
@@ -1,74 +1,148 @@
-         Copyright (c) NetHack Development Team 1990-2000
+         Copyright (c) NetHack Development Team 1990-2002
          NetHack may be freely redistributed.  See license for details.
          ==============================================================
                     Instructions for compiling and installing
-             NetHack 3.3 on a Windows NT, 2000, or Windows 9x system
+                 NetHack 3.4 on a Windows NT, 2000, or XP system
          ==============================================================
-         (or, How to make NetHack 3.3.1 for the WIN32 Console subsystem)
-		      Last revision: August 2, 2000
+		      Last revision: March 2, 2002
 
-Credit for the PC versions of NetHack goes to the PC Development team
-of Paul Winner, Kevin Smolkowski, Michael Allison, Yitzhak Sapir, Bill
-Dyer, Timo Hakulinen, Yamamoto Keizo, Mike Threepoint, Mike Stephenson,
-Stephen White, Ken Washikita and Janet Walz.
+{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 
+"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 can use 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 version.
+		
+	OR
+
+  o A copy of Borland C 5.5.1 command line tools.  Borland has made a
+    version of its command line tools available for download after
+    registration at:
+    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:
+
+The first step in building either version of NetHack is to execute
+sys/winnt/nhsetup.bat.  
+
+From the command prompt:
+	cd sys\winnt
+	nhsetup
+
+From a Windows explorer window:
+	double-click on nhsetup.bat
+
+A "binary" directory will be created off the top of the NetHack source
+tree to house the completed build.
+
+A build subdirectory will also be created off the top of the NetHack 
+source tree, and many files appropriate for a graphical 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."
+
+
+------------------------
+| BUILDING TTY VERSION |
+------------------------
+
 This version of NetHack for Win32 is a tty port utilizing the WIN32 
 Console I/O subsystem.
 
 I.  Dispelling the Myths:
 
-    Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
-    however it will behoove you to read this entire file through before
-    beginning the task.
+    Compiling NetHack for WIN32 TTY is not as easy as it sounds, nor as hard 
+    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
+        o MinGW 1.0 with GCC 2.95.3-6
 
-    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.
+
+    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,
     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.
 
-II. To compile your copy of NetHack on a 32 bit Windows machine (NT or 95):
+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
+           it doesn't work, it just hasn't been tried by us.)
 
 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. )
+    necessary environment variables for the compiler environment
+    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 invoke the Make utility from the Makefile's directory (For 
+    the standard Borland compiler installation you can just 
+    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
     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.  Your distribution 
-    may contain a directory win\win32.  This window port variant was a
-    recent addition and was not ready for the 3.3.0 or 3.3.1  releases.
-    You may ignore it or contribute to it.
+    console subsystem.  You can delete them to save space.
 
     Required Directories for a Win32 Console NetHack:
 
                             top
                              |
-        ------------------------------------------------- 
-        |       |     |        |       |     |          | 
-       util    dat   doc    include   src   sys        win
+        ----------------------------------------------------/ /----- 
+        |       |     |        |       |     |          |        |
+       util    dat   doc    include   src   sys        win     binary
                                              |          |
                                           ------      ----- 
                                           |    |      |    
@@ -86,113 +160,338 @@
     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.
-
-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:
 
     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,
-    make sure the HACKDIR is set properly.
-
-    Also check COMPRESS.
-
-    You may include all or as few of the special game features as you wish.
+    desired set of features.  Mostly you need to check the WIZARD option.
 
-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.  
+    You may include all or as few of the special game features as you wish
+    (they are located last in the file).
 
-    ie.  GAMEDIR = \games\nethackntty
+4.  Edit your Makefile. 
 
-    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.
+    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.)
 
-    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.
+    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.
 
     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, run "nmake install".
+5.  Now that everything is set up, change your current directory to src.
 
-    If you get any errors along the way  then something has not been set 
+    For Microsoft compiler: 
+        nmake install
+
+    For Borland compiler:
+        make /f Makefile.bcc install
+
+    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 
     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 quite a while.  If all 
-    goes well, you will get an NetHack executable.
+    doing the compiling will be occupied for a while.  If all goes well, 
+    you will get an NetHack executable.
 
 Running NetHack
 
-7.  Make sure all of the support files -- Guidebook.txt, license, logfile,
-    Defaults.nh, NetHack.exe, nhdat, record, and recover.exe 
-    -- were copied to the game directory.  If not, move them there yourself.  
-    Defaults.nh is actually distributed in the sources as sys/winnt/winnt.cnf, 
-    but the Makefile should take care of moving it and renaming it correctly.
+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, 
-    for some reason, you wish to override that.
+    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:
+7. Executing the game
+
+    a) 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\nethack\nethack" (specifying whatever 
+    a command such as "c:\nethack\binary\nethack.exe" (specifying whatever 
     drive and directory your NetHack executable resides in) each time.
 
+    b) 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.3.1 
-         Command Line     :  C:\GAMES\NETHACK\NETHACK.EXE
+         Description      :  NetHack 3.4.0 
+         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
-    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.)
+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
+
+    For GCC:
+        make -f Makefile.gcc
+
+    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
     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. 
 
-3)  If you encounter a bug and wish to report it, please send e-mail to:
+
+------------------------------
+| BUILDING GRAPHICAL VERSION |
+------------------------------
+
+
+This version of NetHack is a Win32 native port built on the Windows API.
+
+I.  Dispelling the Myths:
+
+    Compiling NetHack for Windows is straightforward, as long as you have 
+    your compiler and tools correctly installed.  
+
+    It is also assumed that you already changed your directory to 
+    sys\winnt and executed:
+	nhsetup
+    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 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, or that you know where the make.exe executable resides.)
+
+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 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
+    (you can delete them to save space if you wish.)
+
+    Required Directories for a Win32 Graphical NetHack:
+
+                            top
+                             |
+        -----------------------------------------/ /--------------- 
+        |     |    |      |     |   |      |           |       |
+       util  dat  doc  include src sys    win        build    binary
+                                    |      |
+                                  ------   -----
+                                  |    |       |    
+                               share  winnt  win32
+ 
+    Those last two (build and binary) are created during the building
+    process.  They are not disributed as part of the NetHack source 
+    distribution.  nhsetup.bat creates the build directory and moves 
+    a few files into it, including the Visual C project files.
+    The "binary" directory will house everything you need to play the 
+    game after building is complete.
+
+    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/copies many files around
+    to their intended locations for building NetHack.
+
+    If you downloaded or ftp'd the sources from a UNIX system, the lines
+    will probably end in UNIX-style newlines, instead of the carriage
+    return and line feed pairs used by Windows.  Visual Studio project
+    files and workspace files (dsp and dsw files) in particular need to 
+    have their lines end in carriage-return-line-feed or they won't work
+    properly.
+
+3.  Ready your tool.
+    Microsoft compiler users, perform step 3a.
+    Borland compiler users, perform step 3b.
+
+    Note for Microsoft users: It's possible to build a graphical version
+    using the Makefile.  For simplicity's sake, however, only the Visual
+    C IDE build will be explained.  The IDE build has full game
+    functionality and is the officially released build.s
+
+    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.
+            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
+
+        o 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
+
+            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.
+          GRAPHICAL should be set to "Y"
+
+        o Ensure that all your tools directories are set up properly.
+          By default, your tools are assumed to be in the same
+          directory as the MAKE program.
+
+
+Building
+    
+5.  Start your build.
+    Microsoft compiler users, perform step 5a.
+    Borland compiler users, perform step 5b.
+
+    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.
+
+        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.
+ 
+
+Running NetHack
+
+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)
+
+    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 nethackw.exe 
+    executable resides.  You only need to set HACKDIR in Defaults.nh if, 
+    for some reason, you wish to override that (be careful).
+  
+8.  Executing the game
+    a) 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:\nethack\binary\nethackw.exe" (specifying whatever drive 
+    and directory your NetHack executable resides in) each time.
+
+    b) 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:\NETHACK\BINARY\NETHACKW.EXE
+
+   (changing the directory in the Command Line to the appropriate one of course)
+
+9. Play NetHack for Windows.  If it works, you're done!
+
+
+PROBLEMS
+
+    If you encounter a bug and wish to report it, please send e-mail to:
         nethack-bugs@nethack.org
 
     If you have any comments or suggestions, feel free to drop us a line c/o:
         DevTeam@nethack.org
+
+    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/
+
+    Happy NetHacking!
diff -Naurd ../nethack-3.3.1/sys/winnt/Makefile.bcc ./sys/winnt/Makefile.bcc
--- ../nethack-3.3.1/sys/winnt/Makefile.bcc Thu Jan 1 01:00:00 1970
+++ ./sys/winnt/Makefile.bcc Fri Mar 22 14:40:55 2002
@@ -0,0 +1,1311 @@
+#   SCCS Id: @(#)Makefile.bcc       3.4     2002/03/03
+#   Copyright (c) NetHack PC Development Team 1993-2002
+#
+#   NetHack 3.4.x Makefile for Borland C++ V5.5.1 and above and Borland's MAKE
+#  
+#   Win32 Compilers Tested:
+#                              - Borland C++ 5.5.1 for Win32
+#
+#   If you don't have this compiler, you can get it at:
+#       http://www.borland.com/bcppbuilder/freecompiler/
+#
+#   This makefile is set up to assume the directories are extracted at the
+#   root, but this can be changed by modifying the bccroot and related
+#   variables.
+#
+#   This is used for building a TTY or graphical version of NetHack using
+#   WIN32 Console I/O and API routines only.
+#
+#   In addition to your C compiler,
+#
+#     if you want to change     you will need a
+#     files with suffix               workalike for
+#              .y                          yacc   (such as bison)
+#              .l                           lex    (such as flex)
+#
+#
+#   If you have any questions read the sys/winnt/Install.nt file included 
+#   with the distribution.
+#
+#   --
+#       Yitzhak Sapir
+#==============================================================================
+# Do not delete the following 3 lines.
+#
+TARGETOS=BOTH
+APPVER=4.0
+
+bccbin = $(MAKEDIR)
+bccroot = $(MAKEDIR)\..
+bccinc = $(bccroot)\include
+bcclib = $(bccroot)\lib
+
+!IFNDEF APPVER
+APPVER = 4.0
+!ENDIF
+
+# Graphical interface
+# Set to Y for a graphical version
+# Set to anything else (or undefine) for a tty version
+
+#GRAPHICAL = Y
+
+# Debug
+# Set to Y for Debug support (to produce full map files, listing files, and debug information)
+# Set to anything else (or undefine) for a "release" version
+
+DEBUG = Y
+
+!IF "$(APPVER)" == "4.0"
+MAKE_WINVER = 0x0400
+!ELSEIF "$(APPVER)" == "5.0"
+MAKE_WINVER = 0x0500
+!ENDIF
+
+cc     = $(bccbin)\bcc32
+rc     = $(bccbin)\brc32
+link   = $(bccbin)\ilink32
+implib = $(bccbin)\tlib
+
+cflags = -c -D_X86_=1 -DWINVER=$(MAKE_WINVER) -q -I$(bccinc) -w-pia -w-rch -w-par -w-aus
+cdebug = -y -v -O2
+cvarsmt  = -DWIN32 -D_WIN32 -D_MT 
+lflags  = 
+!IF "$(DEBUG)" == "Y"
+linkdebug = /v /m /s 
+cdebug = -v -y -Q
+!ELSE
+linkdebug = /C /Gn
+cdebug =
+!ENDIF
+startobj = $(bcclib)\c0x32.obj
+!IF "$(GRAPHICAL)" == "Y"
+verlflags = /Gn /Gz /q -L$(bcclib) /c  /Tpe /V$(APPVER)
+startobjg = $(bcclib)\c0w32.obj
+!ELSE
+verlflags = /Gn /Gz /q -L$(bcclib) /c  /ap /Tpe /V$(APPVER)
+startobjg = $(startobj)
+!ENDIF
+libsmt  = $(bcclib)\cw32mt.lib $(bcclib)\import32.lib 
+
+#
+#  Set the gamedir according to your preference.  
+#  It must be present prior to compilation.
+
+GAME    = NetHack                 # Game Name
+GAMEDIR = ..\binary               # Game directory
+
+#
+#  Source directories.    Makedefs hardcodes these, don't change them.
+#
+
+INCL  = ..\include   # NetHack include files
+DAT   = ..\dat       # NetHack data files
+DOC   = ..\doc       # NetHack documentation files
+UTIL  = ..\util      # Utility source
+SRC   = ..\src       # Main source
+SSYS  = ..\sys\share # Shared system files
+NTSYS = ..\sys\winnt # NT Win32 specific files
+TTY   = ..\win\tty   # window port files (tty)
+WIN32 = ..\win\win32 # window port files (Win32)
+WSHR  = ..\win\share # Tile support files 
+
+#
+#  Object directory.
+#
+
+OBJ     = o
+
+
+#
+#==========================================
+# Exe File Info.
+#==========================================
+ 
+# Yacc/Lex ... if you got 'em.
+#
+# If you have yacc and lex programs (or work-alike such as bison 
+# and flex), comment out the upper two macros and uncomment 
+# the lower two.
+#
+
+DO_YACC = YACC_MSG
+DO_LEX  = LEX_MSG
+#DO_YACC  = YACC_ACT
+#DO_LEX   = LEX_ACT
+
+# - Specify your yacc and lex programs (or work-alikes) here.
+
+YACC	= bison -y
+#YACC   = byacc
+#YACC	= yacc
+
+#LEX	= lex
+LEX	= flex
+
+#
+# - Specify your flex skeleton file (if needed).
+#
+
+FLEXSKEL =
+#FLEXSKEL = -S../tools/flex.ske
+
+YTABC   = y.tab.c
+YTABH   = y.tab.h
+LEXYYC  = lex.yy.c
+
+#
+# Optional high-quality BSD random number generation routines
+# (see pcconf.h). Set to nothing if not used.
+#
+
+RANDOM	= $(OBJ)\random.o
+#RANDOM	=
+
+#
+# - For debugging ability, comment out the upper two 
+#   macros and uncomment the lower two.
+#
+
+#
+#  Leave the next two lines uncommented _ONLY_ if you do NOT want any
+#  debug capability in the object files, or in the NetHack executable.
+#  Comment them if you want debug capability.
+
+#cdebug =
+#linkdebug =
+
+#
+# Compiler and Linker flags
+#
+
+PRECOMPHEAD = N			# set to Y if you want to use precomp. headers
+
+#===============================================
+#======= End of Modification Section ===========
+#===============================================
+################################################
+#                                              #
+# Nothing below here should have to be changed.#
+#                                              #
+################################################
+
+!IF "$(GRAPHICAL)" == "Y"
+WINPORT  = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
+	$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
+	$(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
+	$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
+WINPFLAG   = -DTILES -DMSWIN_GRAPHICS
+NHRES   = $(O)winhack.res
+WINPINC  = -I$(WIN32)
+WINPHDR   = $(WIN32)\mhaskyn.h $(WIN32)\mhdlg.h $(WIN32)\mhfont.h \
+	$(WIN32)\mhinput.h $(WIN32)\mhmain.h $(WIN32)\mhmap.h $(WIN32)\mhmenu.h \
+	$(WIN32)\mhmsg.h $(WIN32)\mhmsgwnd.h $(WIN32)\mhrip.h $(WIN32)\mhstatus.h \
+	$(WIN32)\mhtext.h $(WIN32)\resource.h $(WIN32)\winMS.h
+!ELSE
+WINPORT  = $(O)nttty.o    
+WINPFLAG   = -DWIN32CON
+WINPHDR   =
+NHRES   = $(O)console.res
+WINPINC  =
+!ENDIF
+
+TILEUTIL16  = $(UTIL)\tile2bmp.exe
+TILEBMP16   = $(SRC)\tiles.bmp
+
+TILEUTIL32  = $(UTIL)\til2bm32.exe
+TILEBMP32   = $(SRC)\tiles32.bmp
+
+# These should be left commented in 3.4.x
+#
+
+#SOUND = $(OBJ)\ntsound.o
+#SOUND =
+
+# To store all the level files,
+# help files, etc. in a single library file.
+# USE_DLB = Y is left uncommented
+
+USE_DLB = Y
+
+! IF ("$(USE_DLB)"=="Y")
+DLBFLG = -DDLB
+! ELSE
+DLBFLG =
+! ENDIF
+
+# You can actually build a set of tiles 
+# with this makefile even though they 
+# are not used. Use 'nmake o\nhtiles.bmp'
+#
+
+#==========================================
+# Setting up the compiler and linker
+# macros. All builds include the base ones.
+#==========================================
+
+CFLAGSBASE  = -c $(cflags) $(cvarsmt) -I$(INCL) $(WINPINC) -q $(cdebug) -v
+LFLAGSBASE  = $(linkdebug) $(verlflags) -L$(bcclib) -v
+
+#==========================================
+# Util builds
+#==========================================
+
+CFLAGSU = $(CFLAGSBASE) $(WINPFLAG)
+LFLAGSU	= $(LFLAGSBASE)
+
+#==========================================
+# - Game build
+#==========================================
+
+LFLAGSBASE = $(linkdebug) $(conflags) 
+CFLAGS	 = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG)
+NHLFLAGS1 = /Gn /v /m /s /Gz /q /c
+lflags	= $(LFLAGSBASE) $(NHLFLAGS1)
+
+GAMEFILE = $(FDIR)\$(GAME).exe # whole thing
+
+! IF ("$(USE_DLB)"=="Y")
+DLB = nhdat
+! ELSE
+DLB =
+! ENDIF
+
+#==========================================
+#================ RULES ==================
+#==========================================
+
+.SUFFIXES: .exe .o .til .uu .c .y .l
+
+#==========================================
+# Rules for files in src
+#==========================================
+
+.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -o$@ $<
+
+{$(SRC)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)   -o$@  $<
+
+#==========================================
+# Rules for files in sys\share
+#==========================================
+
+{$(SSYS)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+#==========================================
+# Rules for files in sys\winnt
+#==========================================
+
+{$(NTSYS)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+{$(NTSYS)}.h{$(INCL)}.h:
+	@copy $< $@
+
+#==========================================
+# Rules for files in util
+#==========================================
+
+{$(UTIL)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGSU) -o$@ $<
+
+#==========================================
+# Rules for files in win\share
+#==========================================
+
+{$(WSHR)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -o$@ $<
+
+{$(WSHR)}.h{$(INCL)}.h:
+	@copy $< $@
+
+#{$(WSHR)}.txt{$(DAT)}.txt:
+#	@copy $< $@
+
+#==========================================
+# Rules for files in win\tty
+#==========================================
+
+{$(TTY)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+#==========================================
+# Rules for files in win\win32
+#==========================================
+
+{$(WIN32)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+#==========================================
+#================ MACROS ==================
+#==========================================
+# This section creates shorthand macros for many objects
+# referenced later on in the Makefile.
+#
+
+DEFFILE = $(NTSYS)\$(GAME).def
+
+#
+# Shorten up the location for some files
+#
+
+O  = $(OBJ)^\
+
+U  = $(UTIL)^\
+
+#
+# Utility Objects.
+#
+
+MAKESRC        = $(U)makedefs.c
+
+SPLEVSRC       = $(U)lev_yacc.c	$(U)lev_$(LEX).c $(U)lev_main.c  $(U)panic.c
+
+DGNCOMPSRC     = $(U)dgn_yacc.c	$(U)dgn_$(LEX).c $(U)dgn_main.c
+
+MAKEOBJS       = $(O)makedefs.o $(O)monst.o $(O)objects.o
+
+SPLEVOBJS      = $(O)lev_yacc.o	$(O)lev_$(LEX).o $(O)lev_main.o \
+		 $(O)alloc.o	$(O)decl.o	$(O)drawing.o \
+		 $(O)monst.o	$(O)objects.o	$(O)panic.o
+
+DGNCOMPOBJS    = $(O)dgn_yacc.o	$(O)dgn_$(LEX).o $(O)dgn_main.o \
+		 $(O)alloc.o	$(O)panic.o
+
+RECOVOBJS      = $(O)recover.o
+
+TILEFILES      = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
+
+#
+# These are not invoked during a normal game build in 3.4.0
+#
+TEXT_IO        = $(O)tiletext.o	$(O)tiletxt.o	$(O)drawing.o \
+		 $(O)decl.o	$(O)monst.o	$(O)objects.o
+
+GIFREADERS     = $(O)gifread.o	$(O)alloc.o $(O)panic.o
+
+PPMWRITERS     = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
+
+#
+#  Object files for the game itself.
+#
+
+VOBJ01 = $(O)allmain.o  $(O)alloc.o    $(O)apply.o    $(O)artifact.o
+VOBJ02 = $(O)attrib.o   $(O)ball.o     $(O)bones.o    $(O)botl.o    
+VOBJ03 = $(O)cmd.o      $(O)dbridge.o  $(O)decl.o     $(O)detect.o  
+VOBJ04 = $(O)dig.o      $(O)display.o  $(O)do.o       $(O)do_name.o 
+VOBJ05 = $(O)do_wear.o  $(O)dog.o      $(O)dogmove.o  $(O)dokick.o  
+VOBJ06 = $(O)dothrow.o  $(O)drawing.o  $(O)dungeon.o  $(O)eat.o     
+VOBJ07 = $(O)end.o      $(O)engrave.o  $(O)exper.o    $(O)explode.o 
+VOBJ08 = $(O)extralev.o $(O)files.o    $(O)fountain.o $(O)hack.o    
+VOBJ09 = $(O)hacklib.o  $(O)invent.o   $(O)light.o    $(O)lock.o    
+VOBJ10 = $(O)mail.o     $(O)makemon.o  $(O)mapglyph.o $(O)mcastu.o  
+VOBJ11 = $(O)mhitm.o    $(O)mhitu.o    $(O)minion.o   $(O)mklev.o   
+VOBJ12 = $(O)mkmap.o    $(O)mkmaze.o   $(O)mkobj.o    $(O)mkroom.o  
+VOBJ13 = $(O)mon.o      $(O)mondata.o  $(O)monmove.o  $(O)monst.o   
+VOBJ14 = $(O)monstr.o   $(O)mplayer.o  $(O)mthrowu.o  $(O)muse.o    
+VOBJ15 = $(O)music.o    $(O)o_init.o   $(O)objects.o  $(O)objnam.o  
+VOBJ16 = $(O)options.o  $(O)pager.o    $(O)pickup.o   $(O)pline.o   
+VOBJ17 = $(O)polyself.o $(O)potion.o   $(O)pray.o     $(O)priest.o  
+VOBJ18 = $(O)quest.o    $(O)questpgr.o $(RANDOM)      $(O)read.o    
+VOBJ19 = $(O)rect.o     $(O)region.o   $(O)restore.o  $(O)rip.o     
+VOBJ20 = $(O)rnd.o      $(O)role.o     $(O)rumors.o   $(O)save.o    
+VOBJ21 = $(O)shk.o      $(O)shknam.o   $(O)sit.o      $(O)sounds.o  
+VOBJ22 = $(O)sp_lev.o   $(O)spell.o    $(O)steal.o    $(O)steed.o   
+VOBJ23 = $(O)teleport.o $(O)timeout.o  $(O)topten.o   $(O)track.o   
+VOBJ24 = $(O)trap.o     $(O)u_init.o   $(O)uhitm.o    $(O)vault.o   
+VOBJ25 = $(O)vis_tab.o  $(O)vision.o   $(O)weapon.o   $(O)were.o    
+VOBJ26 = $(O)wield.o    $(O)windows.o  $(O)wizard.o   $(O)worm.o    
+VOBJ27 = $(O)worn.o     $(O)write.o    $(O)zap.o     
+
+DLBOBJ = $(O)dlb.o
+
+TTYOBJ = $(O)topl.o     $(O)getline.o  $(O)wintty.o
+
+SOBJ   = $(O)winnt.o    $(O)pcsys.o      $(O)pcunix.o  \
+	   $(SOUND) $(O)pcmain.o	$(O)mapimail.o $(O)nhlan.o
+
+OBJS   = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
+         $(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
+         $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
+         $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
+         $(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
+         $(VOBJ26) $(VOBJ27)
+
+TILOBJ = $(WINPORT)
+
+VVOBJ  = $(O)version.o
+
+ALLOBJ  = $(TILOBJ) $(SOBJ) $(DLBOBJ)  $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
+
+
+!IF "$(GRAPHICAL)" == "Y"
+OPTIONS_FILE = $(DAT)\guioptions
+!ELSE
+OPTIONS_FILE = $(DAT)\ttyoptions
+!ENDIF
+#==========================================
+# Header file macros
+#==========================================
+
+CONFIG_H = $(INCL)\config.h $(INCL)\config1.h $(INCL)\tradstdc.h \
+		$(INCL)\global.h $(INCL)\coord.h $(INCL)\vmsconf.h \
+		$(INCL)\system.h $(INCL)\unixconf.h $(INCL)\os2conf.h \
+		$(INCL)\micro.h $(INCL)\pcconf.h $(INCL)\tosconf.h \
+		$(INCL)\amiconf.h $(INCL)\macconf.h $(INCL)\beconf.h \
+		$(INCL)\ntconf.h $(INCL)\nhlan.h
+
+HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h \
+		$(INCL)\dungeon.h $(INCL)\monsym.h $(INCL)\mkroom.h \
+		$(INCL)\objclass.h $(INCL)\youprop.h $(INCL)\prop.h \
+		$(INCL)\permonst.h $(INCL)\monattk.h \
+		$(INCL)\monflag.h $(INCL)\mondata.h $(INCL)\pm.h \
+		$(INCL)\wintype.h $(INCL)\decl.h $(INCL)\quest.h \
+		$(INCL)\spell.h $(INCL)\color.h $(INCL)\obj.h \
+		$(INCL)\you.h $(INCL)\attrib.h $(INCL)\monst.h \
+		$(INCL)\skills.h $(INCL)\onames.h $(INCL)\timeout.h \
+		$(INCL)\trap.h $(INCL)\flag.h $(INCL)\rm.h \
+		$(INCL)\vision.h $(INCL)\display.h $(INCL)\engrave.h \
+		$(INCL)\rect.h $(INCL)\region.h $(INCL)\winprocs.h \
+		$(INCL)\wintty.h $(INCL)\trampoli.h
+
+LEV_H       = $(INCL)\lev.h
+DGN_FILE_H  = $(INCL)\dgn_file.h
+LEV_COMP_H  = $(INCL)\lev_comp.h
+SP_LEV_H    = $(INCL)\sp_lev.h
+TILE_H      = ..\win\share\tile.h
+
+#==========================================
+# Miscellaneous
+#==========================================
+
+DATABASE = $(DAT)\data.base
+
+#
+#  The name of the game.
+#
+
+GAMEFILE = $(GAMEDIR)\$(GAME).exe
+
+#==========================================
+#=============== TARGETS ==================
+#==========================================
+
+#
+#  The default make target (so just typing 'nmake' is useful).
+#
+default : $(GAMEFILE)
+
+#
+#  The main target.
+#
+
+$(GAME): $(O)obj.tag $(O)utility.tag graphicschk $(GAMEFILE)
+	@echo $(GAME) is up to date.
+
+#
+#  Everything
+#
+
+all :	install
+
+install: graphicschk $(GAME) $(O)install.tag
+	 @echo Done.
+
+$(O)install.tag: 	$(DAT)\data	$(DAT)\rumors	 $(DAT)\dungeon \
+	 	$(DAT)\oracles	$(DAT)\quest.dat $(O)sp_lev.tag $(DLB)
+! IF ("$(USE_DLB)"=="Y")
+	copy nhdat                $(GAMEDIR)
+	copy $(DAT)\license       $(GAMEDIR)
+! ELSE
+	copy $(DAT)\*.            $(GAMEDIR)
+	copy $(DAT)\*.dat         $(GAMEDIR)
+	copy $(DAT)\*.lev         $(GAMEDIR)
+	if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
+! ENDIF
+	if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
+	if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
+	if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt
+	@if exist $(SRC)\$(GAME).PDB copy $(SRC)\$(GAME).pdb $(GAMEDIR)\$(GAME).pdb
+	@if exist $(GAMEDIR)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space
+	-copy $(NTSYS)\defaults.nh   $(GAMEDIR)\defaults.nh
+	copy $(U)recover.exe  $(GAMEDIR)
+	echo install done > $@
+
+#	copy $(NTSYS)\winnt.hlp    $(GAMEDIR)
+
+$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des  $(DAT)\castle.des \
+	$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des   \
+	$(DAT)\medusa.des  $(DAT)\oracle.des   $(DAT)\tower.des  \
+	$(DAT)\yendor.des  $(DAT)\arch.des     $(DAT)\barb.des   \
+	$(DAT)\caveman.des $(DAT)\healer.des   $(DAT)\knight.des \
+	$(DAT)\monk.des    $(DAT)\priest.des   $(DAT)\ranger.des \
+	$(DAT)\rogue.des   $(DAT)\samurai.des  $(DAT)\sokoban.des \
+	$(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des
+	cd $(DAT)
+	$(U)lev_comp bigroom.des
+	$(U)lev_comp castle.des
+	$(U)lev_comp endgame.des
+	$(U)lev_comp gehennom.des
+	$(U)lev_comp knox.des
+	$(U)lev_comp mines.des
+	$(U)lev_comp medusa.des
+	$(U)lev_comp oracle.des
+	$(U)lev_comp sokoban.des
+	$(U)lev_comp tower.des
+	$(U)lev_comp yendor.des
+	$(U)lev_comp arch.des
+	$(U)lev_comp barb.des
+	$(U)lev_comp caveman.des
+	$(U)lev_comp healer.des
+	$(U)lev_comp knight.des
+	$(U)lev_comp monk.des
+	$(U)lev_comp priest.des
+	$(U)lev_comp ranger.des
+	$(U)lev_comp rogue.des
+	$(U)lev_comp samurai.des
+	$(U)lev_comp tourist.des
+	$(U)lev_comp valkyrie.des
+	$(U)lev_comp wizard.des
+	cd $(SRC)
+	echo sp_levs done > $(O)sp_lev.tag
+
+$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \
+		$(SRC)\monstr.c		$(SRC)\vis_tab.c  \
+		$(U)lev_comp.exe	$(INCL)\vis_tab.h \
+		$(U)dgn_comp.exe $(U)recover.exe  $(TILEUTIL16)
+             @echo utilities made >$@
+	     @echo utilities made.
+
+tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe
+	@echo Optional tile development utilities are up to date.
+
+!IF "$(GRAPHICAL)"=="Y"
+$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
+	$(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp \
+	$(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp \
+	$(WIN32)\splash.bmp
+	@$(rc) -r -fo$@ -i$(WIN32) -i$(bccinc) -dNDEBUG $(WIN32)\winhack.rc
+!ELSE
+$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
+	@$(rc) -r -fo$@ -i$(NTSYS) -i$(bccinc) -dNDEBUG $(NTSYS)\console.rc
+!ENDIF
+
+#==========================================
+#  The main target.
+#==========================================
+
+$(SRC)\uuid.lib: $(bcclib)\uuid.lib
+	@copy $(bcclib)\uuid.lib $@
+
+$(GAMEFILE) : $(ALLOBJ) $(NHRES) $(SRC)\uuid.lib
+	@echo Linking....
+	@$(link) $(lflags) $(startobjg) $(ALLOBJ), $@, $(GAME).map,$(libsmt),,$(NHRES)
+	@if exist $(O)install.tag del $(O)install.tag
+	@if exist $(GAMEDIR)\$(GAME).bak del $(GAMEDIR)\$(GAME).bak
+
+$(GAME)_.ico : $(NTSYS)\$(GAME).ico
+	@copy $(NTSYS)\$(GAME).ico $@
+
+#==========================================
+# Create directory for holding object files
+#==========================================
+
+$(O)obj.tag:
+	@if not exist $(O)*.* mkdir $(OBJ)
+	@echo directory $(OBJ) created >$@
+
+#==========================================
+# Notify of any CL environment variables
+# in effect since they change the compiler
+# options.
+#==========================================
+
+graphicschk:
+!	IF "$(GRAPHICAL)"=="Y"
+	   @echo ----
+	   @echo NOTE: This build will include tile support.
+	   @echo ----
+!	ENDIF
+	@echo graphicschk > graphicschk
+
+#
+#  Secondary Targets.
+#
+    
+#==========================================
+# Makedefs Stuff
+#==========================================
+
+$(U)makedefs.exe:	$(O)obj.tag $(MAKEOBJS) $(SRC)\uuid.lib
+	@$(link) $(LFLAGSU) $(startobj) $(MAKEOBJS), $@,,$(libsmt)
+
+$(O)makedefs.o: $(CONFIG_H)	$(INCL)\monattk.h $(INCL)\monflag.h   $(INCL)\objclass.h \
+		 $(INCL)\monsym.h    $(INCL)\qtext.h	$(INCL)\patchlevel.h \
+		 $(U)makedefs.c
+	@$(cc) $(CFLAGSU) -o$@ $(U)makedefs.c
+
+#
+#  date.h should be remade every time any of the source or include
+#  files is modified.
+#
+
+$(INCL)\date.h $(OPTIONS_FILE) : $(U)makedefs.exe
+	$(U)makedefs -v
+
+$(INCL)\onames.h : $(U)makedefs.exe
+	$(U)makedefs -o
+
+$(INCL)\pm.h : $(U)makedefs.exe
+	$(U)makedefs -p
+
+#$(INCL)\trap.h : $(U)makedefs.exe
+#	$(U)makedefs -t
+
+$(SRC)\monstr.c: $(U)makedefs.exe
+	$(U)makedefs -m
+
+$(INCL)\vis_tab.h: $(U)makedefs.exe
+	$(U)makedefs -z
+
+$(SRC)\vis_tab.c: $(U)makedefs.exe
+	$(U)makedefs -z
+
+#==========================================
+# uudecode utility and uuencoded targets
+#==========================================
+
+$(U)uudecode.exe: $(O)uudecode.o
+	@$(link) $(LFLAGSU) $(startobj) $(O)\uudecode.o, $@,,$(libsmt)
+
+$(O)uudecode.o: $(SSYS)\uudecode.c
+
+$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
+	chdir $(NTSYS)
+	..\..\util\uudecode.exe nhico.uu
+	chdir ..\..\src
+
+$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe ../../sys/winnt/nhico.uu
+	chdir ..\..\src
+
+$(WIN32)\mnsel.bmp: $(U)uudecode.exe $(WIN32)\mnsel.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe mnsel.uu
+	chdir ..\..\src
+
+$(WIN32)\mnselcnt.bmp: $(U)uudecode.exe $(WIN32)\mnselcnt.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe mnselcnt.uu
+	chdir ..\..\src
+
+$(WIN32)\mnunsel.bmp: $(U)uudecode.exe $(WIN32)\mnunsel.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe mnunsel.uu
+	chdir ..\..\src
+
+$(WIN32)\petmark.bmp: $(U)uudecode.exe $(WIN32)\petmark.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe petmark.uu
+	chdir ..\..\src
+
+$(WIN32)\rip.bmp: $(U)uudecode.exe $(WIN32)\rip.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe rip.uu
+	chdir ..\..\src
+
+$(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe splash.uu
+	chdir ..\..\src
+
+#==========================================
+# Level Compiler Stuff
+#==========================================
+
+LEVCFLAGS=$(cflags) -DWIN32 -D_WIN32 -D_MT -I..\include $(cdebug) -DDLB
+
+$(U)lev_comp.exe: $(SPLEVOBJS) $(SRC)\uuid.lib
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) $(startobj) $(SPLEVOBJS), $@,,$(libsmt)
+
+$(O)lev_yacc.o: $(HACK_H)   $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)lev_yacc.c
+
+$(O)lev_$(LEX).o: $(HACK_H)   $(INCL)\lev_comp.h $(SP_LEV_H) \
+               $(U)lev_$(LEX).c
+	@$(cc) $(LEVCFLAGS) -D__IO_H -o$@ $(U)lev_$(LEX).c
+
+$(O)lev_main.o:	$(U)lev_main.c $(HACK_H)   $(SP_LEV_H)
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)lev_main.c
+
+
+$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
+!	IF "$(DO_YACC)"=="YACC_ACT"
+	   chdir $(UTIL)
+	   $(YACC) -d lev_comp.y
+	   copy $(YTABC) lev_yacc.c
+	   copy $(YTABH) $(INCL)\lev_comp.h
+	   @del $(YTABC)
+	   @del $(YTABH)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)lev_comp.y has changed.
+	   @echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt lev_yacc.c and 
+	   @echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
+	   @copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul
+	   @copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul
+	   @echo /**/ >>$(U)lev_yacc.c
+	   @echo /**/ >>$(INCL)\lev_comp.h
+!	ENDIF
+
+$(U)lev_$(LEX).c: $(U)lev_comp.l
+!	IF "$(DO_LEX)"=="LEX_ACT"
+	   chdir $(UTIL)
+	   $(LEX) $(FLEXSKEL) lev_comp.l
+	   copy $(LEXYYC) $@
+	   @del $(LEXYYC)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)lev_comp.l has changed. To update $@ run $(LEX).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt lev_lex.c 
+	   @echo from $(SSYS) into $(UTIL) and use it.
+	   @copy $(SSYS)\lev_lex.c $@ >nul
+	   @echo /**/ >>$@
+!	ENDIF
+
+#==========================================
+# Dungeon Compiler Stuff
+#==========================================
+
+$(U)dgn_comp.exe: $(DGNCOMPOBJS) $(SRC)\uuid.lib
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) $(startobj) $(DGNCOMPOBJS), $@,,$(libsmt)
+
+
+$(O)dgn_yacc.o:	$(HACK_H)   $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)dgn_yacc.c
+
+$(O)dgn_$(LEX).o: $(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
+	$(U)dgn_$(LEX).c
+	@$(cc) $(LEVCFLAGS) -D__IO_H -o$@ $(U)dgn_$(LEX).c
+
+$(O)dgn_main.o:	$(HACK_H) $(U)dgn_main.c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)dgn_main.c
+
+$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
+!	IF "$(DO_YACC)"=="YACC_ACT"
+	   chdir $(UTIL)
+	   $(YACC) -d dgn_comp.y
+	   copy $(YTABC) dgn_yacc.c
+	   copy $(YTABH) $(INCL)\dgn_comp.h
+	   @del $(YTABC)
+	   @del $(YTABH)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and 
+	   @echo $(INCL)\dgn_comp.h run $(YACC).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt $(U)dgn_yacc.c and 
+	   @echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
+	   @copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul
+	   @copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
+	   @echo /**/ >>$(U)dgn_yacc.c
+	   @echo /**/ >>$(INCL)\dgn_comp.h
+!	ENDIF
+
+$(U)dgn_$(LEX).c: $(U)dgn_comp.l
+!	IF "$(DO_LEX)"=="LEX_ACT"
+	   chdir $(UTIL)
+	   $(LEX) $(FLEXSKEL)  dgn_comp.l
+	   copy $(LEXYYC) $@
+	   @del $(LEXYYC)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)dgn_comp.l has changed. To update $@ run $(LEX).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt dgn_lex.c 
+	   @echo from $(SSYS) into $(UTIL) and use it.
+	   @copy $(SSYS)\dgn_lex.c $@ >nul
+	   @echo /**/ >>$@
+!	ENDIF
+
+
+#==========================================
+#=========== SECONDARY TARGETS ============
+#==========================================
+
+#===========================================
+# Header files NOT distributed in ..\include
+#===========================================
+
+$(INCL)\win32api.h: $(NTSYS)\win32api.h
+	copy $(NTSYS)\win32api.h $@
+
+
+#==========================================
+# DLB utility and nhdat file creation
+#==========================================
+
+$(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o $(SRC)\uuid.lib
+	@$(link) $(LFLAGSU) $(startobj) $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o, $@,,$(libsmt)
+
+
+$(O)dlb.o:	$(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h
+	@$(cc) $(CFLAGS) -o$@ $(SRC)\dlb.c
+	
+$(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h
+	@$(cc) $(CFLAGS) -o$@ $(UTIL)\dlb_main.c
+
+$(DAT)\porthelp: $(NTSYS)\porthelp
+	@copy $(NTSYS)\porthelp $@ >nul
+
+nhdat:	$(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
+	$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
+	$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \
+	$(DAT)\license $(O)sp_lev.tag
+	cd $(DAT)
+	echo data >dlb.lst
+	echo oracles >>dlb.lst
+	if exist options echo options >>dlb.lst
+	if exist ttyoptions echo ttyoptions >>dlb.lst
+	if exist guioptions echo guioptions >>dlb.lst
+	if exist porthelp echo porthelp >>dlb.lst
+	echo quest.dat >>dlb.lst
+	echo rumors >>dlb.lst
+	echo help >>dlb.lst
+	echo hh >>dlb.lst
+	echo cmdhelp >>dlb.lst
+	echo history >>dlb.lst
+	echo opthelp >>dlb.lst
+	echo wizhelp >>dlb.lst
+	echo dungeon >>dlb.lst
+	echo license >>dlb.lst
+	for %N in (*.lev) do echo %N >>dlb.lst
+	$(U)dlb_main cIf dlb.lst $(SRC)\nhdat
+	cd $(SRC)
+
+#==========================================
+#  Recover Utility
+#==========================================
+
+$(U)recover.exe: $(RECOVOBJS) $(SRC)\uuid.lib
+	@$(link) $(LFLAGSU) $(startobj) $(RECOVOBJS), $@,,$(libsmt)
+
+
+$(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h
+	@$(cc) $(CFLAGSU) -o$@ $(U)recover.c
+
+#==========================================
+#  Tile Mapping
+#==========================================
+
+$(SRC)\tile.c: $(U)tilemap.exe
+	@echo A new $@ has been created
+	@$(U)tilemap
+
+$(U)tilemap.exe: $(O)tilemap.o $(SRC)\uuid.lib
+	@$(link) $(LFLAGSU) $(startobj) $(O)tilemap.o, $@,,$(libsmt)
+
+
+$(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H)
+	@$(cc) $(CFLAGSU) -o$@ $(WSHR)\tilemap.c
+
+$(O)tiletxt.o: $(WSHR)\tilemap.c $(HACK_H)
+	@$(cc) $(CFLAGS) /DTILETEXT -o$@ $(WSHR)\tilemap.c
+
+$(O)gifread.o: $(WSHR)\gifread.c  $(CONFIG_H) $(TILE_H)
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)\gifread.c
+
+$(O)ppmwrite.o: $(WSHR)\ppmwrite.c $(CONFIG_H) $(TILE_H)
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)\ppmwrite.c
+
+$(O)tiletext.o: $(WSHR)\tiletext.c  $(CONFIG_H) $(TILE_H)
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)\tiletext.c
+
+#==========================================
+# Optional Tile Utilities
+#==========================================
+
+$(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO) $(SRC)\uuid.lib
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) $(startobj) $(GIFREADERS) $(TEXT_IO), $@,,$(libsmt)
+
+
+$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO) $(SRC)\uuid.lib
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) $(startobj) $(PPMWRITERS) $(TEXT_IO), $@,,$(libsmt)
+
+
+!IF "$(GRAPHICAL)"=="Y"
+$(TILEBMP16): $(TILEUTIL16) $(TILEFILES)
+	@echo Creating 16x16 binary tile files (this may take some time)
+	@$(U)tile2bmp $(TILEBMP16)
+!ENDIF
+
+$(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO) $(SRC)\uuid.lib
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) $(startobj) $(O)tile2bmp.o $(TEXT_IO), $@,,$(libsmt)
+
+
+$(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
+	@$(cc) $(CFLAGS) -I$(WSHR) /DPACKED_FILE -o$@ $(WSHR)\tile2bmp.c
+
+#==========================================
+# Housekeeping
+#==========================================
+
+spotless: clean
+! IF ("$(OBJ)"!="")
+	-rmdir $(OBJ) /s /Q
+! ENDIF
+	if exist $(INCL)\date.h    del $(INCL)\date.h
+	if exist $(INCL)\onames.h  del $(INCL)\onames.h
+	if exist $(INCL)\pm.h      del $(INCL)\pm.h
+	if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
+	if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
+	if exist $(SRC)\tile.c     del $(SRC)\tile.c
+	if exist $(U)*.lnk         del $(U)*.lnk
+	if exist $(U)*.map         del $(U)*.map
+	if exist $(DAT)\data       del $(DAT)\data
+	if exist $(DAT)\rumors     del $(DAT)\rumors
+	if exist $(DAT)\???-fil?.lev	del $(DAT)\???-fil?.lev
+	if exist $(DAT)\???-goal.lev	del $(DAT)\???-goal.lev
+	if exist $(DAT)\???-loca.lev	del $(DAT)\???-loca.lev
+	if exist $(DAT)\???-strt.lev	del $(DAT)\???-strt.lev
+	if exist $(DAT)\air.lev		del $(DAT)\air.lev
+	if exist $(DAT)\asmodeus.lev	del $(DAT)\asmodeus.lev
+	if exist $(DAT)\astral.lev	del $(DAT)\astral.lev
+	if exist $(DAT)\baalz.lev	del $(DAT)\baalz.lev
+	if exist $(DAT)\bigroom.lev	del $(DAT)\bigroom.lev
+	if exist $(DAT)\castle.lev	del $(DAT)\castle.lev
+	if exist $(DAT)\data		del $(DAT)\data
+	if exist $(DAT)\dungeon		del $(DAT)\dungeon
+	if exist $(DAT)\dungeon.pdf	del $(DAT)\dungeon.pdf
+	if exist $(DAT)\earth.lev	del $(DAT)\earth.lev
+	if exist $(DAT)\fakewiz?.lev	del $(DAT)\fakewiz?.lev
+	if exist $(DAT)\fire.lev	del $(DAT)\fire.lev
+	if exist $(DAT)\juiblex.lev	del $(DAT)\juiblex.lev
+	if exist $(DAT)\knox.lev	del $(DAT)\knox.lev
+	if exist $(DAT)\medusa-?.lev	del $(DAT)\medusa-?.lev
+	if exist $(DAT)\mine*.lev	del $(DAT)\mine*.lev
+	if exist $(DAT)\options		del $(DAT)\options
+	if exist $(DAT)\ttyoptions	del $(DAT)\ttyoptions
+	if exist $(DAT)\guioptions	del $(DAT)\guioptions
+	if exist $(DAT)\oracle.lev	del $(DAT)\oracle.lev
+	if exist $(DAT)\oracles		del $(DAT)\oracles
+	if exist $(DAT)\orcus.lev	del $(DAT)\orcus.lev
+	if exist $(DAT)\rumors		del $(DAT)\rumors
+	if exist $(DAT)\quest.dat	del $(DAT)\quest.dat
+	if exist $(DAT)\sanctum.lev	del $(DAT)\sanctum.lev
+	if exist $(DAT)\soko?-?.lev	del $(DAT)\soko?-?.lev
+	if exist $(DAT)\tower?.lev	del $(DAT)\tower?.lev
+	if exist $(DAT)\valley.lev	del $(DAT)\valley.lev
+	if exist $(DAT)\water.lev	del $(DAT)\water.lev
+	if exist $(DAT)\wizard?.lev	del $(DAT)\wizard?.lev
+	if exist $(O)sp_lev.tag	        del $(O)sp_lev.tag
+	if exist $(SRC)\monstr.c        del $(SRC)\monstr.c
+	if exist $(SRC)\vis_tab.c       del $(SRC)\vis_tab.c
+	if exist $(U)recover.exe        del $(U)recover.exe
+	if exist nhdat.			del nhdat.
+
+clean:
+	if exist $(O)*.o del $(O)*.o
+	if exist $(O)utility.tag   del $(O)utility.tag
+	if exist $(U)makedefs.exe  del $(U)makedefs.exe
+	if exist $(U)lev_comp.exe  del $(U)lev_comp.exe
+	if exist $(U)dgn_comp.exe  del $(U)dgn_comp.exe
+	if exist $(SRC)\*.lnk      del $(SRC)\*.lnk
+	if exist $(SRC)\*.map      del $(SRC)\*.map
+	if exist $(TILEBMP16)        del $(TILEBMP16)
+
+#===================================================================
+# OTHER DEPENDENCIES
+#===================================================================
+
+#
+# dat dependencies
+#
+
+$(DAT)\data: $(O)utility.tag    $(DATABASE)
+	$(U)makedefs -d
+
+$(DAT)\rumors: $(O)utility.tag    $(DAT)\rumors.tru   $(DAT)\rumors.fal
+	$(U)makedefs -r
+
+$(DAT)\quest.dat: $(O)utility.tag  $(DAT)\quest.txt
+	$(U)makedefs -q
+
+$(DAT)\oracles: $(O)utility.tag    $(DAT)\oracles.txt
+	$(U)makedefs -h
+
+$(DAT)\dungeon: $(O)utility.tag  $(DAT)\dungeon.def
+	$(U)makedefs -e
+	cd $(DAT)
+	$(U)dgn_comp dungeon.pdf
+	cd $(SRC)
+
+#
+# NT dependencies
+#
+
+$(O)nttty.o:   $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nttty.c
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@  $(NTSYS)\nttty.c
+$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(NTSYS)\winnt.c
+	@$(cc) $(CFLAGS) -o$@  $(NTSYS)\winnt.c
+$(O)ntsound.o: $(HACK_H) $(NTSYS)\ntsound.c
+	@$(cc) $(CFLAGS)  -o$@ $(NTSYS)\ntsound.c
+$(O)mapimail.o: $(HACK_H) $(INCL)\nhlan.h $(NTSYS)\mapimail.c
+	@$(cc) $(CFLAGS) -DMAPI_VERBOSE  -o$@ $(NTSYS)\mapimail.c
+
+# 
+# util dependencies
+#
+
+$(O)panic.o:  $(U)panic.c $(CONFIG_H)
+	@$(cc) $(CFLAGS) -o$@ $(U)panic.c
+
+#
+# The rest are stolen from sys/unix/Makefile.src, 
+# with slashes changed to back-slashes 
+# and -c (which is included in CFLAGS) substituted
+# with -o$@ , but otherwise untouched. That
+# means that there is some irrelevant stuff
+# in here, but maintenance should be easier.
+#
+$(O)tos.o: ..\sys\atari\tos.c $(HACK_H) $(INCL)\tcap.h
+	$(cc) $(CFLAGS) -o$@ ..\sys\atari\tos.c
+$(O)pcmain.o: ..\sys\share\pcmain.c $(HACK_H) $(INCL)\dlb.h \
+		$(INCL)\win32api.h
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\pcmain.c
+$(O)pcsys.o: ..\sys\share\pcsys.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\pcsys.c
+$(O)pctty.o: ..\sys\share\pctty.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\pctty.c
+$(O)pcunix.o: ..\sys\share\pcunix.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\pcunix.c
+$(O)random.o: ..\sys\share\random.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\random.c
+$(O)ioctl.o: ..\sys\share\ioctl.c $(HACK_H) $(INCL)\tcap.h
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\ioctl.c
+$(O)unixtty.o: ..\sys\share\unixtty.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ..\sys\share\unixtty.c
+$(O)unixmain.o: ..\sys\unix\unixmain.c $(HACK_H) $(INCL)\dlb.h
+	$(cc) $(CFLAGS) -o$@ ..\sys\unix\unixmain.c
+$(O)unixunix.o: ..\sys\unix\unixunix.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ..\sys\unix\unixunix.c
+$(O)bemain.o: ..\sys\be\bemain.c $(HACK_H) $(INCL)\dlb.h
+	$(cc) $(CFLAGS) -o$@ ..\sys\be\bemain.c
+$(O)getline.o: ..\win\tty\getline.c $(HACK_H) $(INCL)\func_tab.h
+	$(cc) $(CFLAGS) -o$@ ..\win\tty\getline.c
+$(O)termcap.o: ..\win\tty\termcap.c $(HACK_H) $(INCL)\tcap.h
+	$(cc) $(CFLAGS) -o$@ ..\win\tty\termcap.c
+$(O)topl.o: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
+	$(cc) $(CFLAGS) -o$@ ..\win\tty\topl.c
+$(O)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
+		$(INCL)\patchlevel.h $(INCL)\tcap.h
+	$(cc) $(CFLAGS) -o$@ ..\win\tty\wintty.c
+$(O)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h \
+		$(CONFIG_H)
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\Window.c
+$(O)dialogs.o: ..\win\X11\dialogs.c $(CONFIG_H)
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\dialogs.c
+$(O)winX.o: ..\win\X11\winX.c $(HACK_H) $(INCL)\winX.h $(INCL)\dlb.h \
+		$(INCL)\patchlevel.h ..\win\X11\nh72icon \
+		..\win\X11\nh56icon ..\win\X11\nh32icon
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winX.c
+$(O)winmap.o: ..\win\X11\winmap.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\dlb.h \
+		$(INCL)\winX.h $(INCL)\tile2x11.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winmap.c
+$(O)winmenu.o: ..\win\X11\winmenu.c $(HACK_H) $(INCL)\winX.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winmenu.c
+$(O)winmesg.o: ..\win\X11\winmesg.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\winX.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winmesg.c
+$(O)winmisc.o: ..\win\X11\winmisc.c $(HACK_H) $(INCL)\func_tab.h \
+		$(INCL)\winX.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winmisc.c
+$(O)winstat.o: ..\win\X11\winstat.c $(HACK_H) $(INCL)\winX.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winstat.c
+$(O)wintext.o: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\wintext.c
+$(O)winval.o: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h
+	$(cc) $(CFLAGS) -o$@ ..\win\X11\winval.c
+$(O)tile.o: $(SRC)\tile.c $(HACK_H)
+$(O)gnaskstr.o: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h \
+		..\win\gnome\gnmain.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnaskstr.c
+$(O)gnbind.o: ..\win\gnome\gnbind.c ..\win\gnome\gnbind.h ..\win\gnome\gnmain.h \
+		..\win\gnome\gnaskstr.h ..\win\gnome\gnyesno.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnbind.c
+$(O)gnglyph.o: ..\win\gnome\gnglyph.c ..\win\gnome\gnglyph.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnglyph.c
+$(O)gnmain.o: ..\win\gnome\gnmain.c ..\win\gnome\gnmain.h ..\win\gnome\gnsignal.h \
+		..\win\gnome\gnbind.h ..\win\gnome\gnopts.h $(HACK_H) \
+		$(INCL)\date.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmain.c
+$(O)gnmap.o: ..\win\gnome\gnmap.c ..\win\gnome\gnmap.h ..\win\gnome\gnglyph.h \
+		..\win\gnome\gnsignal.h $(HACK_H)
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmap.c
+$(O)gnmenu.o: ..\win\gnome\gnmenu.c ..\win\gnome\gnmenu.h ..\win\gnome\gnmain.h \
+		..\win\gnome\gnbind.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmenu.c
+$(O)gnmesg.o: ..\win\gnome\gnmesg.c ..\win\gnome\gnmesg.h ..\win\gnome\gnsignal.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmesg.c
+$(O)gnopts.o: ..\win\gnome\gnopts.c ..\win\gnome\gnopts.h ..\win\gnome\gnglyph.h \
+		..\win\gnome\gnmain.h ..\win\gnome\gnmap.h $(HACK_H)
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnopts.c
+$(O)gnplayer.o: ..\win\gnome\gnplayer.c ..\win\gnome\gnplayer.h \
+		..\win\gnome\gnmain.h $(HACK_H)
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnplayer.c
+$(O)gnsignal.o: ..\win\gnome\gnsignal.c ..\win\gnome\gnsignal.h \
+		..\win\gnome\gnmain.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnsignal.c
+$(O)gnstatus.o: ..\win\gnome\gnstatus.c ..\win\gnome\gnstatus.h \
+		..\win\gnome\gnsignal.h ..\win\gnome\gn_xpms.h \
+		..\win\gnome\gnomeprv.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnstatus.c
+$(O)gntext.o: ..\win\gnome\gntext.c ..\win\gnome\gntext.h ..\win\gnome\gnmain.h \
+		..\win\gnome\gn_rip.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gntext.c
+$(O)gnyesno.o: ..\win\gnome\gnyesno.c ..\win\gnome\gnbind.h ..\win\gnome\gnyesno.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnyesno.c
+$(O)wingem.o: ..\win\gem\wingem.c $(HACK_H) $(INCL)\func_tab.h $(INCL)\dlb.h \
+		$(INCL)\patchlevel.h $(INCL)\wingem.h
+	$(cc) $(CFLAGS) -o$@ ..\win\gem\wingem.c
+$(O)wingem1.o: ..\win\gem\wingem1.c $(INCL)\gem_rsc.h $(INCL)\load_img.h \
+		$(INCL)\wintype.h $(INCL)\wingem.h
+	$(cc) $(CFLAGS) -o$@ ..\win\gem\wingem1.c
+$(O)load_img.o: ..\win\gem\load_img.c $(INCL)\load_img.h
+	$(cc) $(CFLAGS) -o$@ ..\win\gem\load_img.c
+$(O)tile.o: tile.c $(HACK_H)
+$(O)qt_win.o: ..\win\Qt\qt_win.cpp $(HACK_H) $(INCL)\func_tab.h \
+		$(INCL)\dlb.h $(INCL)\patchlevel.h $(INCL)\qt_win.h \
+		$(INCL)\qt_clust.h $(INCL)\qt_kde0.h \
+		$(INCL)\qt_xpms.h qt_win.moc qt_kde0.moc
+	$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_win.cpp
+$(O)qt_clust.o: ..\win\Qt\qt_clust.cpp $(INCL)\qt_clust.h
+	$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_clust.cpp
+$(O)monstr.o: $(SRC)\monstr.c $(CONFIG_H)
+$(O)vis_tab.o: $(SRC)\vis_tab.c $(CONFIG_H) $(INCL)\vis_tab.h
+$(O)allmain.o: allmain.c $(HACK_H)
+$(O)alloc.o: alloc.c $(CONFIG_H)
+$(O)apply.o: apply.c $(HACK_H) $(INCL)\edog.h
+$(O)artifact.o: artifact.c $(HACK_H) $(INCL)\artifact.h $(INCL)\artilist.h
+$(O)attrib.o: attrib.c $(HACK_H) $(INCL)\artifact.h
+$(O)ball.o: ball.c $(HACK_H)
+$(O)bones.o: bones.c $(HACK_H) $(INCL)\lev.h
+$(O)botl.o: botl.c $(HACK_H)
+$(O)cmd.o: cmd.c $(HACK_H) $(INCL)\func_tab.h
+$(O)dbridge.o: dbridge.c $(HACK_H)
+$(O)decl.o: decl.c $(HACK_H)
+$(O)detect.o: detect.c $(HACK_H) $(INCL)\artifact.h
+$(O)dig.o: dig.c $(HACK_H) $(INCL)\edog.h
+$(O)display.o: display.c $(HACK_H)
+$(O)dlb.o: dlb.c $(CONFIG_H) $(INCL)\dlb.h
+$(O)do.o: do.c $(HACK_H) $(INCL)\lev.h
+$(O)do_name.o: do_name.c $(HACK_H)
+$(O)do_wear.o: do_wear.c $(HACK_H)
+$(O)dog.o: dog.c $(HACK_H) $(INCL)\edog.h
+$(O)dogmove.o: dogmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
+$(O)dokick.o: dokick.c $(HACK_H) $(INCL)\eshk.h
+$(O)dothrow.o: dothrow.c $(HACK_H)
+$(O)drawing.o: drawing.c $(HACK_H) $(INCL)\tcap.h
+$(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
+$(O)eat.o: eat.c $(HACK_H)
+$(O)end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
+$(O)engrave.o: engrave.c $(HACK_H) $(INCL)\lev.h
+$(O)exper.o: exper.c $(HACK_H)
+$(O)explode.o: explode.c $(HACK_H)
+$(O)extralev.o: extralev.c $(HACK_H)
+$(O)files.o: files.c $(HACK_H) $(INCL)\dlb.h
+$(O)fountain.o: fountain.c $(HACK_H)
+$(O)hack.o: hack.c $(HACK_H)
+$(O)hacklib.o: hacklib.c $(HACK_H)
+$(O)invent.o: invent.c $(HACK_H) $(INCL)\artifact.h
+$(O)light.o: light.c $(HACK_H) $(INCL)\lev.h
+$(O)lock.o: lock.c $(HACK_H)
+$(O)mail.o: mail.c $(HACK_H) $(INCL)\mail.h
+$(O)makemon.o: makemon.c $(HACK_H) $(INCL)\epri.h $(INCL)\emin.h \
+		$(INCL)\edog.h
+$(O)mapglyph.o: mapglyph.c $(HACK_H)
+$(O)mcastu.o: mcastu.c $(HACK_H)
+$(O)mhitm.o: mhitm.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
+$(O)mhitu.o: mhitu.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
+$(O)minion.o: minion.c $(HACK_H) $(INCL)\emin.h $(INCL)\epri.h
+$(O)mklev.o: mklev.c $(HACK_H)
+$(O)mkmap.o: mkmap.c $(HACK_H) $(INCL)\sp_lev.h
+$(O)mkmaze.o: mkmaze.c $(HACK_H) $(INCL)\sp_lev.h $(INCL)\lev.h
+$(O)mkobj.o: mkobj.c $(HACK_H) $(INCL)\artifact.h
+$(O)mkroom.o: mkroom.c $(HACK_H)
+$(O)mon.o: mon.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
+$(O)mondata.o: mondata.c $(HACK_H) $(INCL)\eshk.h $(INCL)\epri.h
+$(O)monmove.o: monmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
+$(O)monst.o: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \
+		$(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \
+		$(INCL)\dungeon.h $(INCL)\eshk.h $(INCL)\vault.h \
+		$(INCL)\epri.h $(INCL)\color.h
+$(O)mplayer.o: mplayer.c $(HACK_H)
+$(O)mthrowu.o: mthrowu.c $(HACK_H)
+$(O)muse.o: muse.c $(HACK_H) $(INCL)\edog.h
+$(O)music.o: music.c $(HACK_H) #interp.c
+$(O)o_init.o: o_init.c $(HACK_H) $(INCL)\lev.h
+$(O)objects.o: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
+		$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
+$(O)objnam.o: objnam.c $(HACK_H)
+$(O)options.o: options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h \
+		$(HACK_H) $(INCL)\tcap.h
+$(O)pager.o: pager.c $(HACK_H) $(INCL)\dlb.h
+$(O)pickup.o: pickup.c $(HACK_H)
+$(O)pline.o: pline.c $(HACK_H) $(INCL)\epri.h $(INCL)\edog.h
+$(O)polyself.o: polyself.c $(HACK_H)
+$(O)potion.o: potion.c $(HACK_H)
+$(O)pray.o: pray.c $(HACK_H) $(INCL)\epri.h
+$(O)priest.o: priest.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\eshk.h \
+		$(INCL)\epri.h $(INCL)\emin.h
+$(O)quest.o: quest.c $(HACK_H) $(INCL)\qtext.h
+$(O)questpgr.o: questpgr.c $(HACK_H) $(INCL)\dlb.h $(INCL)\qtext.h
+$(O)read.o: read.c $(HACK_H)
+$(O)rect.o: rect.c $(HACK_H)
+$(O)region.o: region.c $(HACK_H) $(INCL)\lev.h
+$(O)restore.o: restore.c $(HACK_H) $(INCL)\lev.h $(INCL)\tcap.h
+$(O)rip.o: rip.c $(HACK_H)
+$(O)rnd.o: rnd.c $(HACK_H)
+$(O)role.o: role.c $(HACK_H)
+$(O)rumors.o: rumors.c $(HACK_H) $(INCL)\lev.h $(INCL)\dlb.h
+$(O)save.o: save.c $(HACK_H) $(INCL)\lev.h
+$(O)shk.o: shk.c $(HACK_H) $(INCL)\eshk.h
+$(O)shknam.o: shknam.c $(HACK_H) $(INCL)\eshk.h
+$(O)sit.o: sit.c $(HACK_H) $(INCL)\artifact.h
+$(O)sounds.o: sounds.c $(HACK_H) $(INCL)\edog.h
+$(O)sp_lev.o: sp_lev.c $(HACK_H) $(INCL)\dlb.h $(INCL)\sp_lev.h
+$(O)spell.o: spell.c $(HACK_H)
+$(O)steal.o: steal.c $(HACK_H)
+$(O)steed.o: steed.c $(HACK_H)
+$(O)teleport.o: teleport.c $(HACK_H)
+$(O)timeout.o: timeout.c $(HACK_H) $(INCL)\lev.h
+$(O)topten.o: topten.c $(HACK_H) $(INCL)\dlb.h $(INCL)\patchlevel.h
+$(O)track.o: track.c $(HACK_H)
+$(O)trap.o: trap.c $(HACK_H)
+$(O)u_init.o: u_init.c $(HACK_H)
+$(O)uhitm.o: uhitm.c $(HACK_H)
+$(O)vault.o: vault.c $(HACK_H) $(INCL)\vault.h
+$(O)version.o: version.c $(HACK_H) $(INCL)\date.h $(INCL)\patchlevel.h
+$(O)vision.o: vision.c $(HACK_H) $(INCL)\vis_tab.h
+$(O)weapon.o: weapon.c $(HACK_H)
+$(O)were.o: were.c $(HACK_H)
+$(O)wield.o: wield.c $(HACK_H)
+$(O)windows.o: windows.c $(HACK_H) $(INCL)\wingem.h $(INCL)\winGnome.h
+$(O)wizard.o: wizard.c $(HACK_H) $(INCL)\qtext.h
+$(O)worm.o: worm.c $(HACK_H) $(INCL)\lev.h
+$(O)worn.o: worn.c $(HACK_H)
+$(O)write.o: write.c $(HACK_H)
+$(O)zap.o: zap.c $(HACK_H)
+
+# end of file
+
diff -Naurd ../nethack-3.3.1/sys/winnt/Makefile.gcc ./sys/winnt/Makefile.gcc
--- ../nethack-3.3.1/sys/winnt/Makefile.gcc Thu Jan 1 01:00:00 1970
+++ ./sys/winnt/Makefile.gcc Fri Mar 22 14:40:55 2002
@@ -0,0 +1,1309 @@
+#   SCCS Id: @(#)Makefile.gcc       3.4     2002/02/04
+#   Copyright (c) NetHack PC Development Team 1993-2002
+#
+#   NetHack 3.4.x Makefile for MinGW
+#
+#   Win32 Compilers Tested:
+#                              - gcc version 2.95.3-6
+#
+#   If you don't have this compiler, you can get it at:
+#       http://www.mingw.org/
+#
+#   This is used for building a TTY version of NetHack using
+#   WIN32 Console I/O only.
+#
+#   In addition to your C compiler,
+#
+#     if you want to change     you will need a
+#     files with suffix               workalike for
+#              .y                          yacc   (such as bison)
+#              .l                          lex    (such as flex)
+#
+#
+#   If you have any questions read the sys/winnt/Install.nt file included
+#   with the distribution.
+#
+#   --
+#   Dion Nicolaas
+#==============================================================================
+# Graphical interface
+# Don't uncomment this line for 3.4.0
+# Set to Y for a graphical version
+# Set to anything else (or undefine) for a tty version
+
+GRAPHICAL = N
+
+# Debug
+# Set to Y for Debug support (to produce debug information)
+# Set to anything else (or undefine) for a "release" version
+# You can set your debug options below.
+
+DEBUG = Y
+
+cc     = gcc
+rc     = windres
+link   = gcc
+
+cflags =
+lflags  =
+ifeq  "$(DEBUG)" "Y"
+cdebug = -g
+linkdebug = -g
+else
+cdebug =
+linkdebug =
+endif
+
+#
+#  Set the gamedir according to your preference.
+#  If not present prior to compilation it gets created.
+
+# Game Name
+GAME    = NetHack
+# Game directory
+GAMEDIR = ../binary
+
+#
+#  Source directories.    Makedefs hardcodes these, don't change them.
+#
+
+# NetHack include files
+INCL  = ../include
+# NetHack data files
+DAT   = ../dat
+# NetHack documentation files
+DOC   = ../doc
+# Utility source
+UTIL  = ../util
+# Main source
+SRC   = ../src
+# Shared system files
+SSYS  = ../sys/share
+# NT Win32 specific files
+NTSYS = ../sys/winnt
+# window port files (tty)
+TTY   = ../win/tty
+# window port files (Win32)
+WIN32 = ../win/win32
+# Tile support files
+WSHR  = ../win/share
+
+#
+#  Object directory.
+#
+
+OBJ = o
+
+
+#
+#==========================================
+# Exe File Info.
+#==========================================
+
+# Yacc/Lex ... if you got 'em.
+#
+# If you have yacc and lex programs (or work-alike such as bison
+# and flex), comment out the upper two macros and uncomment
+# the lower two.
+#
+
+DO_YACC = YACC_MSG
+DO_LEX  = LEX_MSG
+#DO_YACC  = YACC_ACT
+#DO_LEX   = LEX_ACT
+
+# - Specify your yacc and lex programs (or work-alikes) here.
+
+#YACC   = bison -y
+YACC   = byacc
+#YACC   = yacc
+
+#LEX    = lex
+LEX     = flex
+
+#
+# - Specify your flex skeleton file (if needed).
+#
+
+FLEXSKEL =
+#FLEXSKEL = -S../tools/flex.ske
+
+YTABC   = y_tab.c
+YTABH   = y_tab.h
+LEXYYC  = lexyy.c
+
+#
+# Optional high-quality BSD random number generation routines
+# (see pcconf.h). Set to nothing if not used.
+#
+
+RANDOM  = $(OBJ)/random.o
+#RANDOM =
+
+#===============================================
+#======= End of Modification Section ===========
+#===============================================
+################################################
+#                                              #
+# Nothing below here should have to be changed.#
+#                                              #
+################################################
+
+ifeq  "$(GRAPHICAL)" "Y"
+WINPORT  = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
+	$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
+	$(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
+	$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
+# WIN32_IE=0x400 is currently unsupported by MinGW
+WINPFLAG   = -DTILES -DMSWIN_GRAPHICS -D_WIN32_IE=0x0400
+NHRES   = $(O)winhack.o
+WINPINC = -I$(WIN32)
+WINPHDR = $(WIN32)/mhaskyn.h $(WIN32)/mhdlg.h $(WIN32)/mhfont.h \
+	$(WIN32)/mhinput.h $(WIN32)/mhmain.h $(WIN32)/mhmap.h \
+	$(WIN32)/mhmenu.h $(WIN32)/mhmsg.h $(WIN32)/mhmsgwnd.h \
+	$(WIN32)/mhrip.h $(WIN32)/mhstatus.h \
+	$(WIN32)/mhtext.h $(WIN32)/resource.h $(WIN32)/winMS.h
+else
+WINPORT = $(O)nttty.o
+WINPFLAG= -DWIN32CON
+WINPHDR =
+NHRES   = $(O)console.o
+WINPINC =
+endif
+
+TILEUTIL16  = $(UTIL)/tile2bmp.exe
+TILEBMP16   = $(SRC)/tiles.bmp
+
+TILEUTIL32  = $(UTIL)/til2bm32.exe
+TILEBMP32   = $(SRC)/tiles32.bmp
+
+# These should be left commented in 3.4.x
+#
+
+#SOUND = $(OBJ)/ntsound.o
+#SOUND =
+
+# To store all the level files,
+# help files, etc. in a single library file.
+# USE_DLB = Y is left uncommented
+
+USE_DLB = Y
+
+ifeq  "$(USE_DLB)" "Y"
+DLBFLG = -DDLB
+else
+DLBFLG =
+endif
+
+#==========================================
+# Setting up the compiler and linker
+# macros. All builds include the base ones.
+#==========================================
+
+CFLAGSBASE  = -c $(cflags) -I$(INCL) $(WINPINC) $(cdebug)
+LFLAGSBASEC = $(linkdebug)
+LFLAGSBASEG = $(linkdebug) -mwindows
+
+#==========================================
+# Util builds
+#==========================================
+
+CFLAGSU = $(CFLAGSBASE) $(WINPFLAG)
+LFLAGSU = $(LFLAGSBASEC)
+
+#==========================================
+# - Game build
+#==========================================
+
+CFLAGS   = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG)
+lflags  = $(LFLAGSBASE)
+ifeq "$(GRAPHICAL)" "Y"
+lflags  = $(LFLAGSBASEG)
+else
+lflags  = $(LFLAGSBASEC)
+endif
+
+GAMEFILE = $(GAMEDIR)/$(GAME).exe # whole thing
+
+ifeq  "$(USE_DLB)" "Y"
+DLB = nhdat
+else
+DLB =
+endif
+
+#==========================================
+#================ RULES ==================
+#==========================================
+
+.SUFFIXES: .exe .o .til .uu .c .y .l
+
+#==========================================
+# Rules for files in src
+#==========================================
+
+$(OBJ)/%.o : /%.c
+	@$(cc) $(CFLAGS)  -o$@ $<
+
+$(OBJ)/%.o : $(SRC)/%.c
+	@$(cc) $(CFLAGS)   -o$@  $<
+
+#==========================================
+# Rules for files in sys/share
+#==========================================
+
+$(OBJ)/%.o : $(SSYS)/%.c
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+#==========================================
+# Rules for files in sys/winnt
+#==========================================
+
+$(OBJ)/%.o : $(NTSYS)/%.c
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+$(INCL)/%.h : $(NTSYS)/%.h
+	@copy $< $@
+
+#==========================================
+# Rules for files in util
+#==========================================
+
+$(OBJ)/%.o : $(UTIL)/%.c
+	@$(cc) $(CFLAGSU) -o$@ $<
+
+#==========================================
+# Rules for files in win/share
+#==========================================
+
+$(OBJ)/%.o : $(WSHR)/%.c
+	@$(cc) $(CFLAGS)  -o$@ $<
+
+$(INCL)/%.h : $(WSHR)/%.h
+	@copy $< $@
+
+#{$(WSHR)}.txt{$(DAT)}.txt:
+#	@copy $< $@
+
+#==========================================
+# Rules for files in win/tty
+#==========================================
+
+$(OBJ)/%.o : $(TTY)/%.c
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+#==========================================
+# Rules for files in win/win32
+#==========================================
+
+$(OBJ)/%.o : $(WIN32)/%.c
+	@$(cc) $(CFLAGS)  -o$@  $<
+
+#==========================================
+#================ MACROS ==================
+#==========================================
+# This section creates shorthand macros for many objects
+# referenced later on in the Makefile.
+#
+
+DEFFILE = $(NTSYS)/$(GAME).def
+
+#
+# Shorten up the location for some files
+#
+
+O  = $(OBJ)/
+
+U  = $(UTIL)/
+
+#
+# Utility Objects.
+#
+
+MAKESRC        = $(U)makedefs.c
+
+SPLEVSRC       = $(U)lev_yacc.c  $(U)lev_$(LEX).c $(U)lev_main.c  $(U)panic.c
+
+DGNCOMPSRC     = $(U)dgn_yacc.c  $(U)dgn_$(LEX).c $(U)dgn_main.c
+
+MAKEOBJS       = $(O)makedefs.o $(O)monst.o $(O)objects.o
+
+SPLEVOBJS      = $(O)lev_yacc.o  $(O)lev_$(LEX).o $(O)lev_main.o \
+	$(O)alloc.o   $(O)decl.o      $(O)drawing.o \
+	$(O)monst.o   $(O)objects.o   $(O)panic.o
+
+DGNCOMPOBJS    = $(O)dgn_yacc.o  $(O)dgn_$(LEX).o $(O)dgn_main.o \
+	$(O)alloc.o   $(O)panic.o
+
+RECOVOBJS      = $(O)recover.o
+
+TILEFILES      = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt
+
+#
+# These are not invoked during a normal game build in 3.4.0
+#
+TEXT_IO        = $(O)tiletext.o  $(O)tiletxt.o   $(O)drawing.o \
+	$(O)decl.o    $(O)monst.o     $(O)objects.o
+
+TEXT_IO32      = $(O)tilete32.o $(O)tiletx32.o $(O)drawing.o \
+	$(O)decl.o    $(O)monst.o     $(O)objects.o
+
+GIFREADERS     = $(O)gifread.o   $(O)alloc.o $(O)panic.o
+GIFREADERS32   = $(O)gifrd32.o $(O)alloc.o $(O)panic.o
+
+PPMWRITERS     = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
+
+#
+#  Object files for the game itself.
+#
+
+VOBJ01 = $(O)allmain.o  $(O)alloc.o    $(O)apply.o    $(O)artifact.o
+VOBJ02 = $(O)attrib.o   $(O)ball.o     $(O)bones.o    $(O)botl.o
+VOBJ03 = $(O)cmd.o      $(O)dbridge.o  $(O)decl.o     $(O)detect.o
+VOBJ04 = $(O)dig.o      $(O)display.o  $(O)do.o       $(O)do_name.o
+VOBJ05 = $(O)do_wear.o  $(O)dog.o      $(O)dogmove.o  $(O)dokick.o
+VOBJ06 = $(O)dothrow.o  $(O)drawing.o  $(O)dungeon.o  $(O)eat.o
+VOBJ07 = $(O)end.o      $(O)engrave.o  $(O)exper.o    $(O)explode.o
+VOBJ08 = $(O)extralev.o $(O)files.o    $(O)fountain.o $(O)hack.o
+VOBJ09 = $(O)hacklib.o  $(O)invent.o   $(O)light.o    $(O)lock.o
+VOBJ10 = $(O)mail.o     $(O)makemon.o  $(O)mapglyph.o $(O)mcastu.o
+VOBJ11 = $(O)mhitm.o    $(O)mhitu.o    $(O)minion.o   $(O)mklev.o
+VOBJ12 = $(O)mkmap.o    $(O)mkmaze.o   $(O)mkobj.o    $(O)mkroom.o
+VOBJ13 = $(O)mon.o      $(O)mondata.o  $(O)monmove.o  $(O)monst.o
+VOBJ14 = $(O)monstr.o   $(O)mplayer.o  $(O)mthrowu.o  $(O)muse.o
+VOBJ15 = $(O)music.o    $(O)o_init.o   $(O)objects.o  $(O)objnam.o
+VOBJ16 = $(O)options.o  $(O)pager.o    $(O)pickup.o   $(O)pline.o
+VOBJ17 = $(O)polyself.o $(O)potion.o   $(O)pray.o     $(O)priest.o
+VOBJ18 = $(O)quest.o    $(O)questpgr.o $(RANDOM)      $(O)read.o
+VOBJ19 = $(O)rect.o     $(O)region.o   $(O)restore.o  $(O)rip.o
+VOBJ20 = $(O)rnd.o      $(O)role.o     $(O)rumors.o   $(O)save.o
+VOBJ21 = $(O)shk.o      $(O)shknam.o   $(O)sit.o      $(O)sounds.o
+VOBJ22 = $(O)sp_lev.o   $(O)spell.o    $(O)steal.o    $(O)steed.o
+VOBJ23 = $(O)teleport.o $(O)timeout.o  $(O)topten.o   $(O)track.o
+VOBJ24 = $(O)trap.o     $(O)u_init.o   $(O)uhitm.o    $(O)vault.o
+VOBJ25 = $(O)vis_tab.o  $(O)vision.o   $(O)weapon.o   $(O)were.o
+VOBJ26 = $(O)wield.o    $(O)windows.o  $(O)wizard.o   $(O)worm.o
+VOBJ27 = $(O)worn.o     $(O)write.o    $(O)zap.o
+
+DLBOBJ = $(O)dlb.o
+
+TTYOBJ = $(O)topl.o     $(O)getline.o  $(O)wintty.o
+
+SOBJ   = $(O)winnt.o    $(O)pcsys.o      $(O)pcunix.o  \
+	$(SOUND) $(O)pcmain.o $(O)mapimail.o $(O)nhlan.o
+
+OBJS   = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
+	$(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
+	$(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
+	$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
+	$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
+	$(VOBJ26) $(VOBJ27)
+
+WINPOBJ = $(WINPORT)
+
+VVOBJ  = $(O)version.o
+
+ALLOBJ  = $(WINPOBJ) $(SOBJ) $(DLBOBJ)  $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
+
+ifeq "$(GRAPHICAL)" "Y"
+OPTIONS_FILE = $(DAT)/guioptions
+else
+OPTIONS_FILE = $(DAT)/ttyoptions
+endif
+
+#==========================================
+# Header file macros
+#==========================================
+
+CONFIG_H = $(INCL)/config.h $(INCL)/config1.h $(INCL)/tradstdc.h \
+        $(INCL)/global.h $(INCL)/coord.h $(INCL)/vmsconf.h \
+        $(INCL)/system.h $(INCL)/unixconf.h $(INCL)/os2conf.h \
+        $(INCL)/micro.h $(INCL)/pcconf.h $(INCL)/tosconf.h \
+        $(INCL)/amiconf.h $(INCL)/macconf.h $(INCL)/beconf.h \
+        $(INCL)/ntconf.h $(INCL)/nhlan.h
+
+HACK_H = $(INCL)/hack.h $(CONFIG_H) $(INCL)/align.h \
+        $(INCL)/dungeon.h $(INCL)/monsym.h $(INCL)/mkroom.h \
+        $(INCL)/objclass.h $(INCL)/youprop.h $(INCL)/prop.h \
+        $(INCL)/permonst.h $(INCL)/monattk.h \
+        $(INCL)/monflag.h $(INCL)/mondata.h $(INCL)/pm.h \
+        $(INCL)/wintype.h $(INCL)/decl.h $(INCL)/quest.h \
+        $(INCL)/spell.h $(INCL)/color.h $(INCL)/obj.h \
+        $(INCL)/you.h $(INCL)/attrib.h $(INCL)/monst.h \
+        $(INCL)/skills.h $(INCL)/onames.h $(INCL)/timeout.h \
+        $(INCL)/trap.h $(INCL)/flag.h $(INCL)/rm.h \
+        $(INCL)/vision.h $(INCL)/display.h $(INCL)/engrave.h \
+        $(INCL)/rect.h $(INCL)/region.h $(INCL)/winprocs.h \
+        $(INCL)/wintty.h $(INCL)/trampoli.h
+
+LEV_H       = $(INCL)/lev.h
+DGN_FILE_H  = $(INCL)/dgn_file.h
+LEV_COMP_H  = $(INCL)/lev_comp.h
+SP_LEV_H    = $(INCL)/sp_lev.h
+TILE_H      = ../win/share/tile.h
+
+#==========================================
+# Miscellaneous
+#==========================================
+
+DATABASE = $(DAT)/data.base
+
+#
+#  The name of the game.
+#
+
+GAMEFILE = $(GAMEDIR)/$(GAME).exe
+
+
+#==========================================
+#=============== TARGETS ==================
+#==========================================
+
+# Since DOS doesn't allow / as path separator, and GCC doesn't allow \ as
+# path separator, we must change all pathnames when performing DOS commands.
+# This is done by blindly applying $(subst /,\, ...) on every command.
+# Where any command contain / for another reason (switch char, or echoing
+# comment lines to lev/dungeon files) a little more care is taken.
+
+#
+#  The default make target (so just typing 'nmake' is useful).
+#
+default : $(GAMEFILE)
+
+#
+#  The main target.
+#
+
+$(GAME) : $(O)obj.tag $(O)utility.tag graphicschk $(GAMEFILE)
+	@echo $(GAME) is up to date.
+
+#
+#  Everything
+#
+
+all :   install
+
+install: graphicschk $(GAME) $(O)install.tag
+	@echo Done.
+
+
+$(O)install.tag:  $(DAT)/data    $(DAT)/rumors    $(DAT)/dungeon \
+        $(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag $(DLB)
+ifeq  "$(USE_DLB)" "Y"
+	$(subst /,\,copy nhdat                $(GAMEDIR))
+	$(subst /,\,copy $(DAT)/license       $(GAMEDIR))
+else
+	$(subst /,\,copy $(DAT)/*.            $(GAMEDIR))
+	$(subst /,\,copy $(DAT)/*.dat         $(GAMEDIR))
+	$(subst /,\,copy $(DAT)/*.lev         $(GAMEDIR))
+	$(subst /,\,if exist $(GAMEDIR)/makefile del $(GAMEDIR)/makefile)
+endif
+	$(subst /,\,if exist $(DOC)/guidebook.txt copy $(DOC)/guidebook.txt $(GAMEDIR)/Guidebook.txt)
+	$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)/NetHack.txt)
+	$(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR)/recover.txt)
+	$(subst /,\,@if exist $(SRC)/$(GAME).PDB copy $(SRC)/$(GAME).pdb $(GAMEDIR)/$(GAME).pdb)
+	$(subst /,\,@if exist $(GAMEDIR)/$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)/$(GAME).pdb to conserve space)
+	$(subst /,\,-copy $(NTSYS)/defaults.nh   $(GAMEDIR)/defaults.nh)
+	$(subst /,\,copy $(U)recover.exe  $(GAMEDIR))
+	$(subst /,\,echo install done > $@)
+
+#  copy $(NTSYS)/winnt.hlp    $(GAMEDIR)
+
+$(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des  $(DAT)/castle.des \
+   $(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des   \
+   $(DAT)/medusa.des  $(DAT)/oracle.des   $(DAT)/tower.des  \
+   $(DAT)/yendor.des  $(DAT)/arch.des     $(DAT)/barb.des   \
+   $(DAT)/caveman.des $(DAT)/healer.des   $(DAT)/knight.des \
+   $(DAT)/monk.des    $(DAT)/priest.des   $(DAT)/ranger.des \
+   $(DAT)/rogue.des   $(DAT)/samurai.des  $(DAT)/sokoban.des \
+   $(DAT)/tourist.des $(DAT)/valkyrie.des $(DAT)/wizard.des
+	$(subst /,\,cd $(DAT)) & \
+	$(subst /,\,$(U)lev_comp bigroom.des) & \
+	$(subst /,\,$(U)lev_comp castle.des) & \
+	$(subst /,\,$(U)lev_comp endgame.des) & \
+	$(subst /,\,$(U)lev_comp gehennom.des) & \
+	$(subst /,\,$(U)lev_comp knox.des) & \
+	$(subst /,\,$(U)lev_comp mines.des) & \
+	$(subst /,\,$(U)lev_comp medusa.des) & \
+	$(subst /,\,$(U)lev_comp oracle.des) & \
+	$(subst /,\,$(U)lev_comp sokoban.des) & \
+	$(subst /,\,$(U)lev_comp tower.des) & \
+	$(subst /,\,$(U)lev_comp yendor.des) & \
+	$(subst /,\,$(U)lev_comp arch.des) & \
+	$(subst /,\,$(U)lev_comp barb.des) & \
+	$(subst /,\,$(U)lev_comp caveman.des) & \
+	$(subst /,\,$(U)lev_comp healer.des) & \
+	$(subst /,\,$(U)lev_comp knight.des) & \
+	$(subst /,\,$(U)lev_comp monk.des) & \
+	$(subst /,\,$(U)lev_comp priest.des) & \
+	$(subst /,\,$(U)lev_comp ranger.des) & \
+	$(subst /,\,$(U)lev_comp rogue.des) & \
+	$(subst /,\,$(U)lev_comp samurai.des) & \
+	$(subst /,\,$(U)lev_comp tourist.des) & \
+	$(subst /,\,$(U)lev_comp valkyrie.des) & \
+	$(subst /,\,$(U)lev_comp wizard.des) & \
+	$(subst /,\,cd $(SRC))
+	$(subst /,\,echo sp_levs done > $(O)sp_lev.tag)
+
+$(O)utility.tag: $(INCL)/date.h $(INCL)/onames.h $(INCL)/pm.h \
+	$(SRC)/monstr.c          $(SRC)/vis_tab.c  \
+	$(U)lev_comp.exe    $(INCL)/vis_tab.h \
+	$(U)dgn_comp.exe $(U)recover.exe  $(TILEUTIL16)
+	$(subst /,\,@echo utilities made >$@)
+	@echo utilities made.
+
+tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe
+	@echo Optional tile development utilities are up to date.
+
+ifeq  "$(GRAPHICAL)" "Y"
+$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
+	$(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp \
+	$(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp \
+	$(WIN32)\splash.bmp
+	@$(rc) -o$@ --include-dir $(WIN32) -i $(WIN32)/winhack.rc
+else
+$(NHRES): $(NTSYS)/console.rc $(NTSYS)/NetHack.ico 
+	@$(rc) -o$@ --include-dir $(NTSYS) -i $(NTSYS)/console.rc
+endif
+
+#==========================================
+#  The main target.
+#==========================================
+
+$(GAMEFILE) : $(ALLOBJ) $(NHRES)
+	@echo Linking....
+	@$(link) $(lflags) -o$@ $(ALLOBJ) $(NHRES)
+	$(subst /,\,@if exist $(O)install.tag del $(O)install.tag)
+
+$(GAME)_.ico : $(NTSYS)/$(GAME).ico
+	$(subst /,\,@copy $(NTSYS)/$(GAME).ico $@)
+
+#==========================================
+# Create directory for holding object files
+#==========================================
+
+graphicschk:
+ifeq  "$(GRAPHICAL)" "Y"
+	@echo ----
+	@echo NOTE: This build will include tile support.
+	@echo ----
+endif
+	$(subst /,\,@echo graphicschk > graphicschk)
+
+#
+#  Secondary Targets.
+#
+
+#==========================================
+# Makedefs Stuff
+#==========================================
+
+$(U)makedefs.exe: $(MAKEOBJS)
+	@$(link) $(LFLAGSU) -o$@ $(MAKEOBJS)
+
+$(O)makedefs.o: $(CONFIG_H) $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/objclass.h \
+	 $(INCL)/monsym.h    $(INCL)/qtext.h     $(INCL)/patchlevel.h \
+	 $(U)makedefs.c
+	$(subst /,\,@if not exist $(O)*.* mkdir $(OBJ))
+	@$(cc) $(CFLAGSU) -o$@ $(U)makedefs.c
+
+#
+#  date.h should be remade every time any of the source or include
+#  files is modified.
+#
+
+$(INCL)/date.h $(OPTIONS_FILE): $(U)makedefs.exe
+	$(subst /,\,$(U)makedefs -v)
+
+#$(OPTIONS_FILE): $(U)makedefs.exe
+#	$(subst /,\,$(U)makedefs -v)
+
+$(INCL)/onames.h : $(U)makedefs.exe
+	$(subst /,\,$(U)makedefs -o)
+
+$(INCL)/pm.h : $(U)makedefs.exe
+	$(subst /,\,$(U)makedefs -p)
+
+#$(INCL)/trap.h : $(U)makedefs.exe
+#  $(U)makedefs -t
+
+$(SRC)/monstr.c: $(U)makedefs.exe
+	$(subst /,\,$(U)makedefs -m)
+
+$(INCL)/vis_tab.h: $(U)makedefs.exe
+	$(subst /,\,$(U)makedefs -z)
+
+$(SRC)/vis_tab.c: $(U)makedefs.exe
+	$(subst /,\,$(U)makedefs -z)
+
+#==========================================
+# uudecode utility and uuencoded targets
+#==========================================
+
+$(U)uudecode.exe: $(O)uudecode.o
+	@$(link) $(LFLAGSU) -o$@ $(O)uudecode.o
+
+$(O)uudecode.o: $(SSYS)/uudecode.c
+
+$(NTSYS)/NetHack.ico : $(U)uudecode.exe $(NTSYS)/nhico.uu
+	$(subst /,\,chdir $(NTSYS)) & \
+	$(subst /,\,uudecode.exe nhico.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/NetHack.ico : $(U)uudecode.exe $(NTSYS)/nhico.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe ../../sys/winnt/nhico.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/mnsel.bmp: $(U)uudecode.exe $(WIN32)/mnsel.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe mnsel.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/mnselcnt.bmp: $(U)uudecode.exe $(WIN32)/mnselcnt.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe mnselcnt.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/mnunsel.bmp: $(U)uudecode.exe $(WIN32)/mnunsel.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe mnunsel.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/petmark.bmp: $(U)uudecode.exe $(WIN32)/petmark.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe petmark.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/rip.bmp: $(U)uudecode.exe $(WIN32)/rip.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe rip.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+$(WIN32)/splash.bmp: $(U)uudecode.exe $(WIN32)/splash.uu
+	$(subst /,\,chdir $(WIN32)) & \
+	$(subst /,\,..\..\util\uudecode.exe splash.uu) & \
+	$(subst /,\,chdir ..\..\src)
+
+
+#==========================================
+# Level Compiler Stuff
+#==========================================
+
+LEVCFLAGS=$(cflags) -c -DWIN32 -D_WIN32 -I../include $(cdebug) -DDLB
+
+$(U)lev_comp.exe: $(SPLEVOBJS)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(SPLEVOBJS)
+
+$(O)lev_yacc.o: $(HACK_H)   $(SP_LEV_H) $(INCL)/lev_comp.h $(U)lev_yacc.c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)lev_yacc.c
+
+$(O)lev_$(LEX).o: $(HACK_H)   $(INCL)/lev_comp.h $(SP_LEV_H) \
+	$(U)lev_$(LEX).c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)lev_$(LEX).c
+
+$(O)lev_main.o:   $(U)lev_main.c $(HACK_H)   $(SP_LEV_H)
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)lev_main.c
+
+
+$(U)lev_yacc.c $(INCL)/lev_comp.h : $(U)lev_comp.y
+ifeq  "$(DO_YACC)" "YACC_ACT"
+	$(subst /,\,chdir $(UTIL)) & \
+	$(subst /,\,$(YACC) -d lev_comp.y) & \
+	$(subst /,\,copy $(YTABC) lev_yacc.c) & \
+	$(subst /,\,copy $(YTABH) $(INCL)/lev_comp.h) & \
+	$(subst /,\,@del $(YTABC)) & \
+	$(subst /,\,@del $(YTABH)) & \
+	$(subst /,\,chdir $(SRC))
+else
+	@echo $(U)lev_comp.y has changed.
+	@echo To update $(U)lev_yacc.c and $(INCL)/lev_comp.h run $(YACC).
+	@echo ---
+	@echo For now, we will copy the prebuilt lev_yacc.c and
+	@echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
+	$(subst /,\,@copy $(SSYS)/lev_yacc.c $(U)lev_yacc.c >nul)
+	$(subst /,\,@copy $(SSYS)/lev_comp.h $(INCL)/lev_comp.h >nul)
+	@echo /**/ $(subst /,\,>>$(U)lev_yacc.c)
+	@echo /**/ $(subst /,\,>>$(INCL)/lev_comp.h)
+endif
+
+$(U)lev_$(LEX).c: $(U)lev_comp.l
+ifeq  "$(DO_LEX)" "LEX_ACT"
+	$(subst /,\,chdir $(UTIL)) & \
+	$(subst /,\,$(LEX) $(FLEXSKEL) lev_comp.l) & \
+	$(subst /,\,copy $(LEXYYC) $@) & \
+	$(subst /,\,@del $(LEXYYC)) & \
+	$(subst /,\,chdir $(SRC))
+else
+	@echo $(U)lev_comp.l has changed. To update $@ run $(LEX).
+	@echo ---
+	@echo For now, we will copy the prebuilt lev_lex.c
+	@echo from $(SSYS) into $(UTIL) and use it.
+	$(subst /,\,@copy $(SSYS)/lev_lex.c $@ >nul)
+	@echo /**/ $(subst /,\,>>$@)
+endif
+
+#==========================================
+# Dungeon Compiler Stuff
+#==========================================
+
+$(U)dgn_comp.exe: $(DGNCOMPOBJS)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(DGNCOMPOBJS)
+
+
+$(O)dgn_yacc.o:   $(HACK_H)   $(DGN_FILE_H) $(INCL)/dgn_comp.h $(U)dgn_yacc.c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)dgn_yacc.c
+
+$(O)dgn_$(LEX).o: $(HACK_H)   $(DGN_FILE_H)  $(INCL)/dgn_comp.h \
+	$(U)dgn_$(LEX).c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)dgn_$(LEX).c
+
+$(O)dgn_main.o:   $(HACK_H) $(U)dgn_main.c
+	@$(cc) $(LEVCFLAGS) -o$@ $(U)dgn_main.c
+
+$(U)dgn_yacc.c $(INCL)/dgn_comp.h : $(U)dgn_comp.y
+ifeq  "$(DO_YACC)" "YACC_ACT"
+	$(subst /,\,chdir $(UTIL)) & \
+	$(subst /,\,$(YACC) -d dgn_comp.y) & \
+	$(subst /,\,copy $(YTABC) dgn_yacc.c) & \
+	$(subst /,\,copy $(YTABH) $(INCL)/dgn_comp.h) & \
+	$(subst /,\,@del $(YTABC)) & \
+	$(subst /,\,@del $(YTABH)) & \
+	$(subst /,\,chdir $(SRC))
+else
+	@echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and
+	@echo $(INCL)/dgn_comp.h run $(YACC).
+	@echo ---
+	@echo For now, we will copy the prebuilt $(U)dgn_yacc.c and
+	@echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
+	$(subst /,\,@copy $(SSYS)/dgn_yacc.c $(U)dgn_yacc.c >nul)
+	$(subst /,\,@copy $(SSYS)/dgn_comp.h $(INCL)/dgn_comp.h >nul)
+	@echo /**/ $(subst /,\,>>$(U)dgn_yacc.c)
+	@echo /**/ $(subst /,\,>>$(INCL)/dgn_comp.h)
+endif
+
+$(U)dgn_$(LEX).c: $(U)dgn_comp.l
+ifeq  "$(DO_LEX)" "LEX_ACT"
+	$(subst /,\,chdir $(UTIL)) & \
+	$(subst /,\,$(LEX) $(FLEXSKEL)  dgn_comp.l) & \
+	$(subst /,\,copy $(LEXYYC) $@) & \
+	$(subst /,\,@del $(LEXYYC)) & \
+	chdir $(SRC)
+else
+	@echo $(U)dgn_comp.l has changed. To update $@ run $(LEX).
+	@echo ---
+	@echo For now, we will copy the prebuilt dgn_lex.c
+	@echo from $(SSYS) into $(UTIL) and use it.
+	$(subst /,\,@copy $(SSYS)/dgn_lex.c $@ >nul)
+	@echo /**/ $(subst /,\,>>$@)
+endif
+
+#==========================================
+# Create directory for holding object files
+#==========================================
+
+$(O)obj.tag:
+	$(subst /,\,@if not exist $(OBJ)/*.* echo creating directory $(OBJ))
+	$(subst /,\,@if not exist $(OBJ)/*.* mkdir $(OBJ))
+	$(subst /,\,@echo directory created > $@)
+
+
+#==========================================
+#=========== SECONDARY TARGETS ============
+#==========================================
+
+#===========================================
+# Header files NOT distributed in ../include
+#===========================================
+
+$(INCL)/win32api.h: $(NTSYS)/win32api.h
+	$(subst /,\,copy $(NTSYS)/win32api.h $@)
+
+
+#==========================================
+# DLB utility and nhdat file creation
+#==========================================
+
+$(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o
+	@$(link) $(LFLAGSU) -o$@ $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o
+
+
+$(O)dlb.o:   $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)/dlb.h
+	@$(cc) $(CFLAGS) -o$@ $(SRC)/dlb.c
+
+$(O)dlb_main.o: $(UTIL)/dlb_main.c $(INCL)/config.h $(INCL)/dlb.h
+	@$(cc) $(CFLAGS) -o$@ $(UTIL)/dlb_main.c
+
+$(DAT)/porthelp: $(NTSYS)/porthelp
+	$(subst /,\,@copy $(NTSYS)/porthelp $@ >nul)
+
+nhdat:  $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \
+	$(DAT)/quest.dat $(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp \
+	$(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp $(DAT)/dungeon $(DAT)/porthelp \
+	$(DAT)/license $(O)sp_lev.tag
+	$(subst /,\,cd $(DAT)) & \
+	echo data >dlb.lst & \
+	echo oracles >>dlb.lst & \
+	(if exist options echo options >>dlb.lst) & \
+	(if exist ttyoptions echo ttyoptions >>dlb.lst) & \
+	(if exist guioptions echo guioptions >>dlb.lst) & \
+	(if exist porthelp echo porthelp >>dlb.lst) & \
+	echo quest.dat >>dlb.lst & \
+	echo rumors >>dlb.lst & \
+	echo help >>dlb.lst & \
+	echo hh >>dlb.lst & \
+	echo cmdhelp >>dlb.lst & \
+	echo history >>dlb.lst & \
+	echo opthelp >>dlb.lst & \
+	echo wizhelp >>dlb.lst & \
+	echo dungeon >>dlb.lst & \
+	echo license >>dlb.lst & \
+	(for %%N in (*.lev) do echo %%N >>dlb.lst) & \
+	$(subst /,\,$(U)dlb_main cIf dlb.lst $(SRC)/nhdat) & \
+	$(subst /,\,cd $(SRC))
+
+#==========================================
+#  Recover Utility
+#==========================================
+
+$(U)recover.exe: $(RECOVOBJS)
+	@$(link) $(LFLAGSU) -o$@ $(RECOVOBJS)
+
+
+$(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)/win32api.h
+	@$(cc) $(CFLAGSU) -o$@ $(U)recover.c
+
+#==========================================
+#  Tile Mapping
+#==========================================
+
+$(SRC)/tile.c: $(U)tilemap.exe
+	@echo A new $@ has been created
+	@$(U)tilemap
+
+$(U)tilemap.exe: $(O)tilemap.o
+	@$(link) $(LFLAGSU) -o$@ $(O)tilemap.o
+
+$(O)tilemap.o: $(WSHR)/tilemap.c $(HACK_H)
+	@$(cc) $(CFLAGSU) -o$@ $(WSHR)/tilemap.c
+
+$(O)tiletx32.o: $(WSHR)/tilemap.c $(HACK_H)
+	@$(CC) $(CFLAGS) -DTILETEXT -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)\tilemap.c
+
+$(O)tiletxt.o: $(WSHR)/tilemap.c $(HACK_H)
+	@$(cc) $(CFLAGS) -DTILETEXT -o$@ $(WSHR)/tilemap.c
+
+$(O)gifread.o: $(WSHR)/gifread.c  $(CONFIG_H) $(TILE_H)
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)/gifread.c
+
+$(O)gifrd32.o: $(WSHR)/gifread.c  $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)/gifread.c
+
+$(O)ppmwrite.o: $(WSHR)/ppmwrite.c $(CONFIG_H) $(TILE_H)
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)/ppmwrite.c
+
+$(O)tiletext.o: $(WSHR)/tiletext.c  $(CONFIG_H) $(TILE_H)
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)/tiletext.c
+
+$(O)tilete32.o: $(WSHR)/tiletext.c  $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)/tiletext.c
+
+#==========================================
+# Optional Tile Utilities
+#==========================================
+
+$(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(GIFREADERS) $(TEXT_IO)
+
+$(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(GIFREADERS32) $(TEXT_IO32)
+
+
+$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(PPMWRITERS) $(TEXT_IO)
+
+
+ifeq  "$(GRAPHICAL)" "Y"
+$(TILEBMP16): $(TILEUTIL16) $(TILEFILES)
+	@echo Creating 16x16 binary tile files (this may take some time)
+	$(subst /,\,@$(U)tile2bmp $(TILEBMP16))
+#$(TILEBMP32): $(TILEUTIL32) $(TILEFILES32)
+#  @echo Creating 32x32 binary tile files (this may take some time)
+#  $(subst /,\,@$(U)til2bm32 $(TILEBMP32))
+else
+$(TILEBMP16):
+$(TILEBMP32):
+endif
+
+$(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(O)tile2bmp.o $(TEXT_IO)
+
+$(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -o$@ $(O)til2bm32.o $(TEXT_IO32)
+
+$(O)tile2bmp.o: $(WSHR)/tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@ $(WSHR)/tile2bmp.c
+
+$(O)til2bm32.o: $(WSHR)/til2bm32.c $(HACK_H) $(TILE_H) $(INCL)/win32api.h
+	@$(cc) $(CFLAGS) -I$(WSHR) -DTILE_X=32 -DTILE_Y=32 -o$@ $(WSHR)/til2bm32.c
+
+#==========================================
+# Housekeeping
+#==========================================
+
+spotless: clean
+ifneq  "$(OBJ)" ""
+	-rmdir $(OBJ) /s /Q
+endif
+	$(subst /,\,if exist graphicschk       del graphicschk)
+	$(subst /,\,if exist $(INCL)/date.h    del $(INCL)/date.h)
+	$(subst /,\,if exist $(INCL)/onames.h  del $(INCL)/onames.h)
+	$(subst /,\,if exist $(INCL)/pm.h      del $(INCL)/pm.h)
+	$(subst /,\,if exist $(INCL)/vis_tab.h del $(INCL)/vis_tab.h)
+	$(subst /,\,if exist $(SRC)/vis_tab.c  del $(SRC)/vis_tab.c)
+	$(subst /,\,if exist $(SRC)/tile.c     del $(SRC)/tile.c)
+	$(subst /,\,if exist $(U)*.lnk         del $(U)*.lnk)
+	$(subst /,\,if exist $(U)*.map         del $(U)*.map)
+	$(subst /,\,if exist $(DAT)/data       del $(DAT)/data)
+	$(subst /,\,if exist $(DAT)/rumors     del $(DAT)/rumors)
+	$(subst /,\,if exist $(DAT)/???-fil?.lev      del $(DAT)/???-fil?.lev)
+	$(subst /,\,if exist $(DAT)/???-goal.lev      del $(DAT)/???-goal.lev)
+	$(subst /,\,if exist $(DAT)/???-loca.lev      del $(DAT)/???-loca.lev)
+	$(subst /,\,if exist $(DAT)/???-strt.lev      del $(DAT)/???-strt.lev)
+	$(subst /,\,if exist $(DAT)/air.lev      del $(DAT)/air.lev)
+	$(subst /,\,if exist $(DAT)/asmodeus.lev      del $(DAT)/asmodeus.lev)
+	$(subst /,\,if exist $(DAT)/astral.lev   del $(DAT)/astral.lev)
+	$(subst /,\,if exist $(DAT)/baalz.lev    del $(DAT)/baalz.lev)
+	$(subst /,\,if exist $(DAT)/bigrm-*.lev  del $(DAT)/bigrm-*.lev)
+	$(subst /,\,if exist $(DAT)/castle.lev   del $(DAT)/castle.lev)
+	$(subst /,\,if exist $(DAT)/data    del $(DAT)/data)
+	$(subst /,\,if exist $(DAT)/dungeon      del $(DAT)/dungeon)
+	$(subst /,\,if exist $(DAT)/dungeon.pdf  del $(DAT)/dungeon.pdf)
+	$(subst /,\,if exist $(DAT)/earth.lev    del $(DAT)/earth.lev)
+	$(subst /,\,if exist $(DAT)/fakewiz?.lev      del $(DAT)/fakewiz?.lev)
+	$(subst /,\,if exist $(DAT)/fire.lev     del $(DAT)/fire.lev)
+	$(subst /,\,if exist $(DAT)/juiblex.lev  del $(DAT)/juiblex.lev)
+	$(subst /,\,if exist $(DAT)/knox.lev     del $(DAT)/knox.lev)
+	$(subst /,\,if exist $(DAT)/medusa-?.lev      del $(DAT)/medusa-?.lev)
+	$(subst /,\,if exist $(DAT)/mine*.lev    del $(DAT)/mine*.lev)
+	$(subst /,\,if exist $(DAT)/options      del $(DAT)/options)
+	$(subst /,\,if exist $(DAT)/ttyoptions   del $(DAT)/ttyoptions)
+	$(subst /,\,if exist $(DAT)/guioptions   del $(DAT)/guioptions)
+	$(subst /,\,if exist $(DAT)/oracle.lev   del $(DAT)/oracle.lev)
+	$(subst /,\,if exist $(DAT)/oracles      del $(DAT)/oracles)
+	$(subst /,\,if exist $(DAT)/orcus.lev    del $(DAT)/orcus.lev)
+	$(subst /,\,if exist $(DAT)/rumors  del $(DAT)/rumors)
+	$(subst /,\,if exist $(DAT)/quest.dat    del $(DAT)/quest.dat)
+	$(subst /,\,if exist $(DAT)/sanctum.lev  del $(DAT)/sanctum.lev)
+	$(subst /,\,if exist $(DAT)/soko?-?.lev  del $(DAT)/soko?-?.lev)
+	$(subst /,\,if exist $(DAT)/tower?.lev   del $(DAT)/tower?.lev)
+	$(subst /,\,if exist $(DAT)/valley.lev   del $(DAT)/valley.lev)
+	$(subst /,\,if exist $(DAT)/water.lev    del $(DAT)/water.lev)
+	$(subst /,\,if exist $(DAT)/wizard?.lev  del $(DAT)/wizard?.lev)
+	$(subst /,\,if exist $(O)sp_lev.tag     del $(O)sp_lev.tag)
+	$(subst /,\,if exist $(SRC)/monstr.c    del $(SRC)/monstr.c)
+	$(subst /,\,if exist $(SRC)/vis_tab.c   del $(SRC)/vis_tab.c)
+	$(subst /,\,if exist $(U)recover.exe    del $(U)recover.exe)
+	$(subst /,\,if exist $(DAT)/dlb.lst      del $(DAT)/dlb.lst)
+	$(subst /,\,if exist nhdat.         del nhdat.)
+
+clean:
+	$(subst /,\,if exist $(O)*.o del $(O)*.o)
+	$(subst /,\,if exist $(O)utility.tag   del $(O)utility.tag)
+	$(subst /,\,if exist $(U)makedefs.exe  del $(U)makedefs.exe)
+	$(subst /,\,if exist $(U)lev_comp.exe  del $(U)lev_comp.exe)
+	$(subst /,\,if exist $(U)dgn_comp.exe  del $(U)dgn_comp.exe)
+	$(subst /,\,if exist $(SRC)/*.lnk      del $(SRC)/*.lnk)
+	$(subst /,\,if exist $(SRC)/*.map      del $(SRC)/*.map)
+	$(subst /,\,if exist $(TILEBMP16)      del $(TILEBMP16))
+	$(subst /,\,if exist $(TILEBMP32)      del $(TILEBMP32))
+
+#===================================================================
+# OTHER DEPENDENCIES
+#===================================================================
+
+#
+# dat dependencies
+#
+
+$(DAT)/data: $(O)utility.tag    $(DATABASE)
+	$(subst /,\,$(U)makedefs -d)
+
+$(DAT)/rumors: $(O)utility.tag    $(DAT)/rumors.tru   $(DAT)/rumors.fal
+	$(subst /,\,$(U)makedefs -r)
+
+$(DAT)/quest.dat: $(O)utility.tag  $(DAT)/quest.txt
+	$(subst /,\,$(U)makedefs -q)
+
+$(DAT)/oracles: $(O)utility.tag    $(DAT)/oracles.txt
+	$(subst /,\,$(U)makedefs -h)
+
+$(DAT)/dungeon: $(O)utility.tag  $(DAT)/dungeon.def
+	$(subst /,\,$(U)makedefs -e)
+	$(subst /,\,cd $(DAT)) & \
+	$(subst /,\,$(U)dgn_comp dungeon.pdf) & \
+	$(subst /,\,cd $(SRC))
+
+#
+# NT dependencies
+#
+
+$(O)nttty.o:   $(HACK_H) $(TILE_H) $(INCL)/win32api.h $(NTSYS)/nttty.c
+	@$(cc) $(CFLAGS) -I$(WSHR) -o$@  $(NTSYS)/nttty.c
+$(O)winnt.o: $(HACK_H) $(INCL)/win32api.h $(NTSYS)/winnt.c
+	@$(cc) $(CFLAGS) -o$@  $(NTSYS)/winnt.c
+$(O)ntsound.o: $(HACK_H) $(NTSYS)/ntsound.c
+	@$(cc) $(CFLAGS)  -o$@ $(NTSYS)/ntsound.c
+$(O)mapimail.o: $(HACK_H) $(INCL)/nhlan.h $(NTSYS)/mapimail.c
+	@$(cc) $(CFLAGS) -DMAPI_VERBOSE  -o$@ $(NTSYS)/mapimail.c
+
+#
+# util dependencies
+#
+
+$(O)panic.o:  $(U)panic.c $(CONFIG_H)
+	@$(cc) $(CFLAGS) -o$@ $(U)panic.c
+
+#
+# The rest are stolen from sys/unix/Makefile.src,
+# and -c (which is included in CFLAGS) substituted
+# with -o$@ , but otherwise untouched. That
+# means that there is some irrelevant stuff
+# in here, but maintenance should be easier.
+#
+$(O)tos.o: ../sys/atari/tos.c $(HACK_H) $(INCL)/tcap.h
+	$(cc) $(CFLAGS) -o$@ ../sys/atari/tos.c
+$(O)pcmain.o: ../sys/share/pcmain.c $(HACK_H) $(INCL)/dlb.h \
+	     $(INCL)/win32api.h
+	$(cc) $(CFLAGS) -o$@ ../sys/share/pcmain.c
+$(O)pcsys.o: ../sys/share/pcsys.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ../sys/share/pcsys.c
+$(O)pctty.o: ../sys/share/pctty.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ../sys/share/pctty.c
+$(O)pcunix.o: ../sys/share/pcunix.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ../sys/share/pcunix.c
+$(O)random.o: ../sys/share/random.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ../sys/share/random.c
+$(O)ioctl.o: ../sys/share/ioctl.c $(HACK_H) $(INCL)/tcap.h
+	$(cc) $(CFLAGS) -o$@ ../sys/share/ioctl.c
+$(O)unixtty.o: ../sys/share/unixtty.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ../sys/share/unixtty.c
+$(O)unixmain.o: ../sys/unix/unixmain.c $(HACK_H) $(INCL)/dlb.h
+	$(cc) $(CFLAGS) -o$@ ../sys/unix/unixmain.c
+$(O)unixunix.o: ../sys/unix/unixunix.c $(HACK_H)
+	$(cc) $(CFLAGS) -o$@ ../sys/unix/unixunix.c
+$(O)bemain.o: ../sys/be/bemain.c $(HACK_H) $(INCL)/dlb.h
+	$(cc) $(CFLAGS) -o$@ ../sys/be/bemain.c
+$(O)getline.o: ../win/tty/getline.c $(HACK_H) $(INCL)/func_tab.h
+	$(cc) $(CFLAGS) -o$@ ../win/tty/getline.c
+$(O)termcap.o: ../win/tty/termcap.c $(HACK_H) $(INCL)/tcap.h
+	$(cc) $(CFLAGS) -o$@ ../win/tty/termcap.c
+$(O)topl.o: ../win/tty/topl.c $(HACK_H) $(INCL)/tcap.h
+	$(cc) $(CFLAGS) -o$@ ../win/tty/topl.c
+$(O)wintty.o: ../win/tty/wintty.c $(HACK_H) $(INCL)/dlb.h \
+	     $(INCL)/patchlevel.h $(INCL)/tcap.h
+	$(cc) $(CFLAGS) -o$@ ../win/tty/wintty.c
+$(O)Window.o: ../win/X11/Window.c $(INCL)/xwindowp.h $(INCL)/xwindow.h \
+	     $(CONFIG_H)
+	$(cc) $(CFLAGS) -o$@ ../win/X11/Window.c
+$(O)dialogs.o: ../win/X11/dialogs.c $(CONFIG_H)
+	$(cc) $(CFLAGS) -o$@ ../win/X11/dialogs.c
+$(O)winX.o: ../win/X11/winX.c $(HACK_H) $(INCL)/winX.h $(INCL)/dlb.h \
+	     $(INCL)/patchlevel.h ../win/X11/nh72icon \
+	     ../win/X11/nh56icon ../win/X11/nh32icon
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winX.c
+$(O)winmap.o: ../win/X11/winmap.c $(INCL)/xwindow.h $(HACK_H) $(INCL)/dlb.h \
+	     $(INCL)/winX.h $(INCL)/tile2x11.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winmap.c
+$(O)winmenu.o: ../win/X11/winmenu.c $(HACK_H) $(INCL)/winX.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winmenu.c
+$(O)winmesg.o: ../win/X11/winmesg.c $(INCL)/xwindow.h $(HACK_H) $(INCL)/winX.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winmesg.c
+$(O)winmisc.o: ../win/X11/winmisc.c $(HACK_H) $(INCL)/func_tab.h \
+	     $(INCL)/winX.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winmisc.c
+$(O)winstat.o: ../win/X11/winstat.c $(HACK_H) $(INCL)/winX.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winstat.c
+$(O)wintext.o: ../win/X11/wintext.c $(HACK_H) $(INCL)/winX.h $(INCL)/xwindow.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/wintext.c
+$(O)winval.o: ../win/X11/winval.c $(HACK_H) $(INCL)/winX.h
+	$(cc) $(CFLAGS) -o$@ ../win/X11/winval.c
+$(O)tile.o: $(SRC)/tile.c $(HACK_H)
+$(O)gnaskstr.o: ../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \
+	     ../win/gnome/gnmain.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnaskstr.c
+$(O)gnbind.o: ../win/gnome/gnbind.c ../win/gnome/gnbind.h ../win/gnome/gnmain.h \
+	     ../win/gnome/gnaskstr.h ../win/gnome/gnyesno.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnbind.c
+$(O)gnglyph.o: ../win/gnome/gnglyph.c ../win/gnome/gnglyph.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnglyph.c
+$(O)gnmain.o: ../win/gnome/gnmain.c ../win/gnome/gnmain.h ../win/gnome/gnsignal.h \
+	     ../win/gnome/gnbind.h ../win/gnome/gnopts.h $(HACK_H) \
+	     $(INCL)/date.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmain.c
+$(O)gnmap.o: ../win/gnome/gnmap.c ../win/gnome/gnmap.h ../win/gnome/gnglyph.h \
+	     ../win/gnome/gnsignal.h $(HACK_H)
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmap.c
+$(O)gnmenu.o: ../win/gnome/gnmenu.c ../win/gnome/gnmenu.h ../win/gnome/gnmain.h \
+	     ../win/gnome/gnbind.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmenu.c
+$(O)gnmesg.o: ../win/gnome/gnmesg.c ../win/gnome/gnmesg.h ../win/gnome/gnsignal.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnmesg.c
+$(O)gnopts.o: ../win/gnome/gnopts.c ../win/gnome/gnopts.h ../win/gnome/gnglyph.h \
+	     ../win/gnome/gnmain.h ../win/gnome/gnmap.h $(HACK_H)
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnopts.c
+$(O)gnplayer.o: ../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \
+	     ../win/gnome/gnmain.h $(HACK_H)
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnplayer.c
+$(O)gnsignal.o: ../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \
+	     ../win/gnome/gnmain.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnsignal.c
+$(O)gnstatus.o: ../win/gnome/gnstatus.c ../win/gnome/gnstatus.h \
+	     ../win/gnome/gnsignal.h ../win/gnome/gn_xpms.h \
+	     ../win/gnome/gnomeprv.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnstatus.c
+$(O)gntext.o: ../win/gnome/gntext.c ../win/gnome/gntext.h ../win/gnome/gnmain.h \
+	     ../win/gnome/gn_rip.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gntext.c
+$(O)gnyesno.o: ../win/gnome/gnyesno.c ../win/gnome/gnbind.h ../win/gnome/gnyesno.h
+	$(cc) $(CFLAGS) $(GNOMEINC) -c ../win/gnome/gnyesno.c
+$(O)wingem.o: ../win/gem/wingem.c $(HACK_H) $(INCL)/func_tab.h $(INCL)/dlb.h \
+	     $(INCL)/patchlevel.h $(INCL)/wingem.h
+	$(cc) $(CFLAGS) -o$@ ../win/gem/wingem.c
+$(O)wingem1.o: ../win/gem/wingem1.c $(INCL)/gem_rsc.h $(INCL)/load_img.h \
+	     $(INCL)/wintype.h $(INCL)/wingem.h
+	$(cc) $(CFLAGS) -o$@ ../win/gem/wingem1.c
+$(O)load_img.o: ../win/gem/load_img.c $(INCL)/load_img.h
+	$(cc) $(CFLAGS) -o$@ ../win/gem/load_img.c
+$(O)tile.o: tile.c $(HACK_H)
+$(O)qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) $(INCL)/func_tab.h \
+	     $(INCL)/dlb.h $(INCL)/patchlevel.h $(INCL)/qt_win.h \
+	     $(INCL)/qt_clust.h $(INCL)/qt_kde0.h \
+	     $(INCL)/qt_xpms.h qt_win.moc qt_kde0.moc
+	$(CXX) $(CXXFLAGS) -c ../win/Qt/qt_win.cpp
+$(O)qt_clust.o: ../win/Qt/qt_clust.cpp $(INCL)/qt_clust.h
+	$(CXX) $(CXXFLAGS) -c ../win/Qt/qt_clust.cpp
+$(O)monstr.o: $(SRC)/monstr.c $(CONFIG_H)
+$(O)vis_tab.o: $(SRC)/vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h
+$(O)allmain.o: allmain.c $(HACK_H)
+$(O)alloc.o: alloc.c $(CONFIG_H)
+$(O)apply.o: apply.c $(HACK_H) $(INCL)/edog.h
+$(O)artifact.o: artifact.c $(HACK_H) $(INCL)/artifact.h $(INCL)/artilist.h
+$(O)attrib.o: attrib.c $(HACK_H) $(INCL)/artifact.h
+$(O)ball.o: ball.c $(HACK_H)
+$(O)bones.o: bones.c $(HACK_H) $(INCL)/lev.h
+$(O)botl.o: botl.c $(HACK_H)
+$(O)cmd.o: cmd.c $(HACK_H) $(INCL)/func_tab.h
+$(O)dbridge.o: dbridge.c $(HACK_H)
+$(O)decl.o: decl.c $(HACK_H)
+$(O)detect.o: detect.c $(HACK_H) $(INCL)/artifact.h
+$(O)dig.o: dig.c $(HACK_H) $(INCL)/edog.h
+$(O)display.o: display.c $(HACK_H)
+$(O)dlb.o: dlb.c $(CONFIG_H) $(INCL)/dlb.h
+$(O)do.o: do.c $(HACK_H) $(INCL)/lev.h
+$(O)do_name.o: do_name.c $(HACK_H)
+$(O)do_wear.o: do_wear.c $(HACK_H)
+$(O)dog.o: dog.c $(HACK_H) $(INCL)/edog.h
+$(O)dogmove.o: dogmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/edog.h
+$(O)dokick.o: dokick.c $(HACK_H) $(INCL)/eshk.h
+$(O)dothrow.o: dothrow.c $(HACK_H)
+$(O)drawing.o: drawing.c $(HACK_H) $(INCL)/tcap.h
+$(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)/dgn_file.h $(INCL)/dlb.h
+$(O)eat.o: eat.c $(HACK_H)
+$(O)end.o: end.c $(HACK_H) $(INCL)/eshk.h $(INCL)/dlb.h
+$(O)engrave.o: engrave.c $(HACK_H) $(INCL)/lev.h
+$(O)exper.o: exper.c $(HACK_H)
+$(O)explode.o: explode.c $(HACK_H)
+$(O)extralev.o: extralev.c $(HACK_H)
+$(O)files.o: files.c $(HACK_H) $(INCL)/dlb.h
+$(O)fountain.o: fountain.c $(HACK_H)
+$(O)hack.o: hack.c $(HACK_H)
+$(O)hacklib.o: hacklib.c $(HACK_H)
+$(O)invent.o: invent.c $(HACK_H) $(INCL)/artifact.h
+$(O)light.o: light.c $(HACK_H) $(INCL)/lev.h
+$(O)lock.o: lock.c $(HACK_H)
+$(O)mail.o: mail.c $(HACK_H) $(INCL)/mail.h
+$(O)makemon.o: makemon.c $(HACK_H) $(INCL)/epri.h $(INCL)/emin.h \
+	$(INCL)/edog.h
+$(O)mapglyph.o: mapglyph.c $(HACK_H)
+$(O)mcastu.o: mcastu.c $(HACK_H)
+$(O)mhitm.o: mhitm.c $(HACK_H) $(INCL)/artifact.h $(INCL)/edog.h
+$(O)mhitu.o: mhitu.c $(HACK_H) $(INCL)/artifact.h $(INCL)/edog.h
+$(O)minion.o: minion.c $(HACK_H) $(INCL)/emin.h $(INCL)/epri.h
+$(O)mklev.o: mklev.c $(HACK_H)
+$(O)mkmap.o: mkmap.c $(HACK_H) $(INCL)/sp_lev.h
+$(O)mkmaze.o: mkmaze.c $(HACK_H) $(INCL)/sp_lev.h $(INCL)/lev.h
+$(O)mkobj.o: mkobj.c $(HACK_H) $(INCL)/artifact.h
+$(O)mkroom.o: mkroom.c $(HACK_H)
+$(O)mon.o: mon.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/edog.h
+$(O)mondata.o: mondata.c $(HACK_H) $(INCL)/eshk.h $(INCL)/epri.h
+$(O)monmove.o: monmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/artifact.h
+$(O)monst.o: monst.c $(CONFIG_H) $(INCL)/permonst.h $(INCL)/align.h \
+	$(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/monsym.h \
+	$(INCL)/dungeon.h $(INCL)/eshk.h $(INCL)/vault.h \
+	$(INCL)/epri.h $(INCL)/color.h
+$(O)mplayer.o: mplayer.c $(HACK_H)
+$(O)mthrowu.o: mthrowu.c $(HACK_H)
+$(O)muse.o: muse.c $(HACK_H) $(INCL)/edog.h
+$(O)music.o: music.c $(HACK_H) #interp.c
+$(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h
+$(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \
+	$(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h
+$(O)objnam.o: objnam.c $(HACK_H)
+$(O)options.o: options.c $(CONFIG_H) $(INCL)/objclass.h $(INCL)/flag.h \
+	$(HACK_H) $(INCL)/tcap.h
+$(O)pager.o: pager.c $(HACK_H) $(INCL)/dlb.h
+$(O)pickup.o: pickup.c $(HACK_H)
+$(O)pline.o: pline.c $(HACK_H) $(INCL)/epri.h $(INCL)/edog.h
+$(O)polyself.o: polyself.c $(HACK_H)
+$(O)potion.o: potion.c $(HACK_H)
+$(O)pray.o: pray.c $(HACK_H) $(INCL)/epri.h
+$(O)priest.o: priest.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/eshk.h \
+	$(INCL)/epri.h $(INCL)/emin.h
+$(O)quest.o: quest.c $(HACK_H) $(INCL)/qtext.h
+$(O)questpgr.o: questpgr.c $(HACK_H) $(INCL)/dlb.h $(INCL)/qtext.h
+$(O)read.o: read.c $(HACK_H)
+$(O)rect.o: rect.c $(HACK_H)
+$(O)region.o: region.c $(HACK_H) $(INCL)/lev.h
+$(O)restore.o: restore.c $(HACK_H) $(INCL)/lev.h $(INCL)/tcap.h
+$(O)rip.o: rip.c $(HACK_H)
+$(O)rnd.o: rnd.c $(HACK_H)
+$(O)role.o: role.c $(HACK_H)
+$(O)rumors.o: rumors.c $(HACK_H) $(INCL)/lev.h $(INCL)/dlb.h
+$(O)save.o: save.c $(HACK_H) $(INCL)/lev.h
+$(O)shk.o: shk.c $(HACK_H) $(INCL)/eshk.h
+$(O)shknam.o: shknam.c $(HACK_H) $(INCL)/eshk.h
+$(O)sit.o: sit.c $(HACK_H) $(INCL)/artifact.h
+$(O)sounds.o: sounds.c $(HACK_H) $(INCL)/edog.h
+$(O)sp_lev.o: sp_lev.c $(HACK_H) $(INCL)/dlb.h $(INCL)/sp_lev.h
+$(O)spell.o: spell.c $(HACK_H)
+$(O)steal.o: steal.c $(HACK_H)
+$(O)steed.o: steed.c $(HACK_H)
+$(O)teleport.o: teleport.c $(HACK_H)
+$(O)timeout.o: timeout.c $(HACK_H) $(INCL)/lev.h
+$(O)topten.o: topten.c $(HACK_H) $(INCL)/dlb.h $(INCL)/patchlevel.h
+$(O)track.o: track.c $(HACK_H)
+$(O)trap.o: trap.c $(HACK_H)
+$(O)u_init.o: u_init.c $(HACK_H)
+$(O)uhitm.o: uhitm.c $(HACK_H)
+$(O)vault.o: vault.c $(HACK_H) $(INCL)/vault.h
+$(O)version.o: version.c $(HACK_H) $(INCL)/date.h $(INCL)/patchlevel.h
+$(O)vision.o: vision.c $(HACK_H) $(INCL)/vis_tab.h
+$(O)weapon.o: weapon.c $(HACK_H)
+$(O)were.o: were.c $(HACK_H)
+$(O)wield.o: wield.c $(HACK_H)
+$(O)windows.o: windows.c $(HACK_H) $(INCL)/wingem.h $(INCL)/winGnome.h
+$(O)wizard.o: wizard.c $(HACK_H) $(INCL)/qtext.h
+$(O)worm.o: worm.c $(HACK_H) $(INCL)/lev.h
+$(O)worn.o: worn.c $(HACK_H)
+$(O)write.o: write.c $(HACK_H)
+$(O)zap.o: zap.c $(HACK_H)
+
+# end of file
+
diff -Naurd ../nethack-3.3.1/sys/winnt/Makefile.msc ./sys/winnt/Makefile.msc
--- ../nethack-3.3.1/sys/winnt/Makefile.msc Thu Jan 1 01:00:00 1970
+++ ./sys/winnt/Makefile.msc Fri Mar 22 14:40:55 2002
@@ -0,0 +1,1345 @@
+#       SCCS Id: @(#)Makefile.nt       3.4     2002/02/28
+#       Copyright (c) NetHack PC Development Team 1993-2001
+#
+#       NetHack 3.4.x Makefile for MS Visual C++ V6.x and above and MS NMAKE
+#  
+#       Win32 Compilers Tested:
+#                              - Microsoft 32 bit Visual C++ V4.x
+#                              - Microsoft 32 bit Visual C++ V6.0 SP3, SP4
+#
+#	This is used for building a TTY version of NetHack using WIN32 Console
+#	I/O routines only.
+#
+#       In addition to your C compiler,
+#
+#       if you want to change           you will need a
+#       files with suffix               workalike for
+#              .y                           yacc   (such as bison)
+#              .l                           lex    (such as flex)
+#
+#
+#       If you have any questions read the sys/winnt/Install.nt file included 
+#       with the distribution.
+#       --
+#       Michael Allison
+#==============================================================================
+# Do not delete the following 3 lines.
+#
+TARGETOS=BOTH
+APPVER=4.0
+!include <win32.mak>
+
+# Graphical interface
+# Set to Y for a graphical version
+
+#GRAPHICAL = Y
+
+#
+#  Set the gamedir according to your preference.  
+#  If not present prior to compilation it gets created.
+
+GAME    = NetHack                 # Game Name
+GAMEDIR = ..\binary               # Game directory
+
+#
+#  Source directories.    Makedefs hardcodes these, don't change them.
+#
+
+INCL  = ..\include   # NetHack include files
+DAT   = ..\dat       # NetHack data files
+DOC   = ..\doc       # NetHack documentation files
+UTIL  = ..\util      # Utility source
+SRC   = ..\src       # Main source
+SSYS  = ..\sys\share # Shared system files
+NTSYS = ..\sys\winnt # NT Win32 specific files
+TTY   = ..\win\tty   # window port files (tty)
+WIN32 = ..\win\win32 # window port files (Win32)
+WSHR  = ..\win\share # Tile support files 
+
+#
+#  Object directory.
+#
+
+OBJ     = o
+
+
+#
+#==========================================
+# Exe File Info.
+#==========================================
+ 
+# Yacc/Lex ... if you got 'em.
+#
+# If you have yacc and lex programs (or work-alike such as bison 
+# and flex), comment out the upper two macros and uncomment 
+# the lower two.
+#
+
+DO_YACC = YACC_MSG
+DO_LEX  = LEX_MSG
+#DO_YACC  = YACC_ACT
+#DO_LEX   = LEX_ACT
+
+# - Specify your yacc and lex programs (or work-alikes) here.
+
+#YACC	= bison -y
+YACC   = byacc
+#YACC	= yacc
+
+#LEX	= lex
+LEX	= flex
+
+#
+# - Specify your flex skeleton file (if needed).
+#
+
+FLEXSKEL =
+#FLEXSKEL = -S../tools/flex.ske
+
+YTABC   = y_tab.c
+YTABH   = y_tab.h
+LEXYYC  = lexyy.c
+
+#
+# Optional high-quality BSD random number generation routines
+# (see pcconf.h). Set to nothing if not used.
+#
+
+RANDOM	= $(OBJ)\random.o
+#RANDOM	=
+
+#
+# - For debugging ability, comment out the upper two 
+#   macros and uncomment the lower two.
+#
+
+#
+#  Leave the next two lines uncommented _ONLY_ if you do NOT want any
+#  debug capability in the object files, or in the NetHack executable.
+#  Comment them if you want debug capability.
+
+#cdebug =
+#linkdebug =
+
+#
+# Compiler and Linker flags
+#
+
+PRECOMPHEAD = N			# set to Y if you want to use precomp. headers
+
+#===============================================
+#======= End of Modification Section ===========
+#===============================================
+################################################
+#                                              #
+# Nothing below here should have to be changed.#
+#                                              #
+################################################
+
+!IF "$(GRAPHICAL)" == "Y"
+WINPORT  = $(O)tile.o $(O)mhaskyn.o $(O)mhdlg.o \
+	$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
+	$(O)mhmenu.o $(O)mhmsgwnd.o $(O)mhrip.o $(O)mhsplash.o \
+	$(O)mhstatus.o $(O)mhtext.o $(O)mswproc.o $(O)winhack.o
+WINPFLAG   = -DTILES -DMSWIN_GRAPHICS
+NHRES   = $(O)winhack.res
+WINPINC  = -I$(WIN32)
+WINPHDR   = $(WIN32)\mhaskyn.h $(WIN32)\mhdlg.h $(WIN32)\mhfont.h \
+	$(WIN32)\mhinput.h $(WIN32)\mhmain.h $(WIN32)\mhmap.h $(WIN32)\mhmenu.h \
+	$(WIN32)\mhmsg.h $(WIN32)\mhmsgwnd.h $(WIN32)\mhrip.h $(WIN32)\mhstatus.h \
+	$(WIN32)\mhtext.h $(WIN32)\resource.h $(WIN32)\winMS.h
+!ELSE
+WINPORT  = $(O)nttty.o    
+WINPFLAG   = -DWIN32CON
+WINPHDR   =
+NHRES   = $(O)console.res
+WINPINC  =
+!ENDIF
+
+TILEUTIL16  = $(UTIL)\tile2bmp.exe
+TILEBMP16   = $(SRC)\tiles.bmp
+
+TILEUTIL32  = $(UTIL)\til2bm32.exe
+TILEBMP32   = $(SRC)\tiles32.bmp
+
+#SOUND = $(OBJ)\ntsound.o
+
+#SOUND =
+
+# To store all the level files,
+# help files, etc. in a single library file.
+# USE_DLB = Y is left uncommented
+
+USE_DLB = Y
+
+! IF ("$(USE_DLB)"=="Y")
+DLBFLG = -DDLB
+! ELSE
+DLBFLG =
+! ENDIF
+
+#==========================================
+# Setting up the compiler and linker
+# macros. All builds include the base ones.
+#==========================================
+
+CFLAGSBASE  = -c $(cflags) $(cvarsmt) -I$(INCL) -nologo $(cdebug) $(WINPINC)
+LFLAGSBASEC = $(linkdebug) /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 $(conlibsmt)
+LFLAGSBASEG = $(linkdebug) $(guiflags) $(guilibsmt) comctl32.lib
+
+#==========================================
+# Util builds
+#==========================================
+
+CFLAGSU = $(CFLAGSBASE) $(WINPFLAG)
+LFLAGSU	= $(LFLAGSBASEC)
+
+#==========================================
+# - Game build
+#==========================================
+LFLAGSBASE = $(linkdebug) /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 $(conlibsmt)
+CFLAGS	 = $(CFLAGSBASE) $(WINPFLAG) $(DLBFLG)
+NHLFLAGS1 = /NODEFAULTLIB /INCREMENTAL:NO /PDB:"$(GAME).PDB" /RELEASE /NOLOGO
+NHLFLAGS2 = /MAP:"$(GAME).MAP" /MACHINE:$(CPU) -IGNORE:505 
+!IF ("$(GRAPHICAL)"=="Y")
+LFLAGS	= $(LFLAGSBASEG) $(NHLFLAGS1) $(NHLFLAGS2)
+!ELSE
+LFLAGS	= $(LFLAGSBASEC) $(NHLFLAGS1) $(NHLFLAGS2)
+!ENDIF
+
+GAMEFILE = $(GAMEDIR)\$(GAME).exe # whole thing
+
+! IF ("$(USE_DLB)"=="Y")
+DLB = nhdat
+! ELSE
+DLB =
+! ENDIF
+
+#==========================================
+#================ RULES ==================
+#==========================================
+
+.SUFFIXES: .exe .o .til .uu .c .y .l
+
+#==========================================
+# Rules for files in src
+#==========================================
+
+.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -Fo$@ $<
+
+{$(SRC)}.c{$(OBJ)}.o:
+	@$(CC) $(CFLAGS)   -Fo$@  $<
+
+#==========================================
+# Rules for files in sys\share
+#==========================================
+
+{$(SSYS)}.c{$(OBJ)}.o:
+	@$(CC) $(CFLAGS)  -Fo$@  $<
+
+#==========================================
+# Rules for files in sys\winnt
+#==========================================
+
+{$(NTSYS)}.c{$(OBJ)}.o:
+	@$(CC) $(CFLAGS)  -Fo$@  $<
+
+{$(NTSYS)}.h{$(INCL)}.h:
+	@copy $< $@
+
+#==========================================
+# Rules for files in util
+#==========================================
+
+{$(UTIL)}.c{$(OBJ)}.o:
+	@$(CC) $(CFLAGSU) -Fo$@ $<
+
+#==========================================
+# Rules for files in win\share
+#==========================================
+
+{$(WSHR)}.c{$(OBJ)}.o:
+	@$(CC) $(CFLAGS)  -Fo$@ $<
+
+{$(WSHR)}.h{$(INCL)}.h:
+	@copy $< $@
+
+#{$(WSHR)}.txt{$(DAT)}.txt:
+#	@copy $< $@
+
+#==========================================
+# Rules for files in win\tty
+#==========================================
+
+{$(TTY)}.c{$(OBJ)}.o:
+	@$(CC) $(CFLAGS)  -Fo$@  $<
+
+
+#==========================================
+# Rules for files in win\win32
+#==========================================
+
+{$(WIN32)}.c{$(OBJ)}.o:
+	@$(cc) $(CFLAGS)  -Fo$@  $<
+
+#==========================================
+#================ MACROS ==================
+#==========================================
+# This section creates shorthand macros for many objects
+# referenced later on in the Makefile.
+#
+
+DEFFILE = $(NTSYS)\$(GAME).def
+
+#
+# Shorten up the location for some files
+#
+
+O  = $(OBJ)^\
+
+U  = $(UTIL)^\
+
+#
+# Utility Objects.
+#
+
+MAKESRC        = $(U)makedefs.c
+
+SPLEVSRC       = $(U)lev_yacc.c	$(U)lev_$(LEX).c $(U)lev_main.c  $(U)panic.c
+
+DGNCOMPSRC     = $(U)dgn_yacc.c	$(U)dgn_$(LEX).c $(U)dgn_main.c
+
+MAKEOBJS       = $(O)makedefs.o $(O)monst.o $(O)objects.o
+
+SPLEVOBJS      = $(O)lev_yacc.o	$(O)lev_$(LEX).o $(O)lev_main.o \
+		 $(O)alloc.o	$(O)decl.o	$(O)drawing.o \
+		 $(O)monst.o	$(O)objects.o	$(O)panic.o
+
+DGNCOMPOBJS    = $(O)dgn_yacc.o	$(O)dgn_$(LEX).o $(O)dgn_main.o \
+		 $(O)alloc.o	$(O)panic.o
+
+RECOVOBJS      = $(O)recover.o
+
+TILEFILES      = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
+
+#
+# These are not invoked during a normal game build in 3.4.0
+#
+TEXT_IO        = $(O)tiletext.o	$(O)tiletxt.o	$(O)drawing.o \
+		 $(O)decl.o	$(O)monst.o	$(O)objects.o
+
+TEXT_IO32      = $(O)tilete32.o $(O)tiletx32.o $(O)drawing.o \
+		 $(O)decl.o	$(O)monst.o	$(O)objects.o
+
+GIFREADERS     = $(O)gifread.o	$(O)alloc.o $(O)panic.o
+GIFREADERS32   = $(O)gifrd32.o $(O)alloc.o $(O)panic.o
+
+PPMWRITERS     = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
+
+#
+#  Object files for the game itself.
+#
+
+VOBJ01 = $(O)allmain.o  $(O)alloc.o    $(O)apply.o    $(O)artifact.o
+VOBJ02 = $(O)attrib.o   $(O)ball.o     $(O)bones.o    $(O)botl.o    
+VOBJ03 = $(O)cmd.o      $(O)dbridge.o  $(O)decl.o     $(O)detect.o  
+VOBJ04 = $(O)dig.o      $(O)display.o  $(O)do.o       $(O)do_name.o 
+VOBJ05 = $(O)do_wear.o  $(O)dog.o      $(O)dogmove.o  $(O)dokick.o  
+VOBJ06 = $(O)dothrow.o  $(O)drawing.o  $(O)dungeon.o  $(O)eat.o     
+VOBJ07 = $(O)end.o      $(O)engrave.o  $(O)exper.o    $(O)explode.o 
+VOBJ08 = $(O)extralev.o $(O)files.o    $(O)fountain.o $(O)hack.o    
+VOBJ09 = $(O)hacklib.o  $(O)invent.o   $(O)light.o    $(O)lock.o    
+VOBJ10 = $(O)mail.o     $(O)pcmain.o   $(O)makemon.o  $(O)mapglyph.o $(O)mcastu.o  
+VOBJ11 = $(O)mhitm.o    $(O)mhitu.o    $(O)minion.o   $(O)mklev.o   
+VOBJ12 = $(O)mkmap.o    $(O)mkmaze.o   $(O)mkobj.o    $(O)mkroom.o  
+VOBJ13 = $(O)mon.o      $(O)mondata.o  $(O)monmove.o  $(O)monst.o   
+VOBJ14 = $(O)monstr.o   $(O)mplayer.o  $(O)mthrowu.o  $(O)muse.o    
+VOBJ15 = $(O)music.o    $(O)o_init.o   $(O)objects.o  $(O)objnam.o  
+VOBJ16 = $(O)options.o  $(O)pager.o    $(O)pickup.o   $(O)pline.o   
+VOBJ17 = $(O)polyself.o $(O)potion.o   $(O)pray.o     $(O)priest.o  
+VOBJ18 = $(O)quest.o    $(O)questpgr.o $(RANDOM)      $(O)read.o    
+VOBJ19 = $(O)rect.o     $(O)region.o   $(O)restore.o  $(O)rip.o     
+VOBJ20 = $(O)rnd.o      $(O)role.o     $(O)rumors.o   $(O)save.o    
+VOBJ21 = $(O)shk.o      $(O)shknam.o   $(O)sit.o      $(O)sounds.o  
+VOBJ22 = $(O)sp_lev.o   $(O)spell.o    $(O)steal.o    $(O)steed.o   
+VOBJ23 = $(O)teleport.o $(O)timeout.o  $(O)topten.o   $(O)track.o   
+VOBJ24 = $(O)trap.o     $(O)u_init.o   $(O)uhitm.o    $(O)vault.o   
+VOBJ25 = $(O)vis_tab.o  $(O)vision.o   $(O)weapon.o   $(O)were.o    
+VOBJ26 = $(O)wield.o    $(O)windows.o  $(O)wizard.o   $(O)worm.o    
+VOBJ27 = $(O)worn.o     $(O)write.o    $(O)zap.o     
+
+DLBOBJ = $(O)dlb.o
+
+TTYOBJ = $(O)topl.o     $(O)getline.o  $(O)wintty.o
+
+SOBJ   = $(O)winnt.o    $(O)pcsys.o      $(O)pcunix.o  \
+	   $(SOUND) 	$(O)mapimail.o $(O)nhlan.o
+
+OBJS   = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
+         $(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
+         $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
+         $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
+         $(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
+         $(VOBJ26) $(VOBJ27)
+
+WINPOBJ = $(WINPORT)
+
+VVOBJ  = $(O)version.o
+
+ALLOBJ  = $(WINPOBJ) $(SOBJ) $(DLBOBJ)  $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
+
+!IF "$(GRAPHICAL)" == "Y"
+OPTIONS_FILE = $(DAT)\guioptions
+!ELSE
+OPTIONS_FILE = $(DAT)\ttyoptions
+!ENDIF
+#==========================================
+# Header file macros
+#==========================================
+
+CONFIG_H = $(INCL)\config.h $(INCL)\config1.h $(INCL)\tradstdc.h \
+		$(INCL)\global.h $(INCL)\coord.h $(INCL)\vmsconf.h \
+		$(INCL)\system.h $(INCL)\unixconf.h $(INCL)\os2conf.h \
+		$(INCL)\micro.h $(INCL)\pcconf.h $(INCL)\tosconf.h \
+		$(INCL)\amiconf.h $(INCL)\macconf.h $(INCL)\beconf.h \
+		$(INCL)\ntconf.h $(INCL)\nhlan.h
+
+HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h \
+		$(INCL)\dungeon.h $(INCL)\monsym.h $(INCL)\mkroom.h \
+		$(INCL)\objclass.h $(INCL)\youprop.h $(INCL)\prop.h \
+		$(INCL)\permonst.h $(INCL)\monattk.h \
+		$(INCL)\monflag.h $(INCL)\mondata.h $(INCL)\pm.h \
+		$(INCL)\wintype.h $(INCL)\decl.h $(INCL)\quest.h \
+		$(INCL)\spell.h $(INCL)\color.h $(INCL)\obj.h \
+		$(INCL)\you.h $(INCL)\attrib.h $(INCL)\monst.h \
+		$(INCL)\skills.h $(INCL)\onames.h $(INCL)\timeout.h \
+		$(INCL)\trap.h $(INCL)\flag.h $(INCL)\rm.h \
+		$(INCL)\vision.h $(INCL)\display.h $(INCL)\engrave.h \
+		$(INCL)\rect.h $(INCL)\region.h $(INCL)\winprocs.h \
+		$(INCL)\wintty.h $(INCL)\trampoli.h
+
+LEV_H       = $(INCL)\lev.h
+DGN_FILE_H  = $(INCL)\dgn_file.h
+LEV_COMP_H  = $(INCL)\lev_comp.h
+SP_LEV_H    = $(INCL)\sp_lev.h
+TILE_H      = ..\win\share\tile.h
+
+#==========================================
+# Miscellaneous
+#==========================================
+
+DATABASE = $(DAT)\data.base
+
+#
+#  The name of the game.
+#
+
+GAMEFILE = $(GAMEDIR)\$(GAME).exe
+
+#==========================================
+#=============== TARGETS ==================
+#==========================================
+
+#
+#  The default make target (so just typing 'nmake' is useful).
+#
+default : $(GAMEFILE)
+
+#
+#  The main target.
+#
+
+$(GAME): $(O)obj.tag $(O)utility.tag envchk $(GAMEFILE)
+	@echo $(GAME) is up to date.
+
+#
+#  Everything
+#
+
+all :	install
+
+install: envchk $(GAME) $(O)install.tag
+	 @echo Done.
+
+$(O)install.tag: 	$(DAT)\data	$(DAT)\rumors	 $(DAT)\dungeon \
+	 	$(DAT)\oracles	$(DAT)\quest.dat $(O)sp_lev.tag $(DLB)
+! IF ("$(USE_DLB)"=="Y")
+	copy nhdat                $(GAMEDIR)
+	copy $(DAT)\license       $(GAMEDIR)
+! ELSE
+	copy $(DAT)\*.            $(GAMEDIR)
+	copy $(DAT)\*.dat         $(GAMEDIR)
+	copy $(DAT)\*.lev         $(GAMEDIR)
+	if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
+! ENDIF
+	if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
+	if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
+	if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt
+	@if exist $(SRC)\$(GAME).PDB copy $(SRC)\$(GAME).pdb $(GAMEDIR)\$(GAME).pdb
+	@if exist $(GAMEDIR)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space
+	-copy $(NTSYS)\defaults.nh   $(GAMEDIR)\defaults.nh
+	copy $(U)recover.exe  $(GAMEDIR)
+	echo install done > $@
+
+#	copy $(NTSYS)\winnt.hlp    $(GAMEDIR)
+
+$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des  $(DAT)\castle.des \
+	$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des   \
+	$(DAT)\medusa.des  $(DAT)\oracle.des   $(DAT)\tower.des  \
+	$(DAT)\yendor.des  $(DAT)\arch.des     $(DAT)\barb.des   \
+	$(DAT)\caveman.des $(DAT)\healer.des   $(DAT)\knight.des \
+	$(DAT)\monk.des    $(DAT)\priest.des   $(DAT)\ranger.des \
+	$(DAT)\rogue.des   $(DAT)\samurai.des  $(DAT)\sokoban.des \
+	$(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des
+	cd $(DAT)
+	$(U)lev_comp bigroom.des
+	$(U)lev_comp castle.des
+	$(U)lev_comp endgame.des
+	$(U)lev_comp gehennom.des
+	$(U)lev_comp knox.des
+	$(U)lev_comp mines.des
+	$(U)lev_comp medusa.des
+	$(U)lev_comp oracle.des
+	$(U)lev_comp sokoban.des
+	$(U)lev_comp tower.des
+	$(U)lev_comp yendor.des
+	$(U)lev_comp arch.des
+	$(U)lev_comp barb.des
+	$(U)lev_comp caveman.des
+	$(U)lev_comp healer.des
+	$(U)lev_comp knight.des
+	$(U)lev_comp monk.des
+	$(U)lev_comp priest.des
+	$(U)lev_comp ranger.des
+	$(U)lev_comp rogue.des
+	$(U)lev_comp samurai.des
+	$(U)lev_comp tourist.des
+	$(U)lev_comp valkyrie.des
+	$(U)lev_comp wizard.des
+	cd $(SRC)
+	echo sp_levs done > $(O)sp_lev.tag
+
+$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \
+		$(SRC)\monstr.c		$(SRC)\vis_tab.c  \
+		$(U)lev_comp.exe	$(INCL)\vis_tab.h \
+		$(U)dgn_comp.exe $(U)recover.exe
+             @echo utilities made >$@
+	     @echo utilities made.
+
+tileutil: $(U)gif2txt.exe $(U)gif2tx32.exe $(U)txt2ppm.exe
+	@echo Optional tile development utilities are up to date.
+
+!IF "$(GRAPHICAL)"=="Y"
+$(NHRES): $(TILEBMP16) $(WIN32)\winhack.rc $(WIN32)\mnsel.bmp \
+	$(WIN32)\mnselcnt.bmp $(WIN32)\mnunsel.bmp \
+	$(WIN32)\petmark.bmp $(WIN32)\NetHack.ico $(WIN32)\rip.bmp \
+	$(WIN32)\splash.bmp
+	@$(rc) -r -fo$@ -i$(WIN32) -dNDEBUG $(WIN32)\winhack.rc
+!ELSE
+$(NHRES): $(NTSYS)\console.rc $(NTSYS)\NetHack.ico
+	@$(rc) -r -fo$@ -i$(NTSYS) -dNDEBUG $(NTSYS)\console.rc
+!ENDIF
+
+#==========================================
+#  The main target.
+#==========================================
+
+#  The section for linking the NetHack image looks a little strange at 
+#  first, especially if you are used to UNIX makes, or NDMAKE.  It is 
+#  Microsoft nmake specific, and it gets around the problem of the 
+#  link command line being too long for the linker.  An "in-line" linker 
+#  response file is generated temporarily.
+#
+#  It takes advantage of the following features of nmake:
+#
+#  Inline files : 
+#			Specifying the "<<" means to start an inline file.
+#                 	Another "<<" at the start of a line closes the 
+#                 	inline file.
+#
+#  Substitution within Macros:
+#                       $(mymacro:string1=string2) replaces every
+#                       occurrence of string1 with string2 in the 
+#                       macro mymacro.  Special ascii key codes may be 
+#                       used in the substitution text by preceding it 
+#                       with ^ as we have done below.  Every occurence
+#                       of a <tab> in $(ALLOBJ) is replaced by 
+#                       <+><return><tab>.
+#
+#  DO NOT INDENT THE << below!
+#
+
+$(GAMEFILE) : $(ALLOBJ) $(NHRES)
+	@if not exist $(GAMEDIR)\*.* mkdir $(GAMEDIR)
+	@echo Linking....
+	$(link) $(LFLAGS) -out:$@ @<<$(GAME).lnk
+		$(ALLOBJ:^	=^
+		) $(NHRES)
+<<
+	@if exist $(O)install.tag del $(O)install.tag
+	@if exist $(GAMEDIR)\$(GAME).bak del $(GAMEDIR)\$(GAME).bak
+
+#
+#  Secondary Targets.
+#
+    
+#==========================================
+# Makedefs Stuff
+#==========================================
+
+$(U)makedefs.exe:	$(MAKEOBJS)
+	@$(link) $(LFLAGSU) -out:$@ $(MAKEOBJS)
+
+$(O)makedefs.o: $(CONFIG_H)	$(INCL)\monattk.h $(INCL)\monflag.h   $(INCL)\objclass.h \
+		 $(INCL)\monsym.h    $(INCL)\qtext.h	$(INCL)\patchlevel.h \
+		 $(U)makedefs.c
+	@if not exist $(OBJ)\*.* echo creating directory $(OBJ)
+	@if not exist $(OBJ)\*.* mkdir $(OBJ)
+	@$(CC) $(CFLAGSU) -Fo$@ $(U)makedefs.c
+
+#
+#  date.h should be remade every time any of the source or include
+#  files is modified.
+#
+
+$(INCL)\date.h $(OPTIONS_FILE) : $(U)makedefs.exe
+	$(U)makedefs -v
+
+$(INCL)\onames.h : $(U)makedefs.exe
+	$(U)makedefs -o
+
+$(INCL)\pm.h : $(U)makedefs.exe
+	$(U)makedefs -p
+
+#$(INCL)\trap.h : $(U)makedefs.exe
+#	$(U)makedefs -t
+
+$(SRC)\monstr.c: $(U)makedefs.exe
+	$(U)makedefs -m
+
+$(INCL)\vis_tab.h: $(U)makedefs.exe
+	$(U)makedefs -z
+
+$(SRC)\vis_tab.c: $(U)makedefs.exe
+	$(U)makedefs -z
+
+#==========================================
+# uudecode utility and uuencoded targets
+#==========================================
+
+$(U)uudecode.exe: $(O)uudecode.o
+	@$(link) $(LFLAGSU) -out:$@ $(O)\uudecode.o
+
+$(O)uudecode.o: $(SSYS)\uudecode.c
+
+$(NTSYS)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu 
+	chdir $(NTSYS)
+	..\..\util\uudecode.exe nhico.uu
+	chdir ..\..\src
+
+$(WIN32)\NetHack.ico : $(U)uudecode.exe $(NTSYS)\nhico.uu 
+	chdir $(WIN32)
+	..\..\util\uudecode.exe ../../sys/winnt/nhico.uu
+	chdir ..\..\src
+
+$(WIN32)\mnsel.bmp: $(U)uudecode.exe $(WIN32)\mnsel.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe mnsel.uu
+	chdir ..\..\src
+
+$(WIN32)\mnselcnt.bmp: $(U)uudecode.exe $(WIN32)\mnselcnt.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe mnselcnt.uu
+	chdir ..\..\src
+
+$(WIN32)\mnunsel.bmp: $(U)uudecode.exe $(WIN32)\mnunsel.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe mnunsel.uu
+	chdir ..\..\src
+
+$(WIN32)\petmark.bmp: $(U)uudecode.exe $(WIN32)\petmark.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe petmark.uu
+	chdir ..\..\src
+
+$(WIN32)\rip.bmp: $(U)uudecode.exe $(WIN32)\rip.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe rip.uu
+	chdir ..\..\src
+
+$(WIN32)\splash.bmp: $(U)uudecode.exe $(WIN32)\splash.uu
+	chdir $(WIN32)
+	..\..\util\uudecode.exe splash.uu
+	chdir ..\..\src
+
+#==========================================
+# Level Compiler Stuff
+#==========================================
+
+LEVCFLAGS=-c -nologo -DWINVER=0x0400 -DWIN32 -D_WIN32 \
+	   -D_MT -MT -I..\include -nologo -Z7 -Od -DDLB
+
+$(U)lev_comp.exe: $(SPLEVOBJS)
+	@echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+ 		$(SPLEVOBJS:^	=^
+		)
+<<
+
+$(O)lev_yacc.o: $(HACK_H)   $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
+	@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c
+
+$(O)lev_$(LEX).o: $(HACK_H)   $(INCL)\lev_comp.h $(SP_LEV_H) \
+               $(U)lev_$(LEX).c
+	@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_$(LEX).c
+
+$(O)lev_main.o:	$(U)lev_main.c $(HACK_H)   $(SP_LEV_H)
+	@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c
+
+
+$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
+!	IF "$(DO_YACC)"=="YACC_ACT"
+	   chdir $(UTIL)
+	   $(YACC) -d lev_comp.y
+	   copy $(YTABC) lev_yacc.c
+	   copy $(YTABH) $(INCL)\lev_comp.h
+	   @del $(YTABC)
+	   @del $(YTABH)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)lev_comp.y has changed.
+	   @echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt lev_yacc.c and 
+	   @echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
+	   @copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul
+	   @copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul
+	   @echo /**/ >>$(U)lev_yacc.c
+	   @echo /**/ >>$(INCL)\lev_comp.h
+!	ENDIF
+
+$(U)lev_$(LEX).c: $(U)lev_comp.l
+!	IF "$(DO_LEX)"=="LEX_ACT"
+	   chdir $(UTIL)
+	   $(LEX) $(FLEXSKEL) lev_comp.l
+	   copy $(LEXYYC) $@
+	   @del $(LEXYYC)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)lev_comp.l has changed. To update $@ run $(LEX).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt lev_lex.c 
+	   @echo from $(SSYS) into $(UTIL) and use it.
+	   @copy $(SSYS)\lev_lex.c $@ >nul
+	   @echo /**/ >>$@
+!	ENDIF
+
+#==========================================
+# Dungeon Compiler Stuff
+#==========================================
+
+$(U)dgn_comp.exe: $(DGNCOMPOBJS)
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(DGNCOMPOBJS:^	=^
+		)
+<<
+
+$(O)dgn_yacc.o:	$(HACK_H)   $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
+	@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c
+
+$(O)dgn_$(LEX).o: $(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
+	$(U)dgn_$(LEX).c
+	@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_$(LEX).c
+
+$(O)dgn_main.o:	$(HACK_H) $(U)dgn_main.c
+	@$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c
+
+$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
+!	IF "$(DO_YACC)"=="YACC_ACT"
+	   chdir $(UTIL)
+	   $(YACC) -d dgn_comp.y
+	   copy $(YTABC) dgn_yacc.c
+	   copy $(YTABH) $(INCL)\dgn_comp.h
+	   @del $(YTABC)
+	   @del $(YTABH)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and 
+	   @echo $(INCL)\dgn_comp.h run $(YACC).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt $(U)dgn_yacc.c and 
+	   @echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
+	   @copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul
+	   @copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
+	   @echo /**/ >>$(U)dgn_yacc.c
+	   @echo /**/ >>$(INCL)\dgn_comp.h
+!	ENDIF
+
+$(U)dgn_$(LEX).c: $(U)dgn_comp.l
+!	IF "$(DO_LEX)"=="LEX_ACT"
+	   chdir $(UTIL)
+	   $(LEX) $(FLEXSKEL)  dgn_comp.l
+	   copy $(LEXYYC) $@
+	   @del $(LEXYYC)
+	   chdir $(SRC)
+!	ELSE
+	   @echo $(U)dgn_comp.l has changed. To update $@ run $(LEX).
+	   @echo ---
+	   @echo For now, we will copy the prebuilt dgn_lex.c 
+	   @echo from $(SSYS) into $(UTIL) and use it.
+	   @copy $(SSYS)\dgn_lex.c $@ >nul
+	   @echo /**/ >>$@
+!	ENDIF
+
+#==========================================
+# Create directory for holding object files
+#==========================================
+
+$(O)obj.tag:
+	@if not exist $(OBJ)\*.* echo creating directory $(OBJ)
+	@if not exist $(OBJ)\*.* mkdir $(OBJ)
+	@echo directory created >$@
+
+#==========================================
+# Notify of any CL environment variables
+# in effect since they change the compiler
+# options.
+#==========================================
+
+envchk:
+!	IF "$(CL)"!=""
+	   @echo Warning, the CL Environment variable is defined:
+	   @echo CL=$(CL)
+!	ENDIF
+!   IF "$(GRAPHICAL)"=="Y"
+	   @echo ----
+	   @echo NOTE: This build will include tile support.
+	   @echo ----
+!	ENDIF
+
+#==========================================
+#=========== SECONDARY TARGETS ============
+#==========================================
+
+#===========================================
+# Header files NOT distributed in ..\include
+#===========================================
+
+$(INCL)\win32api.h: $(NTSYS)\win32api.h
+	copy $(NTSYS)\win32api.h $@
+
+
+#==========================================
+# DLB utility and nhdat file creation
+#==========================================
+
+$(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(O)dlb_main.o
+		$(O)dlb.o
+		$(O)alloc.o
+		$(O)panic.o
+<<
+
+$(O)dlb.o:	$(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h
+	@$(CC) $(CFLAGS) /Fo$@ $(SRC)\dlb.c
+	
+$(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h
+	@$(CC) $(CFLAGS) /Fo$@ $(UTIL)\dlb_main.c
+
+$(DAT)\porthelp: $(NTSYS)\porthelp
+	@copy $(NTSYS)\porthelp $@ >nul
+
+nhdat:	$(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
+	$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
+	$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \
+	$(DAT)\license $(O)sp_lev.tag
+	cd $(DAT)
+	echo data >dlb.lst
+	echo oracles >>dlb.lst
+	if exist options echo options >>dlb.lst
+	if exist ttyoptions echo ttyoptions >>dlb.lst
+	if exist guioptions echo guioptions >>dlb.lst
+	if exist porthelp echo porthelp >>dlb.lst
+	echo quest.dat >>dlb.lst
+	echo rumors >>dlb.lst
+	echo help >>dlb.lst
+	echo hh >>dlb.lst
+	echo cmdhelp >>dlb.lst
+	echo history >>dlb.lst
+	echo opthelp >>dlb.lst
+	echo wizhelp >>dlb.lst
+	echo dungeon >>dlb.lst
+	echo license >>dlb.lst
+	for %%N in (*.lev) do echo %%N >>dlb.lst
+	$(U)dlb_main cIf dlb.lst $(SRC)\nhdat
+	cd $(SRC)
+
+#==========================================
+#  Recover Utility
+#==========================================
+
+$(U)recover.exe: $(RECOVOBJS)
+	@$(link) $(LFLAGSU) -out:$@ $(RECOVOBJS)
+
+$(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h
+	@$(CC) $(CFLAGSU) -Fo$@ $(U)recover.c
+
+#==========================================
+#  Tile Mapping
+#==========================================
+
+$(SRC)\tile.c: $(U)tilemap.exe
+	@echo A new $@ has been created
+	@$(U)tilemap
+
+$(U)tilemap.exe: $(O)tilemap.o
+	@$(link) $(LFLAGSU) -out:$@ $(O)tilemap.o
+
+$(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H)
+	@$(CC) $(CFLAGSU) -Fo$@ $(WSHR)\tilemap.c
+
+$(O)tiletx32.o: $(WSHR)\tilemap.c $(HACK_H)
+	@$(CC) $(CFLAGS) /DTILETEXT /DTILE_X=32 /DTILE_Y=32 -Fo$@ $(WSHR)\tilemap.c
+
+$(O)tiletxt.o: $(WSHR)\tilemap.c $(HACK_H)
+	@$(CC) $(CFLAGS) /DTILETEXT -Fo$@ $(WSHR)\tilemap.c
+
+$(O)gifread.o: $(WSHR)\gifread.c  $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) -Fo$@ $(WSHR)\gifread.c
+
+$(O)gifrd32.o: $(WSHR)\gifread.c  $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) /DTILE_X=32 /DTILE_Y=32 -Fo$@ $(WSHR)\gifread.c
+
+$(O)ppmwrite.o: $(WSHR)\ppmwrite.c $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) -Fo$@ $(WSHR)\ppmwrite.c
+
+$(O)tiletext.o: $(WSHR)\tiletext.c  $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) -Fo$@ $(WSHR)\tiletext.c
+
+$(O)tilete32.o: $(WSHR)\tiletext.c  $(CONFIG_H) $(TILE_H)
+	@$(CC) $(CFLAGS) -I$(WSHR) /DTILE_X=32 /DTILE_Y=32 -Fo$@ $(WSHR)\tiletext.c
+
+#==========================================
+# Optional Tile Utilities
+#==========================================
+
+$(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO)
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(GIFREADERS:^	=^
+		)
+		$(TEXT_IO:^	=^
+		)
+<<
+
+$(U)gif2tx32.exe: $(GIFREADERS32) $(TEXT_IO32)
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(GIFREADERS32:^	=^
+		)
+		$(TEXT_IO32:^	=^
+		)
+<<
+
+$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO)
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(PPMWRITERS:^	=^
+		)
+		$(TEXT_IO:^	=^
+		)
+<<
+
+!IF "$(GRAPHICAL)"=="Y"
+$(TILEBMP16): $(TILEUTIL16) $(TILEFILES)
+	@echo Creating 16x16 binary tile files (this may take some time)
+	@$(U)tile2bmp $(TILEBMP16)
+#$(TILEBMP32): $(TILEUTIL32) $(TILEFILES32)
+#	@echo Creating 32x32 binary tile files (this may take some time)
+#	@$(U)til2bm32 $(TILEBMP32)
+
+!ELSE
+$(TILEBMP16):
+$(TILEBMP32):
+!ENDIF
+
+$(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO)
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(O)tile2bmp.o
+		$(TEXT_IO:^  =^
+		)
+<<
+
+$(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32)
+    @echo Linking $@...
+	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
+		$(O)til2bm32.o
+		$(TEXT_IO32:^  =^
+		)
+<<
+
+$(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
+	@$(CC) $(CFLAGS) -I$(WSHR) /DPACKED_FILE /Fo$@ $(WSHR)\tile2bmp.c
+
+$(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
+	@$(CC) $(CFLAGS) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c
+
+#==========================================
+# Housekeeping
+#==========================================
+
+spotless: clean
+! IF ("$(OBJ)"!="")
+	-rmdir $(OBJ) /s /Q
+! ENDIF
+	if exist $(INCL)\date.h    del $(INCL)\date.h
+	if exist $(INCL)\onames.h  del $(INCL)\onames.h
+	if exist $(INCL)\pm.h      del $(INCL)\pm.h
+	if exist $(INCL)\vis_tab.h del $(INCL)\vis_tab.h
+	if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
+	if exist $(SRC)\tile.c     del $(SRC)\tile.c
+	if exist $(U)*.lnk         del $(U)*.lnk
+	if exist $(U)*.map         del $(U)*.map
+	if exist $(DAT)\data       del $(DAT)\data
+	if exist $(DAT)\rumors     del $(DAT)\rumors
+	if exist $(DAT)\???-fil?.lev	del $(DAT)\???-fil?.lev
+	if exist $(DAT)\???-goal.lev	del $(DAT)\???-goal.lev
+	if exist $(DAT)\???-loca.lev	del $(DAT)\???-loca.lev
+	if exist $(DAT)\???-strt.lev	del $(DAT)\???-strt.lev
+	if exist $(DAT)\air.lev		del $(DAT)\air.lev
+	if exist $(DAT)\asmodeus.lev	del $(DAT)\asmodeus.lev
+	if exist $(DAT)\astral.lev	del $(DAT)\astral.lev
+	if exist $(DAT)\baalz.lev	del $(DAT)\baalz.lev
+	if exist $(DAT)\bigroom.lev	del $(DAT)\bigroom.lev
+	if exist $(DAT)\castle.lev	del $(DAT)\castle.lev
+	if exist $(DAT)\data		del $(DAT)\data
+	if exist $(DAT)\dungeon		del $(DAT)\dungeon
+	if exist $(DAT)\dungeon.pdf	del $(DAT)\dungeon.pdf
+	if exist $(DAT)\earth.lev	del $(DAT)\earth.lev
+	if exist $(DAT)\fakewiz?.lev	del $(DAT)\fakewiz?.lev
+	if exist $(DAT)\fire.lev	del $(DAT)\fire.lev
+	if exist $(DAT)\juiblex.lev	del $(DAT)\juiblex.lev
+	if exist $(DAT)\knox.lev	del $(DAT)\knox.lev
+	if exist $(DAT)\medusa-?.lev	del $(DAT)\medusa-?.lev
+	if exist $(DAT)\mine*.lev	del $(DAT)\mine*.lev
+	if exist $(DAT)\options		del $(DAT)\options
+	if exist $(DAT)\ttyoptions	del $(DAT)\ttyoptions
+	if exist $(DAT)\guioptions	del $(DAT)\guioptions
+	if exist $(DAT)\oracle.lev	del $(DAT)\oracle.lev
+	if exist $(DAT)\oracles		del $(DAT)\oracles
+	if exist $(DAT)\orcus.lev	del $(DAT)\orcus.lev
+	if exist $(DAT)\rumors		del $(DAT)\rumors
+	if exist $(DAT)\quest.dat	del $(DAT)\quest.dat
+	if exist $(DAT)\sanctum.lev	del $(DAT)\sanctum.lev
+	if exist $(DAT)\soko?-?.lev	del $(DAT)\soko?-?.lev
+	if exist $(DAT)\tower?.lev	del $(DAT)\tower?.lev
+	if exist $(DAT)\valley.lev	del $(DAT)\valley.lev
+	if exist $(DAT)\water.lev	del $(DAT)\water.lev
+	if exist $(DAT)\wizard?.lev	del $(DAT)\wizard?.lev
+	if exist $(O)sp_lev.tag	        del $(O)sp_lev.tag
+	if exist $(SRC)\monstr.c        del $(SRC)\monstr.c
+	if exist $(SRC)\vis_tab.c       del $(SRC)\vis_tab.c
+	if exist $(U)recover.exe        del $(U)recover.exe
+	if exist nhdat.			del nhdat.
+
+clean:
+	if exist $(O)*.o del $(O)*.o
+	if exist $(O)utility.tag   del $(O)utility.tag
+	if exist $(U)makedefs.exe  del $(U)makedefs.exe
+	if exist $(U)lev_comp.exe  del $(U)lev_comp.exe
+	if exist $(U)dgn_comp.exe  del $(U)dgn_comp.exe
+	if exist $(SRC)\*.lnk      del $(SRC)\*.lnk
+	if exist $(SRC)\*.map      del $(SRC)\*.map
+! IF ("$(WINPFLAG)"!="")
+	if exist $(TILEBMP16)        del $(TILEBMP16)
+	if exist $(TILEBMP32)        del $(TILEBMP32)
+! ENDIF
+
+#===================================================================
+# OTHER DEPENDENCIES
+#===================================================================
+
+#
+# dat dependencies
+#
+
+$(DAT)\data: $(O)utility.tag    $(DATABASE)
+	$(U)makedefs -d
+
+$(DAT)\rumors: $(O)utility.tag    $(DAT)\rumors.tru   $(DAT)\rumors.fal
+	$(U)makedefs -r
+
+$(DAT)\quest.dat: $(O)utility.tag  $(DAT)\quest.txt
+	$(U)makedefs -q
+
+$(DAT)\oracles: $(O)utility.tag    $(DAT)\oracles.txt
+	$(U)makedefs -h
+
+$(DAT)\dungeon: $(O)utility.tag  $(DAT)\dungeon.def
+	$(U)makedefs -e
+	cd $(DAT)
+	$(U)dgn_comp dungeon.pdf
+	cd $(SRC)
+
+#
+# NT dependencies
+#
+
+$(O)nttty.o:   $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nttty.c
+	@$(CC) $(CFLAGS) -I$(WSHR) -Fo$@  $(NTSYS)\nttty.c
+$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(NTSYS)\winnt.c
+	@$(CC) $(CFLAGS) -Fo$@  $(NTSYS)\winnt.c
+$(O)ntsound.o: $(HACK_H) $(NTSYS)\ntsound.c
+	@$(CC) $(CFLAGS)  -Fo$@ $(NTSYS)\ntsound.c
+$(O)mapimail.o: $(HACK_H) $(INCL)\nhlan.h $(NTSYS)\mapimail.c
+	@$(CC) $(CFLAGS) -DMAPI_VERBOSE  -Fo$@ $(NTSYS)\mapimail.c
+
+# 
+# util dependencies
+#
+
+$(O)panic.o:  $(U)panic.c $(CONFIG_H)
+	@$(CC) $(CFLAGS) -Fo$@ $(U)panic.c
+
+#
+# The rest are stolen from sys/unix/Makefile.src, 
+# with slashes changed to back-slashes 
+# and -c (which is included in CFLAGS) substituted
+# with -Fo$@ , but otherwise untouched. That
+# means that there is some irrelevant stuff
+# in here, but maintenance should be easier.
+#
+$(O)tos.o: ..\sys\atari\tos.c $(HACK_H) $(INCL)\tcap.h
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\atari\tos.c
+$(O)pcmain.o: ..\sys\share\pcmain.c $(HACK_H) $(INCL)\dlb.h \
+		$(INCL)\win32api.h
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\pcmain.c
+$(O)pcsys.o: ..\sys\share\pcsys.c $(HACK_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\pcsys.c
+$(O)pctty.o: ..\sys\share\pctty.c $(HACK_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\pctty.c
+$(O)pcunix.o: ..\sys\share\pcunix.c $(HACK_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\pcunix.c
+$(O)random.o: ..\sys\share\random.c $(HACK_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\random.c
+$(O)ioctl.o: ..\sys\share\ioctl.c $(HACK_H) $(INCL)\tcap.h
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\ioctl.c
+$(O)unixtty.o: ..\sys\share\unixtty.c $(HACK_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\share\unixtty.c
+$(O)unixmain.o: ..\sys\unix\unixmain.c $(HACK_H) $(INCL)\dlb.h
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\unix\unixmain.c
+$(O)unixunix.o: ..\sys\unix\unixunix.c $(HACK_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\unix\unixunix.c
+$(O)bemain.o: ..\sys\be\bemain.c $(HACK_H) $(INCL)\dlb.h
+	$(CC) $(CFLAGS) -Fo$@ ..\sys\be\bemain.c
+$(O)getline.o: ..\win\tty\getline.c $(HACK_H) $(INCL)\func_tab.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\tty\getline.c
+$(O)termcap.o: ..\win\tty\termcap.c $(HACK_H) $(INCL)\tcap.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\tty\termcap.c
+$(O)topl.o: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\tty\topl.c
+$(O)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
+		$(INCL)\patchlevel.h $(INCL)\tcap.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\tty\wintty.c
+$(O)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h \
+		$(CONFIG_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\Window.c
+$(O)dialogs.o: ..\win\X11\dialogs.c $(CONFIG_H)
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\dialogs.c
+$(O)winX.o: ..\win\X11\winX.c $(HACK_H) $(INCL)\winX.h $(INCL)\dlb.h \
+		$(INCL)\patchlevel.h ..\win\X11\nh72icon \
+		..\win\X11\nh56icon ..\win\X11\nh32icon
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winX.c
+$(O)winmap.o: ..\win\X11\winmap.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\dlb.h \
+		$(INCL)\winX.h $(INCL)\tile2x11.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winmap.c
+$(O)winmenu.o: ..\win\X11\winmenu.c $(HACK_H) $(INCL)\winX.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winmenu.c
+$(O)winmesg.o: ..\win\X11\winmesg.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\winX.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winmesg.c
+$(O)winmisc.o: ..\win\X11\winmisc.c $(HACK_H) $(INCL)\func_tab.h \
+		$(INCL)\winX.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winmisc.c
+$(O)winstat.o: ..\win\X11\winstat.c $(HACK_H) $(INCL)\winX.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winstat.c
+$(O)wintext.o: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\wintext.c
+$(O)winval.o: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\X11\winval.c
+$(O)tile.o: $(SRC)\tile.c $(HACK_H)
+$(O)gnaskstr.o: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h \
+		..\win\gnome\gnmain.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnaskstr.c
+$(O)gnbind.o: ..\win\gnome\gnbind.c ..\win\gnome\gnbind.h ..\win\gnome\gnmain.h \
+		..\win\gnome\gnaskstr.h ..\win\gnome\gnyesno.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnbind.c
+$(O)gnglyph.o: ..\win\gnome\gnglyph.c ..\win\gnome\gnglyph.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnglyph.c
+$(O)gnmain.o: ..\win\gnome\gnmain.c ..\win\gnome\gnmain.h ..\win\gnome\gnsignal.h \
+		..\win\gnome\gnbind.h ..\win\gnome\gnopts.h $(HACK_H) \
+		$(INCL)\date.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmain.c
+$(O)gnmap.o: ..\win\gnome\gnmap.c ..\win\gnome\gnmap.h ..\win\gnome\gnglyph.h \
+		..\win\gnome\gnsignal.h $(HACK_H)
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmap.c
+$(O)gnmenu.o: ..\win\gnome\gnmenu.c ..\win\gnome\gnmenu.h ..\win\gnome\gnmain.h \
+		..\win\gnome\gnbind.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmenu.c
+$(O)gnmesg.o: ..\win\gnome\gnmesg.c ..\win\gnome\gnmesg.h ..\win\gnome\gnsignal.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnmesg.c
+$(O)gnopts.o: ..\win\gnome\gnopts.c ..\win\gnome\gnopts.h ..\win\gnome\gnglyph.h \
+		..\win\gnome\gnmain.h ..\win\gnome\gnmap.h $(HACK_H)
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnopts.c
+$(O)gnplayer.o: ..\win\gnome\gnplayer.c ..\win\gnome\gnplayer.h \
+		..\win\gnome\gnmain.h $(HACK_H)
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnplayer.c
+$(O)gnsignal.o: ..\win\gnome\gnsignal.c ..\win\gnome\gnsignal.h \
+		..\win\gnome\gnmain.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnsignal.c
+$(O)gnstatus.o: ..\win\gnome\gnstatus.c ..\win\gnome\gnstatus.h \
+		..\win\gnome\gnsignal.h ..\win\gnome\gn_xpms.h \
+		..\win\gnome\gnomeprv.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnstatus.c
+$(O)gntext.o: ..\win\gnome\gntext.c ..\win\gnome\gntext.h ..\win\gnome\gnmain.h \
+		..\win\gnome\gn_rip.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gntext.c
+$(O)gnyesno.o: ..\win\gnome\gnyesno.c ..\win\gnome\gnbind.h ..\win\gnome\gnyesno.h
+	$(CC) $(CFLAGS) $(GNOMEINC) -c ..\win\gnome\gnyesno.c
+$(O)wingem.o: ..\win\gem\wingem.c $(HACK_H) $(INCL)\func_tab.h $(INCL)\dlb.h \
+		$(INCL)\patchlevel.h $(INCL)\wingem.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\gem\wingem.c
+$(O)wingem1.o: ..\win\gem\wingem1.c $(INCL)\gem_rsc.h $(INCL)\load_img.h \
+		$(INCL)\wintype.h $(INCL)\wingem.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\gem\wingem1.c
+$(O)load_img.o: ..\win\gem\load_img.c $(INCL)\load_img.h
+	$(CC) $(CFLAGS) -Fo$@ ..\win\gem\load_img.c
+$(O)tile.o: tile.c $(HACK_H)
+$(O)qt_win.o: ..\win\Qt\qt_win.cpp $(HACK_H) $(INCL)\func_tab.h \
+		$(INCL)\dlb.h $(INCL)\patchlevel.h $(INCL)\qt_win.h \
+		$(INCL)\qt_clust.h $(INCL)\qt_kde0.h \
+		$(INCL)\qt_xpms.h qt_win.moc qt_kde0.moc
+	$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_win.cpp
+$(O)qt_clust.o: ..\win\Qt\qt_clust.cpp $(INCL)\qt_clust.h
+	$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_clust.cpp
+$(O)monstr.o: $(SRC)\monstr.c $(CONFIG_H)
+$(O)vis_tab.o: $(SRC)\vis_tab.c $(CONFIG_H) $(INCL)\vis_tab.h
+$(O)allmain.o: allmain.c $(HACK_H)
+$(O)alloc.o: alloc.c $(CONFIG_H)
+$(O)apply.o: apply.c $(HACK_H) $(INCL)\edog.h
+$(O)artifact.o: artifact.c $(HACK_H) $(INCL)\artifact.h $(INCL)\artilist.h
+$(O)attrib.o: attrib.c $(HACK_H) $(INCL)\artifact.h
+$(O)ball.o: ball.c $(HACK_H)
+$(O)bones.o: bones.c $(HACK_H) $(INCL)\lev.h
+$(O)botl.o: botl.c $(HACK_H)
+$(O)cmd.o: cmd.c $(HACK_H) $(INCL)\func_tab.h
+$(O)dbridge.o: dbridge.c $(HACK_H)
+$(O)decl.o: decl.c $(HACK_H)
+$(O)detect.o: detect.c $(HACK_H) $(INCL)\artifact.h
+$(O)dig.o: dig.c $(HACK_H) $(INCL)\edog.h
+$(O)display.o: display.c $(HACK_H)
+$(O)dlb.o: dlb.c $(CONFIG_H) $(INCL)\dlb.h
+$(O)do.o: do.c $(HACK_H) $(INCL)\lev.h
+$(O)do_name.o: do_name.c $(HACK_H)
+$(O)do_wear.o: do_wear.c $(HACK_H)
+$(O)dog.o: dog.c $(HACK_H) $(INCL)\edog.h
+$(O)dogmove.o: dogmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
+$(O)dokick.o: dokick.c $(HACK_H) $(INCL)\eshk.h
+$(O)dothrow.o: dothrow.c $(HACK_H)
+$(O)drawing.o: drawing.c $(HACK_H) $(INCL)\tcap.h
+$(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
+$(O)eat.o: eat.c $(HACK_H)
+$(O)end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
+$(O)engrave.o: engrave.c $(HACK_H) $(INCL)\lev.h
+$(O)exper.o: exper.c $(HACK_H)
+$(O)explode.o: explode.c $(HACK_H)
+$(O)extralev.o: extralev.c $(HACK_H)
+$(O)files.o: files.c $(HACK_H) $(INCL)\dlb.h
+$(O)fountain.o: fountain.c $(HACK_H)
+$(O)hack.o: hack.c $(HACK_H)
+$(O)hacklib.o: hacklib.c $(HACK_H)
+$(O)invent.o: invent.c $(HACK_H) $(INCL)\artifact.h
+$(O)light.o: light.c $(HACK_H) $(INCL)\lev.h
+$(O)lock.o: lock.c $(HACK_H)
+$(O)mail.o: mail.c $(HACK_H) $(INCL)\mail.h
+$(O)makemon.o: makemon.c $(HACK_H) $(INCL)\epri.h $(INCL)\emin.h \
+		$(INCL)\edog.h
+$(O)mapglyph.o: mapglyph.c $(HACK_H)
+$(O)mcastu.o: mcastu.c $(HACK_H)
+$(O)mhitm.o: mhitm.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
+$(O)mhitu.o: mhitu.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
+$(O)minion.o: minion.c $(HACK_H) $(INCL)\emin.h $(INCL)\epri.h
+$(O)mklev.o: mklev.c $(HACK_H)
+$(O)mkmap.o: mkmap.c $(HACK_H) $(INCL)\sp_lev.h
+$(O)mkmaze.o: mkmaze.c $(HACK_H) $(INCL)\sp_lev.h $(INCL)\lev.h
+$(O)mkobj.o: mkobj.c $(HACK_H) $(INCL)\artifact.h
+$(O)mkroom.o: mkroom.c $(HACK_H)
+$(O)mon.o: mon.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
+$(O)mondata.o: mondata.c $(HACK_H) $(INCL)\eshk.h $(INCL)\epri.h
+$(O)monmove.o: monmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
+$(O)monst.o: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \
+		$(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \
+		$(INCL)\dungeon.h $(INCL)\eshk.h $(INCL)\vault.h \
+		$(INCL)\epri.h $(INCL)\color.h
+$(O)mplayer.o: mplayer.c $(HACK_H)
+$(O)mthrowu.o: mthrowu.c $(HACK_H)
+$(O)muse.o: muse.c $(HACK_H) $(INCL)\edog.h
+$(O)music.o: music.c $(HACK_H) #interp.c
+$(O)o_init.o: o_init.c $(HACK_H) $(INCL)\lev.h
+$(O)objects.o: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
+		$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
+$(O)objnam.o: objnam.c $(HACK_H)
+$(O)options.o: options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h \
+		$(HACK_H) $(INCL)\tcap.h
+$(O)pager.o: pager.c $(HACK_H) $(INCL)\dlb.h
+$(O)pickup.o: pickup.c $(HACK_H)
+$(O)pline.o: pline.c $(HACK_H) $(INCL)\epri.h $(INCL)\edog.h
+$(O)polyself.o: polyself.c $(HACK_H)
+$(O)potion.o: potion.c $(HACK_H)
+$(O)pray.o: pray.c $(HACK_H) $(INCL)\epri.h
+$(O)priest.o: priest.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\eshk.h \
+		$(INCL)\epri.h $(INCL)\emin.h
+$(O)quest.o: quest.c $(HACK_H) $(INCL)\qtext.h
+$(O)questpgr.o: questpgr.c $(HACK_H) $(INCL)\dlb.h $(INCL)\qtext.h
+$(O)read.o: read.c $(HACK_H)
+$(O)rect.o: rect.c $(HACK_H)
+$(O)region.o: region.c $(HACK_H) $(INCL)\lev.h
+$(O)restore.o: restore.c $(HACK_H) $(INCL)\lev.h $(INCL)\tcap.h
+$(O)rip.o: rip.c $(HACK_H)
+$(O)rnd.o: rnd.c $(HACK_H)
+$(O)role.o: role.c $(HACK_H)
+$(O)rumors.o: rumors.c $(HACK_H) $(INCL)\lev.h $(INCL)\dlb.h
+$(O)save.o: save.c $(HACK_H) $(INCL)\lev.h
+$(O)shk.o: shk.c $(HACK_H) $(INCL)\eshk.h
+$(O)shknam.o: shknam.c $(HACK_H) $(INCL)\eshk.h
+$(O)sit.o: sit.c $(HACK_H) $(INCL)\artifact.h
+$(O)sounds.o: sounds.c $(HACK_H) $(INCL)\edog.h
+$(O)sp_lev.o: sp_lev.c $(HACK_H) $(INCL)\dlb.h $(INCL)\sp_lev.h
+$(O)spell.o: spell.c $(HACK_H)
+$(O)steal.o: steal.c $(HACK_H)
+$(O)steed.o: steed.c $(HACK_H)
+$(O)teleport.o: teleport.c $(HACK_H)
+$(O)timeout.o: timeout.c $(HACK_H) $(INCL)\lev.h
+$(O)topten.o: topten.c $(HACK_H) $(INCL)\dlb.h $(INCL)\patchlevel.h
+$(O)track.o: track.c $(HACK_H)
+$(O)trap.o: trap.c $(HACK_H)
+$(O)u_init.o: u_init.c $(HACK_H)
+$(O)uhitm.o: uhitm.c $(HACK_H)
+$(O)vault.o: vault.c $(HACK_H) $(INCL)\vault.h
+$(O)version.o: version.c $(HACK_H) $(INCL)\date.h $(INCL)\patchlevel.h
+$(O)vision.o: vision.c $(HACK_H) $(INCL)\vis_tab.h
+$(O)weapon.o: weapon.c $(HACK_H)
+$(O)were.o: were.c $(HACK_H)
+$(O)wield.o: wield.c $(HACK_H)
+$(O)windows.o: windows.c $(HACK_H) $(INCL)\wingem.h $(INCL)\winGnome.h
+$(O)wizard.o: wizard.c $(HACK_H) $(INCL)\qtext.h
+$(O)worm.o: worm.c $(HACK_H) $(INCL)\lev.h
+$(O)worn.o: worn.c $(HACK_H)
+$(O)write.o: write.c $(HACK_H)
+$(O)zap.o: zap.c $(HACK_H)
+
+# end of file
+
diff -Naurd ../nethack-3.3.1/sys/winnt/Makefile.nt ./sys/winnt/Makefile.nt
--- ../nethack-3.3.1/sys/winnt/Makefile.nt Thu Aug 3 21:37:43 2000
+++ ./sys/winnt/Makefile.nt Thu Jan 1 01:00:00 1970
@@ -1,1148 +0,0 @@
-#       SCCS Id: @(#)Makefile.nt       3.3     2000/08/01
-#       Copyright (c) NetHack PC Development Team 1993-2000
-#
-#       NetHack 3.2 Makefile for MS Visual C++ V4.x and above and MS NMAKE
-#  
-#       Win32 Compilers Tested:
-#                              - Microsoft 32 bit Visual C++ V4.x
-#                              - Microsoft 32 bit Visual C++ V6.0 SP3, SP4
-#
-#	This is used for building a TTY version of NetHack using WIN32 Console
-#	I/O routines only.
-#
-#       In addition to your C compiler,
-#
-#       if you want to change           you will need a
-#       files with suffix               workalike for
-#              .y                           yacc   (such as bison)
-#              .l                           lex    (such as flex)
-#
-#
-#       If you have any questions read the Install.nt file included with
-#       the distribution.
-#
-#       Michael Allison
-#
-#----------------------------------------------------------------------
-# Do not delete the following 3 lines.
-#
-TARGETOS=BOTH
-APPVER=4.0
-!include <win32.mak>
-
-#
-#  Set the gamedir according to your preference.  It must be present prior
-#  to compilation.
-
-GAME    = NetHack                # Game Name
-GAMEDIR = \games\nethackntty      # Game directory
-
-#
-#  Source directories.    Makedefs hardcodes these, don't change them.
-#
-
-INCL  = ..\include   # NetHack include files
-DAT   = ..\dat       # NetHack data files
-DOC   = ..\doc       # NetHack documentation files
-UTIL  = ..\util      # Utility source
-SRC   = ..\src       # Main source
-SSYS  = ..\sys\share # Shared system files
-NTSYS = ..\sys\winnt # NT Win32 specific files
-TTY   = ..\win\tty   # window port files (tty)
-WIN32 = ..\win\win32 # window port files (Win32)
-WSHR  = ..\win\share # Tile support files 
-
-#
-#  Object directory.
-#
-
-OBJ     = o
-
-
-#
-# Exe File Info.
-# ($(MAKE) macro is often predefined, so we use $(MAKEBIN) instead.)
-#
-
-MAKEBIN = nmake
-
-# 
-# Yacc/Lex ... if you got 'em.
-#
-# If you have yacc and lex programs (or work-alike such as bison 
-# and flex), comment out the upper two macros and uncomment 
-# the lower two.
-#
-
-DO_YACC = YACC_MSG
-DO_LEX  = LEX_MSG
-#DO_YACC  = YACC_ACT
-#DO_LEX   = LEX_ACT
-
-#
-# - Specify your yacc and lex programs (or work-alikes) here.
-#
-
-#YACC	= bison -y
-YACC   = byacc
-#YACC	= yacc
-
-#LEX	= lex
-LEX	= flex
-
-#
-# - Specify your flex skeleton file (if needed).
-#
-
-FLEXSKEL =
-#FLEXSKEL = -S../tools/flex.ske
-
-YTABC   = y_tab.c
-YTABH   = y_tab.h
-LEXYYC  = lexyy.c
-
-#
-# Optional high-quality BSD random number generation routines
-# (see pcconf.h). Set to nothing if not used.
-#
-
-RANDOM	= $(OBJ)\random.o
-#RANDOM	=
-
-#
-# - For debugging ability, comment out the upper two 
-#   macros and uncomment the lower two.
-#
-
-#
-#  Leave the next two lines uncommented _ONLY_ if you do NOT want any
-#  debug capability in the object files, or in the NetHack executable.
-#  Comment them if you want debug capability.
-
-#cdebug =
-#linkdebug =
-
-#
-# Compiler and Linker flags
-#
-
-PRECOMPHEAD = N			# set to Y if you want to use precomp. headers
-
-
-########################################################################
-########################################################################
-#
-# Nothing below this line should have to be changed.
-#
-
-#Do not uncomment these for 3.3.0
-#TILEGAME  = $(OBJ)\tile.o
-#TILEDEF   = -DTILES
-#TILEHDR   =
-#SOUND = $(OBJ)\ntsound.o
-
-#SOUND =
-#TILEUTIL  =
-#TILEBMP   =
-#TILEGAME  =
-#TILEDEF   =   
-#TILEHDR   =
-
-#
-# Uncomment the line below if you want to store all the level files,
-# help files, etc. in a single library file.
-
-USE_DLB = Y
-
-! IF ("$(USE_DLB)"=="Y")
-DLBFLG = -DDLB
-! ELSE
-DLBFLG =
-! ENDIF
-
-# You can actually build a set of tiles with this makefile
-# even though they are not used. 
-# Use 'nmake o\nhtiles.bmp'
-#
-TILEUTIL  = $(UTIL)\tile2bmp.exe
-TILEBMP   = $(OBJ)\nhtiles.bmp
-
-#
-# - Util builds
-#
-
-CFLAGSU	= -c $(cflags) $(cvarsmt) -I$(INCL) -nologo $(cdebug) \
-		$(TILEDEF) $(DLBFLG)
-LFLAGSU	= $(linkdebug) $(conflags) $(conlibsmt)
-
-#
-# - Game build
-#
-#
-
-CFLAGSG	= $(CFLAGSU)
-NHLFLAGS = /NODEFAULTLIB /INCREMENTAL:NO /PDB:"$(GAME).PDB" /RELEASE /NOLOGO
-#LFLAGSG = $(guiflags) $(linkdebug) -IGNORE:505 $(guilibsmt) comctl32.lib
-LFLAGSG	= $(NHLFLAGS) /MACHINE:$(CPU) /MAP:"$(GAME).MAP" $(linkdebug) -IGNORE:505 $(conlibsmt) 
-
-GAMEFILE = $(GAMEDIR)\$(GAME).exe # whole thing
-
-#  This line should not be deleted.
-NTSUB = -DWIN32CON
-
-! IF ("$(USE_DLB)"=="Y")
-DLB = nhdat
-! ELSE
-DLB =
-! ENDIF
-
-#
-#  Make Rules.
-#
-
-.SUFFIXES: .exe .o .til .uu .c .y .l
-
-#
-# Rules for files in src
-#
-
-
-.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSG)  $(NTSUB) -Fo$@ $<
-
-{$(SRC)}.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSG)  $(NTSUB)  -Fo$@  $<
-
-#
-# Rules for files in sys\share
-#
-
-{$(SSYS)}.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSG)  -Fo$@  $<
-
-#
-# Rules for files in sys\winnt
-#
-
-{$(NTSYS)}.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSG)  -Fo$@  $<
-
-{$(NTSYS)}.h{$(INCL)}.h:
-	@copy $< $@
-
-#
-# Rules for files in util
-#
-
-{$(UTIL)}.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSU) $(NTSUB) -Fo$@ $<
-
-#
-# Rules for files in win\share
-#
-
-{$(WSHR)}.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSG)  -Fo$@ $<
-
-{$(WSHR)}.h{$(INCL)}.h:
-	@copy $< $@
-
-#{$(WSHR)}.txt{$(DAT)}.txt:
-#	@copy $< $@
-
-
-#
-# Rules for files in win\tty
-#
-
-{$(TTY)}.c{$(OBJ)}.o:
-	@$(cc) $(CFLAGSG)  -Fo$@  $<
-
-#
-# NETHACK OBJECTS
-# 
-# This section creates shorthand macros for many objects
-# referenced later on in the Makefile.
-#
-
-
-DEFFILE = $(NTSYS)\$(GAME).def
-
-#
-# Shorten up the location for some files
-#
-
-O  = $(OBJ)^\
-
-U  = $(UTIL)^\
-
-#
-# Utility Objects.
-#
-
-MAKESRC        = $(U)makedefs.c
-
-SPLEVSRC       = $(U)lev_yacc.c	$(U)lev_$(LEX).c $(U)lev_main.c  $(U)panic.c
-
-DGNCOMPSRC     = $(U)dgn_yacc.c	$(U)dgn_$(LEX).c $(U)dgn_main.c
-
-MAKEOBJS       = $(O)makedefs.o $(O)monst.o $(O)objects.o
-
-SPLEVOBJS      = $(O)lev_yacc.o	$(O)lev_$(LEX).o $(O)lev_main.o \
-		 $(O)alloc.o	$(O)decl.o	$(O)drawing.o \
-		 $(O)monst.o	$(O)objects.o	$(O)panic.o
-
-DGNCOMPOBJS    = $(O)dgn_yacc.o	$(O)dgn_$(LEX).o $(O)dgn_main.o \
-		 $(O)alloc.o	$(O)panic.o
-
-RECOVOBJS      = $(O)recover.o
-
-#
-# These are not invoked during a normal game build in 3.3.0
-#
-TEXT_IO        = $(O)tiletext.o	$(O)tiletxt.o	$(O)drawing.o \
-		 $(O)decl.o	$(O)monst.o	$(O)objects.o
-
-GIFREADERS     = $(O)gifread.o	$(O)alloc.o $(O)panic.o
-
-PPMWRITERS     = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
-
-TILEFILES      = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
-
-#
-#  Object files for the game itself.
-#
-
-VOBJ01 = $(O)allmain.o  $(O)alloc.o    $(O)apply.o    $(O)artifact.o
-VOBJ02 = $(O)attrib.o   $(O)ball.o     $(O)bones.o    $(O)botl.o    
-VOBJ03 = $(O)cmd.o      $(O)dbridge.o  $(O)decl.o     $(O)detect.o  
-VOBJ04 = $(O)dig.o      $(O)display.o  $(O)do.o       $(O)do_name.o 
-VOBJ05 = $(O)do_wear.o  $(O)dog.o      $(O)dogmove.o  $(O)dokick.o  
-VOBJ06 = $(O)dothrow.o  $(O)drawing.o  $(O)dungeon.o  $(O)eat.o     
-VOBJ07 = $(O)end.o      $(O)engrave.o  $(O)exper.o    $(O)explode.o 
-VOBJ08 = $(O)extralev.o $(O)files.o    $(O)fountain.o $(O)hack.o    
-VOBJ09 = $(O)hacklib.o  $(O)invent.o   $(O)light.o    $(O)lock.o    
-VOBJ10 = $(O)mail.o     $(O)main.o     $(O)makemon.o  $(O)mcastu.o  
-VOBJ11 = $(O)mhitm.o    $(O)mhitu.o    $(O)minion.o   $(O)mklev.o   
-VOBJ12 = $(O)mkmap.o    $(O)mkmaze.o   $(O)mkobj.o    $(O)mkroom.o  
-VOBJ13 = $(O)mon.o      $(O)mondata.o  $(O)monmove.o  $(O)monst.o   
-VOBJ14 = $(O)monstr.o   $(O)mplayer.o  $(O)mthrowu.o  $(O)muse.o    
-VOBJ15 = $(O)music.o    $(O)o_init.o   $(O)objects.o  $(O)objnam.o  
-VOBJ16 = $(O)options.o  $(O)pager.o    $(O)pickup.o   $(O)pline.o   
-VOBJ17 = $(O)polyself.o $(O)potion.o   $(O)pray.o     $(O)priest.o  
-VOBJ18 = $(O)quest.o    $(O)questpgr.o $(RANDOM)      $(O)read.o    
-VOBJ19 = $(O)rect.o     $(O)region.o   $(O)restore.o  $(O)rip.o     
-VOBJ20 = $(O)rnd.o      $(O)role.o     $(O)rumors.o   $(O)save.o    
-VOBJ21 = $(O)shk.o      $(O)shknam.o   $(O)sit.o      $(O)sounds.o  
-VOBJ22 = $(O)sp_lev.o   $(O)spell.o    $(O)steal.o    $(O)steed.o   
-VOBJ23 = $(O)teleport.o $(O)timeout.o  $(O)topten.o   $(O)track.o   
-VOBJ24 = $(O)trap.o     $(O)u_init.o   $(O)uhitm.o    $(O)vault.o   
-VOBJ25 = $(O)vis_tab.o  $(O)vision.o   $(O)weapon.o   $(O)were.o    
-VOBJ26 = $(O)wield.o    $(O)windows.o  $(O)wizard.o   $(O)worm.o    
-VOBJ27 = $(O)worn.o     $(O)write.o    $(O)zap.o     
-
-DLBOBJ = $(O)dlb.o
-
-TTYOBJ = $(O)topl.o     $(O)getline.o  $(O)wintty.o
-
-SOBJ   = $(O)winnt.o    $(O)sys.o      $(O)nttty.o    $(O)unix.o  \
-	   $(SOUND) 	$(O)mapimail.o $(O)nhlan.o
-
-OBJS   = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
-         $(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
-         $(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
-         $(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
-         $(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
-         $(VOBJ26) $(VOBJ27)
-
-TILOBJ = $(TILEGAME)
-
-VVOBJ  = $(O)version.o
-
-ALLOBJ  = $(TILOBJ) $(SOBJ) $(DLBOBJ)  $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ)
-
-#
-# Header objects
-#
-
-#NTCONF_H    = $(INCL)\ntwarn.h $(INCL)\ntconf.h $(INCL)\micro.h \
-NTCONF_H    = $(INCL)\ntconf.h $(INCL)\micro.h \
-	      $(INCL)\system.h $(INCL)\config.h
-PERMONST_H  = $(INCL)\monattk.h $(INCL)\monflag.h
-YOUPROP_H   = $(INCL)\prop.h $(PERMONST_H) $(INCL)\pm.h
-YOU_H       = $(INCL)\attrib.h $(INCL)\monst.h $(YOUPROP_H)
-DECL_H      = $(INCL)\quest.h $(INCL)\spell.h $(INCL)\color.h \
-              $(INCL)\obj.h $(YOU_H) $(INCL)\onames.h
-
-CONFIG_H    = $(INCL)\tradstdc.h $(INCL)\coord.h $(NTCONF_H)
-
-HACK_H      = $(CONFIG_H) $(INCL)\dungeon.h $(INCL)\align.h $(INCL)\monsym.h \
-              $(INCL)\mkroom.h $(INCL)\objclass.h $(DECL_H) $(INCL)\trap.h \
-              $(INCL)\flag.h $(INCL)\rm.h $(INCL)\vision.h $(INCL)\mondata.h \
-              $(INCL)\wintype.h $(INCL)\engrave.h $(INCL)\rect.h \
-              $(INCL)\winprocs.h $(INCL)\trampoli.h \
-              $(INCL)\align.h 
-TILE_H      = ..\win\share\tile.h
-ALIGN_H     = $(INCL)\align.h
-ARTIFACT_H  = $(INCL)\artifact.h
-ARTILIST_H  = $(INCL)\artilist.h
-COLOR_H     = $(INCL)\color.h
-DATE_H      = $(INCL)\date.h
-DLB_H       = $(INCL)\dlb.h
-DGN_FILE_H  = $(INCL)\dgn_file.h
-EMIN_H      = $(INCL)\emin.h
-EPRI_H      = $(INCL)\epri.h
-ESHK_H      = $(INCL)\eshk.h
-EDOG_H      = $(INCL)\edog.h
-FUNC_TAB_H  = $(INCL)\func_tab.h
-LEV_H       = $(INCL)\lev.h
-LEV_COMP_H  = $(INCL)\lev_comp.h
-MAIL_H      = $(INCL)\mail.h
-MFNDPOS_H   = $(INCL)\mfndpos.h
-MONSYM_H    = $(INCL)\monsym.h
-NHLAN_H     = $(INCL)\nhlan.h
-OBJ_H       = $(INCL)\obj.h
-OBJCLASS_H  = $(INCL)\objclass.h
-OBJECTS_H   = $(INCL)\objects.h
-PROP_H      = $(INCL)\prop.h
-QTEXT_H     = $(INCL)\qtext.h
-QUEST_H     = $(INCL)\quest.h
-SKILLS_H    = $(INCL)\skills.h
-SP_LEV_H    = $(INCL)\sp_lev.h
-TERMCAP_H   = $(INCL)\tcap.h
-VAULT_H     = $(INCL)\vault.h
-VIS_TAB_H   = $(INCL)\vis_tab.h
-WINTTY_H    = $(INCL)\wintty.h
-WIN32API_H  = $(INCL)\win32api.h
-WIN32_H     = $(INCL)\nhwin32.h
-PATCHLEVEL_H   = $(INCL)\patchlevel.h
-
-DATABASE = $(DAT)\data.base
-
-#
-#  The name of the game.
-#
-
-GAMEFILE = $(GAMEDIR)\$(GAME).exe
-
-
-#######################################################################
-#
-#  TARGETS
-
-#
-#  The default make target (so just typing 'nmake' is useful).
-#
-default : $(GAMEFILE)
-
-#
-#  The main target.
-#
-
-$(GAME): $(O)obj.tag $(O)utility.tag envchk $(GAMEFILE)
-	@echo $(GAME) is up to date.
-
-#
-#  Everything
-#
-
-all :	install
-
-install: envchk $(GAME) $(O)install.tag
-	 @echo Done.
-
-$(O)install.tag: 	$(DAT)\data	$(DAT)\rumors	 $(DAT)\dungeon \
-	 	$(DAT)\oracles	$(DAT)\quest.dat $(O)sp_lev.tag $(DLB)
-! IF ("$(USE_DLB)"=="Y")
-	copy nhdat                $(GAMEDIR)
-	copy $(DAT)\license       $(GAMEDIR)
-! ELSE
-	copy $(DAT)\*.            $(GAMEDIR)
-	copy $(DAT)\*.dat         $(GAMEDIR)
-	copy $(DAT)\*.lev         $(GAMEDIR)
-	if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
-! ENDIF
-	if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
-	if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
-	if exist $(DOC)\recover.txt copy $(DOC)\recover.txt $(GAMEDIR)\recover.txt
-	@if exist $(SRC)\$(GAME).PDB copy $(SRC)\$(GAME).pdb $(GAMEDIR)\$(GAME).pdb
-	@if exist $(SRC)\$(GAME).PDB echo NOTE: You may want to remove $(GAMEDIR)\$(GAME).pdb to conserve space
-	-copy $(NTSYS)\winnt.cnf   $(GAMEDIR)\defaults.nh
-	copy $(U)recover.exe  $(GAMEDIR)
-! IF ("$(TILEDEF)"!="")
-        if exist $(TILEBMP) copy $(TILEBMP) $(GAMEDIR)
-! ENDIF
-	echo install done > $@
-
-#	copy $(NTSYS)\winnt.hlp    $(GAMEDIR)
-
-$(O)sp_lev.tag: $(O)utility.tag $(DAT)\bigroom.des  $(DAT)\castle.des \
-	$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des   \
-	$(DAT)\medusa.des  $(DAT)\oracle.des   $(DAT)\tower.des  \
-	$(DAT)\yendor.des  $(DAT)\arch.des     $(DAT)\barb.des   \
-	$(DAT)\caveman.des $(DAT)\healer.des   $(DAT)\knight.des \
-	$(DAT)\monk.des    $(DAT)\priest.des   $(DAT)\ranger.des \
-	$(DAT)\rogue.des   $(DAT)\samurai.des  $(DAT)\sokoban.des \
-	$(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des
-	cd $(DAT)
-	$(U)lev_comp bigroom.des
-	$(U)lev_comp castle.des
-	$(U)lev_comp endgame.des
-	$(U)lev_comp gehennom.des
-	$(U)lev_comp knox.des
-	$(U)lev_comp mines.des
-	$(U)lev_comp medusa.des
-	$(U)lev_comp oracle.des
-	$(U)lev_comp sokoban.des
-	$(U)lev_comp tower.des
-	$(U)lev_comp yendor.des
-	$(U)lev_comp arch.des
-	$(U)lev_comp barb.des
-	$(U)lev_comp caveman.des
-	$(U)lev_comp healer.des
-	$(U)lev_comp knight.des
-	$(U)lev_comp monk.des
-	$(U)lev_comp priest.des
-	$(U)lev_comp ranger.des
-	$(U)lev_comp rogue.des
-	$(U)lev_comp samurai.des
-	$(U)lev_comp tourist.des
-	$(U)lev_comp valkyrie.des
-	$(U)lev_comp wizard.des
-	cd $(SRC)
-	echo sp_levs done > $(O)sp_lev.tag
-
-$(O)utility.tag: $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \
-		$(SRC)\monstr.c		$(SRC)\vis_tab.c  \
-		$(U)lev_comp.exe	$(VIS_TAB_H) \
-		$(U)dgn_comp.exe $(U)recover.exe  $(TILEUTIL)
-             @echo utilities made >$@
-	     @echo utilities made.
-
-tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe
-	@echo Optional tile development utilities are up to date.
-
-#  The section for linking the NetHack image looks a little strange at 
-#  first, especially if you are used to UNIX makes, or NDMAKE.  It is 
-#  Microsoft nmake specific, and it gets around the problem of the 
-#  link command line being too long for the linker.  An "in-line" linker 
-#  response file is generated temporarily.
-#
-#  It takes advantage of the following features of nmake:
-#
-#  Inline files : 
-#			Specifying the "<<" means to start an inline file.
-#                 	Another "<<" at the start of a line closes the 
-#                 	inline file.
-#
-#  Substitution within Macros:
-#                       $(mymacro:string1=string2) replaces every
-#                       occurrence of string1 with string2 in the 
-#                       macro mymacro.  Special ascii key codes may be 
-#                       used in the substitution text by preceding it 
-#                       with ^ as we have done below.  Every occurence
-#                       of a <tab> in $(ALLOBJ) is replaced by 
-#                       <+><return><tab>.
-#
-#  DO NOT INDENT THE << below!
-#
-
-#
-#  The main target.
-#
-
-$(GAMEFILE) : $(ALLOBJ)
-	@echo Linking....
-	@$(link) $(LFLAGSG) -out:$@ @<<$(GAME).lnk
-		$(ALLOBJ:^	=^
-		) 
-<<
-	@if exist $(O)install.tag del $(O)install.tag
-	@if exist $(GAMEDIR)\$(GAME).bak del $(GAMEDIR)\$(GAME).bak
-
-$(GAME)_.ico : $(NTSYS)\$(GAME).ico
-	@copy $(NTSYS)\$(GAME).ico $@
-#
-#  Secondary Targets.
-#
-    
-#
-# Makedefs Stuff
-#
-
-$(U)makedefs.exe:	$(MAKEOBJS)
-	@$(link) $(LFLAGSU) -out:$@ $(MAKEOBJS)
-
-$(O)makedefs.o: $(CONFIG_H)	$(PERMONST_H)   $(OBJCLASS_H) \
-		 $(MONSYM_H)    $(QTEXT_H)	$(PATCHLEVEL_H) \
-		 $(U)makedefs.c
-	@$(cc) $(CFLAGSU) $(NTSUB) -Fo$@ $(U)makedefs.c
-
-#
-#  date.h should be remade every time any of the source or include
-#  files is modified.
-#
-
-$(INCL)\date.h : $(U)makedefs.exe
-	$(U)makedefs -v
-
-$(INCL)\onames.h : $(U)makedefs.exe
-	$(U)makedefs -o
-
-$(INCL)\pm.h : $(U)makedefs.exe
-	$(U)makedefs -p
-
-#$(INCL)\trap.h : $(U)makedefs.exe
-#	$(U)makedefs -t
-
-$(SRC)\monstr.c: $(U)makedefs.exe
-	$(U)makedefs -m
-
-$(INCL)\vis_tab.h: $(U)makedefs.exe
-	$(U)makedefs -z
-
-$(SRC)\vis_tab.c: $(U)makedefs.exe
-	$(U)makedefs -z
-
-#
-# Level Compiler Stuff
-#
-
-LEVCFLAGS=-c -nologo -DWINVER=0x0400 -DWIN32 -D_WIN32 -D_MT -MT -I..\include -nologo -Z7 -Od -DDLB
-
-$(U)lev_comp.exe: $(SPLEVOBJS)
-	@echo Linking $@...
-	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
- 		$(SPLEVOBJS:^	=^
-		)
-<<
-
-$(O)lev_yacc.o: $(HACK_H)   $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
-	@$(cc) $(LEVCFLAGS) -W0 $(NTSUB) -Fo$@ $(U)lev_yacc.c
-
-$(O)lev_$(LEX).o: $(HACK_H)   $(INCL)\lev_comp.h $(SP_LEV_H) \
-               $(U)lev_$(LEX).c
-	@$(cc) $(LEVCFLAGS) -W0 $(NTSUB) -Fo$@ $(U)lev_$(LEX).c
-
-$(O)lev_main.o:	$(U)lev_main.c $(HACK_H)   $(SP_LEV_H)
-	@$(cc) $(LEVCFLAGS) -W0 $(NTSUB) -Fo$@ $(U)lev_main.c
-
-
-$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
-!	IF "$(DO_YACC)"=="YACC_ACT"
-	   chdir $(UTIL)
-	   $(YACC) -d lev_comp.y
-	   copy $(YTABC) lev_yacc.c
-	   copy $(YTABH) $(INCL)\lev_comp.h
-	   @del $(YTABC)
-	   @del $(YTABH)
-	   chdir $(SRC)
-!	ELSE
-	   @echo $(U)lev_comp.y has changed.
-	   @echo To update $(U)lev_yacc.c and $(INCL)\lev_comp.h run $(YACC).
-	   @echo ---
-	   @echo For now, we will copy the prebuilt lev_yacc.c and 
-	   @echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
-	   @copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul
-	   @copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul
-	   @echo /**/ >>$(U)lev_yacc.c
-	   @echo /**/ >>$(INCL)\lev_comp.h
-!	ENDIF
-
-$(U)lev_$(LEX).c: $(U)lev_comp.l
-!	IF "$(DO_LEX)"=="LEX_ACT"
-	   chdir $(UTIL)
-	   $(LEX) $(FLEXSKEL) lev_comp.l
-	   copy $(LEXYYC) $@
-	   @del $(LEXYYC)
-	   chdir $(SRC)
-!	ELSE
-	   @echo $(U)lev_comp.l has changed. To update $@ run $(LEX).
-	   @echo ---
-	   @echo For now, we will copy the prebuilt lev_lex.c 
-	   @echo from $(SSYS) into $(UTIL) and use it.
-	   @copy $(SSYS)\lev_lex.c $@ >nul
-	   @echo /**/ >>$@
-!	ENDIF
-
-#
-# Dungeon Stuff
-#
-
-$(U)dgn_comp.exe: $(DGNCOMPOBJS)
-    @echo Linking $@...
-	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
-		$(DGNCOMPOBJS:^	=^
-		)
-<<
-
-$(O)dgn_yacc.o:	$(HACK_H)   $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
-	@$(cc) $(LEVCFLAGS) -W0 $(NTSUB) -Fo$@ $(U)dgn_yacc.c
-
-$(O)dgn_$(LEX).o: $(HACK_H)   $(DGN_FILE_H)  $(INCL)\dgn_comp.h \
-	$(U)dgn_$(LEX).c
-	@$(cc) $(LEVCFLAGS) -W0 $(NTSUB) -Fo$@ $(U)dgn_$(LEX).c
-
-$(O)dgn_main.o:	$(HACK_H) $(U)dgn_main.c
-	@$(cc) $(LEVCFLAGS) -W0 $(NTSUB) -Fo$@ $(U)dgn_main.c
-
-$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
-!	IF "$(DO_YACC)"=="YACC_ACT"
-	   chdir $(UTIL)
-	   $(YACC) -d dgn_comp.y
-	   copy $(YTABC) dgn_yacc.c
-	   copy $(YTABH) $(INCL)\dgn_comp.h
-	   @del $(YTABC)
-	   @del $(YTABH)
-	   chdir $(SRC)
-!	ELSE
-	   @echo $(U)dgn_comp.y has changed. To update dgn_yacc.c and 
-	   @echo $(INCL)\dgn_comp.h run $(YACC).
-	   @echo ---
-	   @echo For now, we will copy the prebuilt $(U)dgn_yacc.c and 
-	   @echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
-	   @copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul
-	   @copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
-	   @echo /**/ >>$(U)dgn_yacc.c
-	   @echo /**/ >>$(INCL)\dgn_comp.h
-!	ENDIF
-
-$(U)dgn_$(LEX).c: $(U)dgn_comp.l
-!	IF "$(DO_LEX)"=="LEX_ACT"
-	   chdir $(UTIL)
-	   $(LEX) $(FLEXSKEL)  dgn_comp.l
-	   copy $(LEXYYC) $@
-	   @del $(LEXYYC)
-	   chdir $(SRC)
-!	ELSE
-	   @echo $(U)dgn_comp.l has changed. To update $@ run $(LEX).
-	   @echo ---
-	   @echo For now, we will copy the prebuilt dgn_lex.c 
-	   @echo from $(SSYS) into $(UTIL) and use it.
-	   @copy $(SSYS)\dgn_lex.c $@ >nul
-	   @echo /**/ >>$@
-!	ENDIF
-
-
-$(O)obj.tag:
-	@if not exist $(O)*.* mkdir $(OBJ)
-	@echo directory $(OBJ) created >$@
-
-#
-#
-envchk:
-!	IF "$(CL)"!=""
-	   @echo Warning, the CL Environment variable is defined:
-	   @echo CL=$(CL)
-!	ENDIF
-!	IF "$(TILEGAME)"!=""
-	   @echo ----
-	   @echo NOTE: This build will include tile support.
-	   @echo ----
-!	ENDIF
-
-#
-# SECONDARY TARGETS
-#
-
-#
-# Header files NOT distributed in ..\include
-#
-
-$(INCL)\win32api.h: $(NTSYS)\win32api.h
-	copy $(NTSYS)\win32api.h $@
-
-#
-#  Recover Utility
-#
-
-$(U)recover.exe: $(RECOVOBJS)
-	@$(link) $(LFLAGSU) -out:$@ $(RECOVOBJS)
-
-#
-#  Tile Mapping
-#
-
-$(SRC)\tile.c: $(U)tilemap.exe
-	@echo A new $@ has been created
-	@$(U)tilemap
-
-$(U)tilemap.exe: $(O)tilemap.o
-	@$(link) $(LFLAGSU) -out:$@ $(O)tilemap.o
-
-$(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H)
-	@$(cc) $(CFLAGSU) $(NTSUB) -Fo$@ $(WSHR)\tilemap.c
-
-
-#
-# Tile Utilities
-#
-
-#
-#  Optional (for development)
-#
-
-$(U)gif2txt.exe: $(GIFREADERS) $(TEXT_IO)
-    @echo Linking $@...
-	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
-		$(GIFREADERS:^	=^
-		)
-		$(TEXT_IO:^	=^
-		)
-<<
-
-$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXT_IO)
-    @echo Linking $@...
-	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
-		$(PPMWRITERS:^	=^
-		)
-		$(TEXT_IO:^	=^
-		)
-<<
-
-#
-#  Required for tile support
-#
-
-$(TILEBMP): $(TILEUTIL) $(TILEFILES)
-	@echo Creating binary tile files (this may take some time)
-	@$(U)tile2bmp $(TILEBMP)
-
-$(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO)
-    @echo Linking $@...
-	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
-		$(O)tile2bmp.o
-		$(TEXT_IO:^  =^
-		)
-<<
-
-$(O)tile2bmp.o: $(WIN32)\tile2bmp.c $(HACK_H) $(TILE_H) $(WIN32API_H)
-	@$(cc) $(CFLAGSG) -I$(WSHR) $(NTSUB) /DPACKED_FILE /Fo$@ $(WIN32)\tile2bmp.c
-
-#
-# DLB stuff
-#
-nhdat:	$(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(DAT)\options \
-	$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
-	$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon \
-	$(DAT)\license $(O)sp_lev.tag
-	cd $(DAT)
-	echo data >dlb.lst
-	echo oracles >>dlb.lst
-	echo options >>dlb.lst
-	echo quest.dat >>dlb.lst
-	echo rumors >>dlb.lst
-	echo help >>dlb.lst
-	echo hh >>dlb.lst
-	echo cmdhelp >>dlb.lst
-	echo history >>dlb.lst
-	echo opthelp >>dlb.lst
-	echo wizhelp >>dlb.lst
-	echo dungeon >>dlb.lst
-	echo license >>dlb.lst
-	for %%N in (*.lev) do echo %%N >>dlb.lst
-	$(U)dlb_main cIf dlb.lst $(SRC)\nhdat
-	cd $(SRC)
-
-$(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o
-	@$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
-		$(O)dlb_main.o
-		$(O)dlb.o
-		$(O)alloc.o
-		$(O)panic.o
-<<
-
-$(O)dlb.o:	$(O)dlb_main.o $(O)alloc.o $(O)panic.o $(DLB_H)
-	@$(cc) $(CFLAGSG) $(NTSUB) /Fo$@ $(SRC)\dlb.c
-	
-$(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(DLB_H)
-	@$(cc) $(CFLAGSG) $(NTSUB) /Fo$@ $(UTIL)\dlb_main.c
-
-#
-# Housekeeping
-#
-
-spotless: clean
-	rmdir $(OBJ)
-	if exist $(DATE_H)    del $(DATE_H)
-	if exist $(INCL)\onames.h  del $(INCL)\onames.h
-	if exist $(INCL)\pm.h      del $(INCL)\pm.h
-	if exist $(VIS_TAB_H) del $(VIS_TAB_H)
-	if exist $(SRC)\vis_tab.c  del $(SRC)\vis_tab.c
-	if exist $(SRC)\tile.c     del $(SRC)\tile.c
-	if exist $(U)*.lnk         del $(U)*.lnk
-	if exist $(U)*.map         del $(U)*.map
-	if exist $(DAT)\data       del $(DAT)\data
-	if exist $(DAT)\rumors     del $(DAT)\rumors
-	if exist $(DAT)\???-fil?.lev	del $(DAT)\???-fil?.lev
-	if exist $(DAT)\???-goal.lev	del $(DAT)\???-goal.lev
-	if exist $(DAT)\???-loca.lev	del $(DAT)\???-loca.lev
-	if exist $(DAT)\???-strt.lev	del $(DAT)\???-strt.lev
-	if exist $(DAT)\air.lev		del $(DAT)\air.lev
-	if exist $(DAT)\asmodeus.lev	del $(DAT)\asmodeus.lev
-	if exist $(DAT)\astral.lev	del $(DAT)\astral.lev
-	if exist $(DAT)\baalz.lev	del $(DAT)\baalz.lev
-	if exist $(DAT)\bigroom.lev	del $(DAT)\bigroom.lev
-	if exist $(DAT)\castle.lev	del $(DAT)\castle.lev
-	if exist $(DAT)\data		del $(DAT)\data
-	if exist $(DAT)\dungeon		del $(DAT)\dungeon
-	if exist $(DAT)\dungeon.pdf	del $(DAT)\dungeon.pdf
-	if exist $(DAT)\earth.lev	del $(DAT)\earth.lev
-	if exist $(DAT)\fakewiz?.lev	del $(DAT)\fakewiz?.lev
-	if exist $(DAT)\fire.lev	del $(DAT)\fire.lev
-	if exist $(DAT)\juiblex.lev	del $(DAT)\juiblex.lev
-	if exist $(DAT)\knox.lev	del $(DAT)\knox.lev
-	if exist $(DAT)\medusa-?.lev	del $(DAT)\medusa-?.lev
-	if exist $(DAT)\mine*.lev	del $(DAT)\mine*.lev
-	if exist $(DAT)\options		del $(DAT)\options
-	if exist $(DAT)\oracle.lev	del $(DAT)\oracle.lev
-	if exist $(DAT)\oracles		del $(DAT)\oracles
-	if exist $(DAT)\orcus.lev	del $(DAT)\orcus.lev
-	if exist $(DAT)\rumors		del $(DAT)\rumors
-	if exist $(DAT)\quest.dat	del $(DAT)\quest.dat
-	if exist $(DAT)\sanctum.lev	del $(DAT)\sanctum.lev
-	if exist $(DAT)\soko?-?.lev	del $(DAT)\soko?-?.lev
-	if exist $(DAT)\tower?.lev	del $(DAT)\tower?.lev
-	if exist $(DAT)\valley.lev	del $(DAT)\valley.lev
-	if exist $(DAT)\water.lev	del $(DAT)\water.lev
-	if exist $(DAT)\wizard?.lev	del $(DAT)\wizard?.lev
-	if exist $(O)sp_lev.tag	        del $(O)sp_lev.tag
-	if exist $(SRC)\monstr.c        del $(SRC)\monstr.c
-	if exist $(SRC)\vis_tab.c       del $(SRC)\vis_tab.c
-	if exist $(U)recover.exe        del $(U)recover.exe
-
-clean:
-	if exist $(O)*.o del $(O)*.o
-	if exist $(O)utility.tag   del $(O)utility.tag
-	if exist $(U)makedefs.exe  del $(U)makedefs.exe
-	if exist $(U)lev_comp.exe  del $(U)lev_comp.exe
-	if exist $(U)dgn_comp.exe  del $(U)dgn_comp.exe
-	if exist $(SRC)\*.lnk      del $(SRC)\*.lnk
-	if exist $(SRC)\*.map      del $(SRC)\*.map
-! IF ("$(TILEDEF)"!="")
-	if exist $(TILEBMP)        del $(TILEBMP)
-! ENDIF
-
-#
-# OTHER DEPENDENCIES
-#
-
-#
-# dat dependencies
-#
-
-$(DAT)\data: $(O)utility.tag    $(DATABASE)
-	$(U)makedefs -d
-
-$(DAT)\rumors: $(O)utility.tag    $(DAT)\rumors.tru   $(DAT)\rumors.fal
-	$(U)makedefs -r
-
-$(DAT)\quest.dat: $(O)utility.tag  $(DAT)\quest.txt
-	$(U)makedefs -q
-
-$(DAT)\oracles: $(O)utility.tag    $(DAT)\oracles.txt
-	$(U)makedefs -h
-
-$(DAT)\dungeon: $(O)utility.tag  $(DAT)\dungeon.def
-	$(U)makedefs -e
-	cd $(DAT)
-	$(U)dgn_comp dungeon.pdf
-	cd $(SRC)
-
-#
-#  Util Dependencies.
-#
-
-$(O)panic.o:  $(U)panic.c $(CONFIG_H)
-	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@ $(U)panic.c
-
-$(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h
-	@$(cc) $(CFLAGSU) $(NTSUB) -Fo$@ $(U)recover.c
-
-#
-#  from win\share
-#
-
-$(O)tiletxt.o: $(WSHR)\tilemap.c $(HACK_H)
-	@$(cc) $(CFLAGSG) $(NTSUB) /DTILETEXT -Fo$@ $(WSHR)\tilemap.c
-
-$(O)gifread.o: $(WSHR)\gifread.c  $(CONFIG_H) $(TILE_H)
-	@$(cc) $(CFLAGSG) -I$(WSHR) $(NTSUB) -Fo$@ $(WSHR)\gifread.c
-
-$(O)ppmwrite.o: $(WSHR)\ppmwrite.c $(CONFIG_H) $(TILE_H)
-	@$(cc) $(CFLAGSG) -I$(WSHR) $(NTSUB) -Fo$@ $(WSHR)\ppmwrite.c
-
-$(O)tiletext.o: $(WSHR)\tiletext.c  $(CONFIG_H) $(TILE_H)
-	@$(cc) $(CFLAGSG) -I$(WSHR) $(NTSUB) -Fo$@ $(WSHR)\tiletext.c
-
-#
-#  from win\tty
-#
-$(O)getline.o: $(TTY)\getline.c $(HACK_H) $(INCL)\func_tab.h
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(TTY)\getline.c
-$(O)termcap.o: $(TTY)\termcap.c $(HACK_H) $(INCL)\tcap.h
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(TTY)\termcap.c
-$(O)topl.o: $(TTY)\topl.c $(HACK_H) $(INCL)\tcap.h
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(TTY)\topl.c
-$(O)wintty.o: $(TTY)\wintty.c $(HACK_H) $(INCL)\dlb.h \
-		$(INCL)\patchlevel.h $(INCL)\tcap.h
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(TTY)\wintty.c
-
-#
-# from sys\share
-#
-$(O)main.o: $(SSYS)\pcmain.c $(HACK_H) $(INCL)\dlb.h
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(SSYS)\pcmain.c
-$(O)sys.o: $(SSYS)\pcsys.c $(HACK_H)
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(SSYS)\pcsys.c
-$(O)tty.o: $(SSYS)\pctty.c $(HACK_H)
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(SSYS)\pctty.c
-$(O)unix.o: $(SSYS)\pcunix.c $(HACK_H)
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(SSYS)\pcunix.c
-$(O)random.o: $(SSYS)\random.c $(HACK_H)
-	@$(CC) $(CFLAGSG) $(NTSUB) -Fo$@ $(SSYS)\random.c
-$(O)nhlan.o:	$(HACK_H) $(NHLAN_H) $(SSYS)\nhlan.c
-	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@ $(SSYS)\nhlan.c
-
-
-#
-# from sys\winnt
-#
-
-$(O)nttty.o:   $(NTSYS)\nttty.c   $(HACK_H) $(WINTTY_H) \
-                $(TILE_H) $(WIN32API_H)
-	@$(cc) $(CFLAGSG) -I$(WSHR) $(NTSUB) -Fo$@  $(NTSYS)\nttty.c
-$(O)winnt.o: $(NTSYS)\winnt.c   $(HACK_H) $(WIN32API_H)
-	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@  $(NTSYS)\winnt.c
-$(O)ntsound.o: $(NTSYS)\ntsound.c   $(HACK_H)
-	@$(cc) $(CFLAGSG)  $(NTSUB) -Fo$@ $(NTSYS)\ntsound.c
-$(O)mapimail.o: $(NTSYS)\mapimail.c   $(HACK_H) $(NHLAN_H)
-	@$(cc) $(CFLAGSG) -DMAPI_VERBOSE  $(NTSUB) -Fo$@ $(NTSYS)\mapimail.c
-
-#
-# from src
-#
-
-#$(O)alloc.o: $(SRC)\alloc.c    $(CONFIG_H)
-#	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@ $(SRC)\alloc.c
-#$(O)end.o: $(SRC)\end.c      $(HACK_H) $(ESHK_H) $(DLB_H)
-#	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@ $(SRC)\end.c
-#$(O)version.o: $(SRC)\version.c  $(HACK_H) $(DATE_H)  $(PATCHLEVEL_H)
-#	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@ $(SRC)\version.c
-#$(O)vis_tab.o: $(SRC)\vis_tab.c  $(HACK_H) $(VIS_TAB_H)
-#	@$(cc) $(CFLAGSG) $(NTSUB) -Fo$@ $(SRC)\vis_tab.c
-
-$(O)allmain.o: $(SRC)\allmain.c $(HACK_H)
-$(O)alloc.o: $(SRC)\alloc.c $(CONFIG_H)
-$(O)apply.o: $(SRC)\apply.c $(HACK_H) $(INCL)\edog.h
-$(O)artifact.o: $(SRC)\artifact.c $(HACK_H) $(INCL)\artifact.h $(INCL)\artilist.h
-$(O)attrib.o: $(SRC)\attrib.c $(HACK_H) $(INCL)\artifact.h
-$(O)ball.o: $(SRC)\ball.c $(HACK_H)
-$(O)bones.o: $(SRC)\bones.c $(HACK_H) $(INCL)\lev.h
-$(O)botl.o: $(SRC)\botl.c $(HACK_H)
-$(O)cmd.o: $(SRC)\cmd.c $(HACK_H) $(INCL)\func_tab.h
-$(O)dbridge.o: $(SRC)\dbridge.c $(HACK_H)
-$(O)decl.o: $(SRC)\decl.c $(HACK_H)
-$(O)detect.o: $(SRC)\detect.c $(HACK_H) $(INCL)\artifact.h
-$(O)dig.o: $(SRC)\dig.c $(HACK_H) $(INCL)\edog.h
-$(O)display.o: $(SRC)\display.c $(HACK_H)
-$(O)dlb.o: $(SRC)\dlb.c $(CONFIG_H) $(INCL)\dlb.h
-$(O)do.o: $(SRC)\do.c $(HACK_H) $(INCL)\lev.h
-$(O)do_name.o: $(SRC)\do_name.c $(HACK_H)
-$(O)do_wear.o: $(SRC)\do_wear.c $(HACK_H)
-$(O)dog.o: $(SRC)\dog.c $(HACK_H) $(INCL)\edog.h
-$(O)dogmove.o: $(SRC)\dogmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
-$(O)dokick.o: $(SRC)\dokick.c $(HACK_H) $(INCL)\eshk.h
-$(O)dothrow.o: $(SRC)\dothrow.c $(HACK_H)
-$(O)drawing.o: $(SRC)\drawing.c $(HACK_H) $(INCL)\tcap.h
-$(O)dungeon.o: $(SRC)\dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
-$(O)eat.o: $(SRC)\eat.c $(HACK_H)
-$(O)end.o: $(SRC)\end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
-$(O)engrave.o: $(SRC)\engrave.c $(HACK_H) $(INCL)\lev.h
-$(O)exper.o: $(SRC)\exper.c $(HACK_H)
-$(O)explode.o: $(SRC)\explode.c $(HACK_H)
-$(O)extralev.o: $(SRC)\extralev.c $(HACK_H)
-$(O)files.o: $(SRC)\files.c $(HACK_H) $(INCL)\dlb.h
-$(O)fountain.o: $(SRC)\fountain.c $(HACK_H)
-$(O)hack.o: $(SRC)\hack.c $(HACK_H)
-$(O)hacklib.o: $(SRC)\hacklib.c $(HACK_H)
-$(O)invent.o: $(SRC)\invent.c $(HACK_H) $(INCL)\artifact.h
-$(O)light.o: $(SRC)\light.c $(HACK_H) $(INCL)\lev.h
-$(O)lock.o: $(SRC)\lock.c $(HACK_H)
-$(O)mail.o: $(SRC)\mail.c $(HACK_H) $(INCL)\mail.h
-$(O)makemon.o: $(SRC)\makemon.c $(HACK_H) $(INCL)\epri.h $(INCL)\emin.h \
-		$(INCL)\edog.h
-$(O)mcastu.o: $(SRC)\mcastu.c $(HACK_H)
-$(O)mhitm.o: $(SRC)\mhitm.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
-$(O)mhitu.o: $(SRC)\mhitu.c $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
-$(O)minion.o: $(SRC)\minion.c $(HACK_H) $(INCL)\emin.h $(INCL)\epri.h
-$(O)mklev.o: $(SRC)\mklev.c $(HACK_H)
-$(O)mkmap.o: $(SRC)\mkmap.c $(HACK_H) $(INCL)\sp_lev.h
-$(O)mkmaze.o: $(SRC)\mkmaze.c $(HACK_H) $(INCL)\sp_lev.h $(INCL)\lev.h
-$(O)mkobj.o: $(SRC)\mkobj.c $(HACK_H) $(INCL)\artifact.h
-$(O)mkroom.o: $(SRC)\mkroom.c $(HACK_H)
-$(O)mon.o: $(SRC)\mon.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
-$(O)mondata.o: $(SRC)\mondata.c $(HACK_H) $(INCL)\eshk.h $(INCL)\epri.h
-$(O)monmove.o: $(SRC)\monmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
-$(O)monst.o: $(SRC)\monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \
-		$(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \
-		$(INCL)\dungeon.h $(INCL)\eshk.h $(INCL)\vault.h \
-		$(INCL)\epri.h $(INCL)\color.h
-$(O)mplayer.o: $(SRC)\mplayer.c $(HACK_H)
-$(O)mthrowu.o: $(SRC)\mthrowu.c $(HACK_H)
-$(O)muse.o: $(SRC)\muse.c $(HACK_H) $(INCL)\edog.h
-$(O)music.o: $(SRC)\music.c $(HACK_H) #interp.c
-$(O)o_init.o: $(SRC)\o_init.c $(HACK_H) $(INCL)\lev.h
-$(O)objects.o: $(SRC)\objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
-		$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
-$(O)objnam.o: $(SRC)\objnam.c $(HACK_H)
-$(O)options.o: $(SRC)\options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h \
-		$(HACK_H) $(INCL)\tcap.h
-$(O)pager.o: $(SRC)\pager.c $(HACK_H) $(INCL)\dlb.h
-$(O)pickup.o: $(SRC)\pickup.c $(HACK_H)
-$(O)pline.o: $(SRC)\pline.c $(HACK_H) $(INCL)\epri.h
-$(O)polyself.o: $(SRC)\polyself.c $(HACK_H)
-$(O)potion.o: $(SRC)\potion.c $(HACK_H)
-$(O)pray.o: $(SRC)\pray.c $(HACK_H) $(INCL)\epri.h
-$(O)priest.o: $(SRC)\priest.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\eshk.h \
-		$(INCL)\epri.h $(INCL)\emin.h
-$(O)quest.o: $(SRC)\quest.c $(HACK_H) $(INCL)\qtext.h
-$(O)questpgr.o: $(SRC)\questpgr.c $(HACK_H) $(INCL)\dlb.h $(INCL)\qtext.h
-$(O)read.o: $(SRC)\read.c $(HACK_H)
-$(O)rect.o: $(SRC)\rect.c $(HACK_H)
-$(O)region.o: $(SRC)\region.c $(HACK_H)
-$(O)restore.o: $(SRC)\restore.c $(HACK_H) $(INCL)\lev.h $(INCL)\tcap.h
-$(O)rip.o: $(SRC)\rip.c $(HACK_H)
-$(O)rnd.o: $(SRC)\rnd.c $(HACK_H)
-$(O)role.o: $(SRC)\role.c $(HACK_H)
-$(O)rumors.o: $(SRC)\rumors.c $(HACK_H) $(INCL)\lev.h $(INCL)\dlb.h
-$(O)save.o: $(SRC)\save.c $(HACK_H) $(INCL)\lev.h
-$(O)shk.o: $(SRC)\shk.c $(HACK_H) $(INCL)\eshk.h
-$(O)shknam.o: $(SRC)\shknam.c $(HACK_H) $(INCL)\eshk.h
-$(O)sit.o: $(SRC)\sit.c $(HACK_H) $(INCL)\artifact.h
-$(O)sounds.o: $(SRC)\sounds.c $(HACK_H) $(INCL)\edog.h
-$(O)sp_lev.o: $(SRC)\sp_lev.c $(HACK_H) $(INCL)\dlb.h $(INCL)\sp_lev.h
-$(O)spell.o: $(SRC)\spell.c $(HACK_H)
-$(O)steal.o: $(SRC)\steal.c $(HACK_H)
-$(O)steed.o: $(SRC)\steed.c $(HACK_H)
-$(O)teleport.o: $(SRC)\teleport.c $(HACK_H)
-$(O)timeout.o: $(SRC)\timeout.c $(HACK_H) $(INCL)\lev.h
-$(O)topten.o: $(SRC)\topten.c $(HACK_H) $(INCL)\dlb.h $(INCL)\patchlevel.h
-$(O)track.o: $(SRC)\track.c $(HACK_H)
-$(O)trap.o: $(SRC)\trap.c $(HACK_H)
-$(O)u_init.o: $(SRC)\u_init.c $(HACK_H)
-$(O)uhitm.o: $(SRC)\uhitm.c $(HACK_H)
-$(O)vault.o: $(SRC)\vault.c $(HACK_H) $(INCL)\vault.h
-$(O)version.o: $(SRC)\version.c $(HACK_H) $(INCL)\date.h $(INCL)\patchlevel.h
-$(O)vision.o: $(SRC)\vision.c $(HACK_H) $(INCL)\vis_tab.h
-$(O)weapon.o: $(SRC)\weapon.c $(HACK_H)
-$(O)were.o: $(SRC)\were.c $(HACK_H)
-$(O)wield.o: $(SRC)\wield.c $(HACK_H)
-$(O)windows.o: $(SRC)\windows.c $(HACK_H) $(INCL)\wingem.h
-$(O)wizard.o: $(SRC)\wizard.c $(HACK_H) $(INCL)\qtext.h
-$(O)worm.o: $(SRC)\worm.c $(HACK_H) $(INCL)\lev.h
-$(O)worn.o: $(SRC)\worn.c $(HACK_H)
-$(O)write.o: $(SRC)\write.c $(HACK_H)
-$(O)zap.o: $(SRC)\zap.c $(HACK_H)
-
-# end of file
diff -Naurd ../nethack-3.3.1/sys/winnt/mapimail.c ./sys/winnt/mapimail.c
--- ../nethack-3.3.1/sys/winnt/mapimail.c Thu Apr 27 01:45:54 2000
+++ ./sys/winnt/mapimail.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*      SCCS Id: @(#)mapimail.c 3.3     2000/04/25        */
+/*      SCCS Id: @(#)mapimail.c 3.4     2000/04/25        */
 /* Copyright (c) Michael Allison, 1997                  */
 /* NetHack may be freely redistributed.  See license for details. */
 
diff -Naurd ../nethack-3.3.1/sys/winnt/nethack.def ./sys/winnt/nethack.def
--- ../nethack-3.3.1/sys/winnt/nethack.def Tue Dec 7 22:03:37 1999
+++ ./sys/winnt/nethack.def Fri Mar 22 14:40:55 2002
@@ -1,5 +1,5 @@
 NAME		NETHACK
-DESCRIPTION	'NetHack 3.3.0 for Windows NT'
+DESCRIPTION	'NetHack 3.4.0 for Windows NT'
 EXETYPE		WINDOWS
 STUB		'WINSTUB.EXE'
 CODE		PRELOAD MOVEABLE DISCARDABLE
diff -Naurd ../nethack-3.3.1/sys/winnt/nhico.uu ./sys/winnt/nhico.uu
--- ../nethack-3.3.1/sys/winnt/nhico.uu Sat Apr 4 03:24:00 1998
+++ ./sys/winnt/nhico.uu Fri Mar 22 14:40:55 2002
@@ -1,25 +1,27 @@
-section 1 of uuencode 4.13 of file NETHACK.ICO    by R.E.M.
-
-begin 644 NETHACK.ICO
-M```!``$`("`0``````#H`@``%@```"@````@````0`````$`!```````@`(`.
-M``````````````````````````````"```"`````@(``@````(``@`"`@```6
-M@("``,#`P````/\``/\```#__P#_````_P#_`/__``#___\`]F9F9F9F9F9F*
-M9F9F9F9F9O]F9F9F9F9F9F9F9F9F9F;_B(B(B(B(B(B(B(B(B&9F_XB(B(B(D
-MB(B(B(B(B(AF9O^(B(B(A555B(B(B(B(9F;_B(B(B`!5!8B(B(B(B&9F_XB('
-MB(@```6(B(B(B(AF9O^(B%554`!56(B(B(B(9F;_B(N[N[`.XU6(B(B(B&9F[
-M_XB[N[L`ONXU6(B(B(AF9O^+N[N[N[ONXUB(B(B(9F;_B[N[N[N[ONY3B(B(N
-MB&9F_XN[NYF9F[ONXSB(B(AF9O^+N[F9F9F[ONXSB(B(9F;_B[N9F9F9F[ON?
-MXSB(B&9F_XNYF9F9F9F[7NXSB(AF9O^+N9F9F9F9NUCNXSB(9F;_B[F9F9F9J
-MF;M8CNXSB&9F_XNYF9F9F9F[6(CNXXAF9O^+N9F9F9F9NUB(CNZ(9F;_B[N9]
-MF9F9F[M8B(CNB&9F_XN[N9F9F;N[6(B(B(AF9O^+N[N9F9N[NUB(B(B(9F;_R
-MB[N[N[N[N[M8B(B(B&9F_XN[N[N[N[N[B(B(B(AF9O^+NXB(B(B+NXB(B(B(F
-M9F;_B[B(B(B(B+N(B(B(B&9F_XB(B(B(B(B(B(B(B(AF9O^(B(B(B(B(B(B(J
-MB(B(9F;_B(B(B(B(B(B(B(B(B&9F___________________V9O__________%
-M__________\`````````````````````````````````````````````````R
-M`````````````````````````````````````````````````````````````
-M`````````````````````````````````````````````````````````````
-!`````
-``
+begin 600 nethack.ico
+M```!``(`("`0``````#H`@``)@```!`0$```````*`$```X#```H````(```
+M`$`````!``0``````(`"````````````````````````````````@```@```
+M`("``(````"``(``@(```,#`P`"`@(````#_``#_````__\`_P```/\`_P#_
+M_P``____````````````````````````__=P```````````'=W<`#___=P``
+M````````?_?W<`]W:/=P``#_<```!WB'!G`/8'B'<``/_W<```?VAGAP#P=E
+M;W``__]W<``'>`=H\`__=G_P#_!V9_<`!W=H=W``__</\/\,>(:/<`=P=W<`
+M``__\`_W=G9GB'<`!W=P````__#_=G=X2&"/<`=W``````_P_\=T=F>(:/<'
+M<```````#_9V=V5H8(AO<`````````_W=W1WAXAHA_````````#_9\<&>&!H
+M!H9W````````_W=V=6=GAH@(]P``````#_?'9W9T:(!H:&=P``````_V=WQV
+M=X=HA@B/<``````/]GQP=G>':(A@AW``````#_<'9\=VAH!HB&=P``````_V
+M=G=X9V>&"&"'<``````/]W?'9W1@B(:(9W````^&C_?'9W1WAX:`8(=P`'`/
+M_X_P9W9W:&A@AH:'</=P#_^/]W?'='>'AH@(AW!W\`=H;_9V=G!H:&"&A@=P
+M`(`'B(_P<'!V<&>(:(B'<`"`#_\/______=W=W=W=W!W<`__#_____?_?W=W
+M=W=P=W`/``__#___]W=W=W!W<`!P```/\`#_]_]_=W<`!W``````#P```/_W
+M=W<```!P````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````H````$````"`````!``0``````,``````````
+M````````````````````````@```@````("``(````"``(``@(```,#`P`"`
+M@(````#_``#_````__\`_P```/\`_P#__P``____`````````````/<`````
+M=P`/_W`/<`=W<`#_\/8'!W<```\/9F!P<````/9F!@<`````]F9@9P````]F
+M9@8&<```#V9F8&!P```/9F8&!G````]F9F!@<``/?V9F!@9P<`]_9F9@8'!P
+M#P___W=W<'``#P__=W!P````````````````````````````````````````
+K````````````````````````````````````````````````````````````
+`
 end
-sum -r/size 23881/1107 section (from "begin" to "end")
-sum -r/size 55184/766 entire input file
diff -Naurd ../nethack-3.3.1/sys/winnt/nhsetup.bat ./sys/winnt/nhsetup.bat
--- ../nethack-3.3.1/sys/winnt/nhsetup.bat Thu Oct 21 23:18:38 1999
+++ ./sys/winnt/nhsetup.bat Fri Mar 22 14:40:55 2002
@@ -1,64 +1,114 @@
-@REM  SCCS Id: @(#)nhsetup.bat      96/10/30                
-@REM  Copyright (c) NetHack PC Development Team 1993, 1996
+@REM  SCCS Id: @(#)nhsetup.bat      2002/03/07
+@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
 @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 ..\..\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
 echo Directories look ok.
 
-:do_rest
-echo "Copying Makefile.NT to ..\..\src\Makefile"
-copy makefile.NT ..\..\src\Makefile >nul
-echo Makefile copied ok.
-if not exist ..\..\win\win32\NetHack.dsp goto nowin32
-echo "Copying Visual C project files to top level directory"
-copy ..\..\win\win32\NetHack.rc ..\..
-copy ..\..\win\win32\resource.h ..\..
-copy ..\..\win\win32\NetHack.dsw ..\..
-copy ..\..\win\win32\NetHack.clw ..\..
-copy ..\..\win\win32\makedefs.dsp ..\..
-copy ..\..\win\win32\NetHack.dsp ..\..
-copy ..\..\win\win32\tile2bmp.dsp ..\..
-copy ..\..\win\win32\dgncomp.dsp ..\..
-copy ..\..\win\win32\levcomp.dsp ..\..
-copy ..\..\win\win32\dlb_main.dsp ..\..
-copy ..\..\win\win32\tilemap.dsp ..\..
-copy ..\..\win\win32\recover.dsp ..\..
+:do_tty
+if NOT exist ..\..\binary\*.* mkdir ..\..\binary
+if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
+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
+echo Microsoft Makefile copied ok.
 
-:nowin32
+echo Copying Borland Makefile - Makefile.bcc to ..\..\src\Makefile.bcc
+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
+echo Borland Makefile copied ok.
 
-if exist .\nethack.ico goto hasicon
-if exist .\nhico.uu uudecode nhico.uu >nul
-if NOT exist .\nethack.ico goto err_nouu
-:hasicon
-echo NetHack icon exists ok.
-echo done!
-echo.
-echo Proceed with the next step documented in Install.nt
+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
+if not exist ..\..\win\win32\nethack.dsw goto :err_win
 echo.
-goto done
-:err_nouu
-echo Apparently you have no UUDECODE utility in your path.  You need a UUDECODE
-echo utility in order to turn "nhico.uu" into "nethack.ico".
-echo Check "Install.nt" for a list of the steps required to build NetHack.
-goto done
-:err_plev
-echo A required file ..\..\include\patchlev.h 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 done
+echo Copying Visual C project files to ..\..\build directory
+echo Copying ..\..\win\win32\nethack.dsw  ..\..\nethack.dsw
+copy ..\..\win\win32\nethack.dsw  ..\.. >nul
+if NOT exist ..\..\binary\*.* echo Creating ..\..\binary directory
+if NOT exist ..\..\binary\*.* mkdir ..\..\binary
+if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
+if NOT exist ..\..\build\*.* echo Creating ..\..\build directory
+if NOT exist ..\..\build\*.* mkdir ..\..\build
+copy ..\..\win\win32\dgncomp.dsp   ..\..\build >nul
+copy ..\..\win\win32\dgnstuff.dsp  ..\..\build >nul
+copy ..\..\win\win32\dgnstuff.mak  ..\..\build >nul
+copy ..\..\win\win32\dlb_main.dsp  ..\..\build >nul
+copy ..\..\win\win32\levcomp.dsp   ..\..\build >nul
+copy ..\..\win\win32\levstuff.dsp  ..\..\build >nul
+copy ..\..\win\win32\levstuff.mak  ..\..\build >nul
+copy ..\..\win\win32\makedefs.dsp  ..\..\build >nul
+copy ..\..\win\win32\recover.dsp   ..\..\build >nul
+copy ..\..\win\win32\tile2bmp.dsp  ..\..\build >nul
+copy ..\..\win\win32\tiles.dsp     ..\..\build >nul
+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
+
+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 done
+goto :fini
+
 :err_dir
 echo Your directories are not set up properly, please re-read the
-echo documentation.
+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=
diff -Naurd ../nethack-3.3.1/sys/winnt/ntsound.c ./sys/winnt/ntsound.c
--- ../nethack-3.3.1/sys/winnt/ntsound.c Thu Oct 21 22:32:18 1999
+++ ./sys/winnt/ntsound.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*   SCCS Id: @(#)ntsound.c   3.3     95/09/06                        */
+/*   SCCS Id: @(#)ntsound.c   3.4     1995/09/06                        */
 /*   Copyright (c) NetHack PC Development Team 1993                 */
 /*   NetHack may be freely redistributed.  See license for details. */
 /*                                                                  */
diff -Naurd ../nethack-3.3.1/sys/winnt/nttty.c ./sys/winnt/nttty.c
--- ../nethack-3.3.1/sys/winnt/nttty.c Thu Aug 3 21:50:51 2000
+++ ./sys/winnt/nttty.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*	SCCS Id: @(#)nttty.c	3.3	2000/08/02
+/*	SCCS Id: @(#)nttty.c	3.4	2000/08/02
 /* Copyright (c) NetHack PC Development Team 1993    */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -39,7 +39,7 @@
 HANDLE hConOut;
 
 /* Win32 Screen buffer,coordinate,console I/O information */
-CONSOLE_SCREEN_BUFFER_INFO csbi;
+CONSOLE_SCREEN_BUFFER_INFO csbi, origcsbi;
 COORD ntcoord;
 INPUT_RECORD ir;
 
@@ -52,15 +52,30 @@
  */
 int GUILaunched;
 static BOOL FDECL(CtrlHandler, (DWORD));
- 
-# ifdef TEXTCOLOR
+
+#ifndef CLR_MAX
+#define CLR_MAX 16
+#endif
 int ttycolors[CLR_MAX];
+# ifdef TEXTCOLOR
 static void NDECL(init_ttycolor);
 # endif
 
+#define DEFTEXTCOLOR  ttycolors[7]
+#ifdef TEXTCOLOR
+#define DEFGLYPHBGRND (0)
+#else
+#define DEFGLYPHBGRND (0)
+#endif
+
 static char nullstr[] = "";
 char erase_char,kill_char;
 
+static char currentcolor = FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE;
+static char currenthilite = 0;
+static char currentbackground = 0;
+static boolean colorchange = TRUE;
+
 #define LEFTBUTTON  FROM_LEFT_1ST_BUTTON_PRESSED
 #define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
 #define MIDBUTTON   FROM_LEFT_2ND_BUTTON_PRESSED
@@ -70,13 +85,19 @@
  * Called after returning from ! or ^Z
  */
 void
-gettty(){
-
+gettty()
+{
+#ifndef TEXTCOLOR
+	int k;
+#endif
 	erase_char = '\b';
 	kill_char = 21;		/* cntl-U */
 	iflags.cbreak = TRUE;
 #ifdef TEXTCOLOR
 	init_ttycolor();
+#else
+	for(k=0; k < CLR_MAX; ++k)
+		ttycolors[k] = 7;
 #endif
 }
 
@@ -96,6 +117,51 @@
 	start_screen();
 }
 
+void
+tty_startup(wid, hgt)
+int *wid, *hgt;
+{
+/*	int twid = origcsbi.dwSize.X; */
+	int twid = origcsbi.srWindow.Right - origcsbi.srWindow.Left;
+
+	if (twid > 80) twid = 80;
+	*wid = twid;
+	*hgt = origcsbi.srWindow.Bottom - origcsbi.srWindow.Top;
+}
+
+void
+tty_number_pad(state)
+int state;
+{
+}
+
+void
+tty_start_screen()
+{
+	if (iflags.num_pad) tty_number_pad(1);	/* make keypad send digits */
+}
+
+void
+tty_end_screen()
+{
+	clear_screen();
+	if (GetConsoleScreenBufferInfo(hConOut,&csbi))
+	{
+	    DWORD ccnt;
+	    COORD newcoord;
+	    
+	    newcoord.X = 0;
+	    newcoord.Y = 0;
+	    FillConsoleOutputAttribute(hConOut,
+	    		FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
+	    		csbi.dwSize.X * csbi.dwSize.Y,
+	    		newcoord, &ccnt);
+	    FillConsoleOutputCharacter(hConOut,' ',
+			csbi.dwSize.X * csbi.dwSize.Y,
+			newcoord, &ccnt);
+	}
+}
+
 static BOOL CtrlHandler(ctrltype)
 DWORD ctrltype;
 {
@@ -107,13 +173,12 @@
 		case CTRL_LOGOFF_EVENT:
 		case CTRL_SHUTDOWN_EVENT:
 #ifndef NOSAVEONHANGUP
-			if (program_state.something_worth_saving) {
-				program_state.exiting++;
-				(void) dosave0();
-			}
+			hangup(0);
 #endif
+#if 0
 			clearlocks();
 			terminate(EXIT_FAILURE);
+#endif
 		default:
 			return FALSE;
 	}
@@ -124,7 +189,7 @@
 nttty_open()
 {
         HANDLE hStdOut;
-        long cmode;
+        DWORD cmode;
         long mask;
         
 	/* Initialize the function pointer that points to
@@ -140,10 +205,10 @@
          * the NT program manager. M. Allison
          */
         hStdOut = GetStdHandle( STD_OUTPUT_HANDLE );
-        GetConsoleScreenBufferInfo( hStdOut, &csbi);
-        GUILaunched = ((csbi.dwCursorPosition.X == 0) &&
-                           (csbi.dwCursorPosition.Y == 0));
-        if ((csbi.dwSize.X <= 0) || (csbi.dwSize.Y <= 0))
+        GetConsoleScreenBufferInfo( hStdOut, &origcsbi);
+        GUILaunched = ((origcsbi.dwCursorPosition.X == 0) &&
+                           (origcsbi.dwCursorPosition.Y == 0));
+        if ((origcsbi.dwSize.X <= 0) || (origcsbi.dwSize.Y <= 0))
             GUILaunched = 0;
 	hConIn = GetStdHandle(STD_INPUT_HANDLE);
 	hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -156,7 +221,7 @@
 	hConOut = CreateFile("CONOUT$",
 			GENERIC_READ |GENERIC_WRITE,
 			FILE_SHARE_READ |FILE_SHARE_WRITE,
-			0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,0);					        
+			0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,0);
 #endif       
 	GetConsoleMode(hConIn,&cmode);
 #ifndef NO_MOUSE_ALLOWED
@@ -177,6 +242,28 @@
 	get_scr_size();
 }
 
+void
+get_scr_size()
+{
+	GetConsoleScreenBufferInfo(hConOut, &csbi);
+  
+	LI = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
+	CO = csbi.srWindow.Right - csbi.srWindow.Left + 1;
+
+	if ( (LI < 25) || (CO < 80) ) {
+		COORD newcoord;
+    
+		LI = 25;
+		CO = 80;
+
+		newcoord.Y = LI;
+		newcoord.X = CO;
+
+		SetConsoleScreenBufferSize( hConOut, newcoord );
+	}
+}
+
+
 /*
  *  Keyboard translation tables.
  *  (Adopted from the MSDOS port)
@@ -202,9 +289,9 @@
 			{'u', 'U', C('u')},		/* 9 */
 			{'m', C('p'), C('p')},		/* - */
 			{'h', 'H', C('h')},		/* 4 */
-			{'g', 'g', 'g'},		/* 5 */
+			{'g', 'G', 'g'},		/* 5 */
 			{'l', 'L', C('l')},		/* 6 */
-			{'p', 'P', C('p')},		/* + */
+			{'+', 'P', C('p')},		/* + */
 			{'b', 'B', C('b')},		/* 1 */
 			{'j', 'J', C('j')},		/* 2 */
 			{'n', 'N', C('n')},		/* 3 */
@@ -218,7 +305,7 @@
 			{'4', M('4'), '4'},		/* 4 */
 			{'g', 'G', 'g'},		/* 5 */
 			{'6', M('6'), '6'},		/* 6 */
-			{'p', 'P', C('p')},		/* + */
+			{'+', 'P', C('p')},		/* + */
 			{'1', M('1'), '1'},		/* 1 */
 			{'2', M('2'), '2'},		/* 2 */
 			{'3', M('3'), '3'},		/* 3 */
@@ -245,6 +332,8 @@
 
 #define inmap(x)	(SCANLO <= (x) && (x) < SCANLO + SIZE(scanmap))
 
+int FDECL(process_keystroke, (INPUT_RECORD *ir, boolean *valid));
+
 int process_keystroke(ir, valid)
 INPUT_RECORD *ir;
 boolean *valid;
@@ -302,8 +391,8 @@
 int
 tgetch()
 {
-	int count;
-	int valid = 0;
+	DWORD count;
+	boolean valid = 0;
 	int ch;
 	valid = 0;
 	while (!valid)
@@ -319,13 +408,13 @@
 ntposkey(x, y, mod)
 int *x, *y, *mod;
 {
-	int count;
+	DWORD count;
 	unsigned short int scan;
 	unsigned char ch;
 	unsigned long shiftstate;
 	int altseq;
 	int done = 0;
-	int valid = 0;
+	boolean valid = 0;
 	while (!done)
 	{
 	    count = 0;
@@ -341,10 +430,6 @@
 			return process_keystroke(&ir, &valid);
 		} else if ((ir.EventType == MOUSE_EVENT &&
 		  (ir.Event.MouseEvent.dwButtonState & MOUSEMASK))) {
-#if 0
-		  	*x = ir.Event.MouseEvent.dwMousePosition.X - csbi.srWindow.Left;
-		  	*y = ir.Event.MouseEvent.dwMousePosition.Y - csbi.srWindow.Top;
-#endif
 		  	*x = ir.Event.MouseEvent.dwMousePosition.X + 1;
 		  	*y = ir.Event.MouseEvent.dwMousePosition.Y - 1;
 
@@ -370,7 +455,7 @@
 {
 	int done = 0;	/* true =  "stop searching"        */
 	int retval;	/* true =  "we had a match"        */
-	int count;
+	DWORD count;
 	unsigned short int scan;
 	unsigned char ch;
 	unsigned long shiftstate;
@@ -409,75 +494,6 @@
 }
 
 void
-get_scr_size()
-{
-	if (GetConsoleScreenBufferInfo(hConOut,&csbi))
-	{
-	    int tmpx, tmpy, ccnt;
-	    COORD newcoord;
-	    
-	    newcoord.X = 0;
-	    newcoord.Y = 0;
-	    FillConsoleOutputCharacter(hConOut,' ',
-			csbi.dwSize.X * csbi.dwSize.Y,
-			newcoord, &ccnt);
-
-	    tmpy = csbi.dwSize.Y;
-	    tmpx = csbi.dwSize.X;
-	    if ((tmpy < 25) || (tmpx < 80)) {
-	    	newcoord.Y = 25;
-	    	newcoord.X = 80;
-	    	SetConsoleScreenBufferSize(hConOut, newcoord);
-	    }
-	}
-	LI = 25;
-	CO = 80;
-}
-
-
-void
-tty_startup(wid, hgt)
-    int *wid, *hgt;
-{
-
-	*wid = CO;
-	*hgt = LI;
-}
-
-void
-tty_number_pad(state)
-int state;
-{
-}
-
-void
-tty_start_screen()
-{
-	if (iflags.num_pad) tty_number_pad(1);	/* make keypad send digits */
-}
-
-void
-tty_end_screen()
-{
-	clear_screen();
-	if (GetConsoleScreenBufferInfo(hConOut,&csbi))
-	{
-	    int ccnt;
-	    COORD newcoord;
-	    
-	    newcoord.X = 0;
-	    newcoord.Y = 0;
-	    FillConsoleOutputAttribute(hConOut,
-	    		FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
-	    		csbi.dwSize.X * csbi.dwSize.Y,
-	    		newcoord, &ccnt);
-	    FillConsoleOutputCharacter(hConOut,' ',
-			csbi.dwSize.X * csbi.dwSize.Y,
-			newcoord, &ccnt);
-	}
-}
-
-void
 nocmov(x, y)
 int x,y;
 {
@@ -501,8 +517,13 @@
 xputc(c)
 char c;
 {
-	int count;
+	DWORD count;
 
+	if (colorchange) {
+		SetConsoleTextAttribute(hConOut,
+			(currentcolor | currenthilite | currentbackground));
+		colorchange = FALSE;
+	}
 	WriteConsole(hConOut,&c,1,&count,0);
 }
 
@@ -510,34 +531,76 @@
 xputs(s)
 const char *s;
 {
-	int count;
-	
+	DWORD count;
+	if (colorchange) {
+		SetConsoleTextAttribute(hConOut,
+			(currentcolor | currenthilite | currentbackground));
+		colorchange = FALSE;
+	}
 	WriteConsole(hConOut,s,strlen(s),&count,0);
 }
 
+/*
+ * Overrides winntty.c function of the same name
+ * for win32. It is used for glyphs only, not text.
+ */
+void
+g_putch(in_ch)
+int in_ch;
+{
+    char ch = (char)in_ch;
+    DWORD count = 1;
+    int tcolor;
+    int bckgnd = currentbackground;
+
+    if (colorchange) {
+	tcolor = currentcolor | bckgnd | currenthilite;
+	SetConsoleTextAttribute(hConOut, tcolor);
+    }
+    WriteConsole(hConOut,&ch,1,&count,0);
+    colorchange = TRUE;		/* force next output back to current nethack values */
+    return;
+}
+
 void
 cl_end()
 {
-		int count;
+		DWORD count;
 
 		ntcoord.X = ttyDisplay->curx;
 		ntcoord.Y = ttyDisplay->cury;
+	    	FillConsoleOutputAttribute(hConOut, DEFTEXTCOLOR,
+	    		CO - ntcoord.X,ntcoord, &count);
+		ntcoord.X = ttyDisplay->curx;
+		ntcoord.Y = ttyDisplay->cury;
 		FillConsoleOutputCharacter(hConOut,' ',
 			CO - ntcoord.X,ntcoord,&count);
 		tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
 						(int)ttyDisplay->cury);
+		colorchange = TRUE;
 }
 
 
 void
 clear_screen()
 {
-	int count;
-
-	ntcoord.X = 0;
-	ntcoord.Y = 0;
-	FillConsoleOutputCharacter(hConOut,' ',CO * LI,
-		ntcoord, &count);
+	if (GetConsoleScreenBufferInfo(hConOut,&csbi)) {
+	    DWORD ccnt;
+	    COORD newcoord;
+	    
+	    newcoord.X = 0;
+	    newcoord.Y = 0;
+	    FillConsoleOutputAttribute(hConOut,
+	    		FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
+	    		csbi.dwSize.X * csbi.dwSize.Y,
+	    		newcoord, &ccnt);
+	    newcoord.X = 0;
+	    newcoord.Y = 0;
+	    FillConsoleOutputCharacter(hConOut,' ',
+			csbi.dwSize.X * csbi.dwSize.Y,
+			newcoord, &ccnt);
+	}
+	colorchange = TRUE;
 	home();
 }
 
@@ -559,7 +622,13 @@
 	if (csbi.dwCursorPosition.X > 0)
 		ntcoord.X = csbi.dwCursorPosition.X-1;
 	ntcoord.Y = csbi.dwCursorPosition.Y;
-	SetConsoleCursorPosition(hConOut,ntcoord);	
+	SetConsoleCursorPosition(hConOut,ntcoord);
+	/* colorchange shouldn't ever happen here but.. */
+	if (colorchange) {
+		SetConsoleTextAttribute(hConOut,
+				(currentcolor|currenthilite|currentbackground));
+		colorchange = FALSE;
+	}
 	WriteConsole(hConOut," ",1,&count,0);
 	SetConsoleCursorPosition(hConOut,ntcoord);	
 }
@@ -571,30 +640,51 @@
 	Beep(8000,500);
 }
 
+volatile int junk;	/* prevent optimizer from eliminating loop below */
 
 void
 tty_delay_output()
 {
 	/* delay 50 ms - uses ANSI C clock() function now */
 	clock_t goal;
+	int k;
 
 	goal = 50 + clock();
 	while (goal > clock()) {
-	    /* Do nothing */
+	    k = junk;  /* Do nothing */
 	}
 }
 
 void
 cl_eos()
 {
-
-		register int cy = ttyDisplay->cury+1;
+	    register int cy = ttyDisplay->cury+1;		
+#if 0
 		while(cy <= LI-2) {
 			cl_end();
 			xputc('\n');
 			cy++;
 		}
 		cl_end();
+#else
+	if (GetConsoleScreenBufferInfo(hConOut,&csbi)) {
+	    int ccnt;
+	    COORD newcoord;
+	    
+	    newcoord.X = 0;
+	    newcoord.Y = ttyDisplay->cury;
+	    FillConsoleOutputAttribute(hConOut,
+	    		FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
+	    		csbi.dwSize.X * csbi.dwSize.Y - cy,
+	    		newcoord, &ccnt);
+	    newcoord.X = 0;
+	    newcoord.Y = ttyDisplay->cury;
+	    FillConsoleOutputCharacter(hConOut,' ',
+			csbi.dwSize.X * csbi.dwSize.Y - cy,
+			newcoord, &ccnt);
+	}
+	colorchange = TRUE;
+#endif
 		tty_curs(BASE_WINDOW, (int)ttyDisplay->curx+1,
 						(int)ttyDisplay->cury);
 }
@@ -646,7 +736,6 @@
 	ttycolors[CLR_WHITE] = FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED|\
 						FOREGROUND_INTENSITY;
 }
-
 # endif /* TEXTCOLOR */
 
 int
@@ -655,17 +744,39 @@
 # ifdef TEXTCOLOR
     return 1;
 # else
-    return 0;
+    if (color == CLR_BLACK)
+    	return 1;
+    else if (color == CLR_WHITE)
+	return 1;
+    else
+	return 0;
 # endif 
 }
 
 void
 term_end_attr(int attr)
 {
-	/* Mix all three colors for white on NT console */
-	SetConsoleTextAttribute(hConOut,
-		FOREGROUND_RED|FOREGROUND_BLUE|
-		FOREGROUND_GREEN);    
+    switch(attr){
+
+        case ATR_ULINE:
+        case ATR_BOLD:
+        case ATR_BLINK:
+		standoutend();
+                break;
+        case ATR_INVERSE:
+		if (currentcolor == 0)
+			currentcolor = FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED;
+		currentbackground = 0; 
+		colorchange = TRUE;
+		break;
+        default:
+		standoutend();
+		if (currentcolor == 0)
+			currentcolor = FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED;
+		currentbackground = 0;
+		currenthilite = 0;
+                break;
+    }                
 }
 
 void
@@ -675,15 +786,19 @@
 
         case ATR_ULINE:
         case ATR_BOLD:
-    	        /* Mix all three colors for white on NT console */
-	        SetConsoleTextAttribute(hConOut,
-		    FOREGROUND_RED|FOREGROUND_BLUE|
-		    FOREGROUND_GREEN|FOREGROUND_INTENSITY );
-                break;
         case ATR_BLINK:
+		standoutbeg();
+                break;
         case ATR_INVERSE:
+		/* Suggestion by Lee Berger */
+		if ((currentcolor & (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) ==
+			(FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED))
+			currentcolor = 0;
+		currentbackground = (BACKGROUND_RED|BACKGROUND_BLUE|BACKGROUND_GREEN);
+		colorchange = TRUE;
+		break;
         default:
-                term_end_attr(0);
+		standoutend();
                 break;
     }                
 }
@@ -704,11 +819,9 @@
 term_start_color(int color)
 {
 # ifdef TEXTCOLOR
-	WORD attr;
-
         if (color >= 0 && color < CLR_MAX) {
-            attr = (WORD)ttycolors[color];
-	    SetConsoleTextAttribute(hConOut,attr);
+	    currentcolor = ttycolors[color];
+	    colorchange = TRUE;
 	}
 # endif
 }
@@ -717,30 +830,25 @@
 term_end_color(void)
 {
 # ifdef TEXTCOLOR
-	SetConsoleTextAttribute(hConOut,
-		FOREGROUND_RED|FOREGROUND_BLUE|
-		FOREGROUND_GREEN);
-# endif       
+	currentcolor = DEFTEXTCOLOR;
+	colorchange = TRUE;
+# endif
 }
 
 
 void
 standoutbeg()
 {
-	/* Mix all three colors for white on NT console */
-	SetConsoleTextAttribute(hConOut,
-		FOREGROUND_RED|FOREGROUND_BLUE|
-		FOREGROUND_GREEN|FOREGROUND_INTENSITY );
+	currenthilite = FOREGROUND_INTENSITY;
+	colorchange = TRUE;
 }
 
 
 void
 standoutend()
 {
-	/* Mix all three colors for white on NT console */
-	SetConsoleTextAttribute(hConOut,
-		FOREGROUND_RED|FOREGROUND_BLUE|
-		FOREGROUND_GREEN);
+	currenthilite = 0;
+	colorchange = TRUE;
 }
 
 #endif /* WIN32CON */
diff -Naurd ../nethack-3.3.1/sys/winnt/porthelp ./sys/winnt/porthelp
--- ../nethack-3.3.1/sys/winnt/porthelp Thu Jan 1 01:00:00 1970
+++ ./sys/winnt/porthelp Fri Mar 22 14:40:55 2002
@@ -0,0 +1,300 @@
+        Microsoft Windows specific help file for NetHack 3.4.0
+        Copyright (c) NetHack PC Development Team 1993-2002.
+        NetHack may be freely distributed.  See license for details.
+                   (Last Revision: March 16, 2002)
+
+This file details specifics for NetHack built for Windows 95, 98, NT, 
+Me, 2000, and XP. Users of really early 16-bit Windows versions should 
+use the MSDOS NetHack. 
+
+Please note that "NetHack for Windows - Graphical Interface" requires 
+an installation of Internet Explorer 4 or an installation of 
+version 4.71 of the common controls. See the following internet page: 
+    http://www.nethack.org/v340/ports/download-win.html#cc
+for more information. If the game runs for you, you are not affected.
+
+New players should be sure to read GuideBook.txt which contains 
+essential information about playing NetHack. It can be found in the
+same directory as your NetHack executable.
+
+The NetHack for Windows port supports some additional or enhanced 
+commands as well as some defaults.nh file options specific to 
+configuration choices used during the building of NetHack for 
+Windows. Listed below are those commands and defaults.nh file 
+options. 
+
+Some options are applicable only to the "Graphical Interface." 
+These are discussed separately in their own section. 
+
+Contents
+1. ALT Key Combinations
+2. Boolean options - Option that you can toggle on or off
+3. Graphical Interface - Options you can assign a value to
+4. Graphical Interface - Additional/Enhanced Commands
+5. Graphical Interface - Menus
+6. Numeric Keypad (for number_pad mode)
+
+
+1. ALT Key Combinations
+----------------------------------------------
+The non-graphical (tty) interface always operates in "NetHack mode",
+while the "NetHack for Windows - Graphical Interface" lets you
+toggle the mode.  In non-NetHack mode, all ALT-key combinations
+are sent to the Windows itself, rather than to NetHack.
+
+While playing in NetHack mode you can press the ALT key in 
+combination with another key to execute an extended command
+as an alternative method to pressing a # key sequence.
+The available commands are:
+
+    Alt-2    #twoweapon      - toggle two-weapon combat (unavailable
+                               if number_pad mode is set)
+    Alt-a    #adjust         - adjust inventory letters.
+    Alt-c    #chat           - talk to someone or something.
+    Alt-d    #dip            - dip an object into something.
+    Alt-e    #enhance        - enhance your skill with a weapon.
+    Alt-f    #force          - force a lock.
+    Alt-i    #invoke         - invoke an object's powers.
+    Alt-j    #jump           - jump to a location.
+    Alt-l    #loot           - loot a box on the floor.
+    Alt-m    #monster        - use a monster's special ability. 
+    Alt-n    #name           - name an item or type of object.
+    Alt-o    #offer          - offer a sacrifice to the gods.
+    Alt-p    #pray           - pray to the gods for help.
+    Alt-q    #quit           - quit the game. (Same as #quit)
+    Alt-r    #rub            - rub a lamp.
+    Alt-s    #sit            - sit down.
+    Alt-t    #turn           - turn undead.
+    Alt-u    #untrap         - untrap something.
+    Alt-v    #version        - list compile time options for this version of
+                               NetHack.
+    Alt-w    #wipe           - wipe off your face.
+    Alt-?    #?              - display list of extended menu commands
+
+2. Boolean Options (Options that can be toggled on or off)
+----------------------------------------------------------
+
+Listed here are any options not discussed in the main help, options 
+which may be slightly different from the main help file, and options 
+which may need a slightly more explanatory note: 
+
+    color          Use color when displaying non-tiled maps. Tiled 
+                   maps (available in the graphical port) are always 
+                   rendered in color. Default: [TRUE]
+
+    hilite_pet     Using tiled graphics, displays a small heart symbol
+                   next to your pet.  Using ascii graphics, the pet is
+                   hilited in a white background.
+                   Default: [TRUE]
+
+    IBMgraphics    Use IBM extended characters for the dungeon 
+                   Default: [TRUE] 
+ 
+    msg_window     When ^P is pressed, it shows menu in a full window.
+                   Available only in the non-graphical (tty) version.
+                   Default: [FALSE] 
+
+    toptenwin      Write top ten list to a window, as opposed to stdout.
+                   Default in tty interface: [FALSE]
+		   Default in graphical interface: [TRUE] (and cannot be changed)
+
+3. Options that you assign a value to (Graphical Interface only)
+----------------------------------------------------------------
+
+"NetHack for Windows - Graphical Interface" recognizes the following 
+additional options, which the non-graphical (tty) version will
+silently ignore.  These are options that specify attributes of various
+windows.  The windows that you can tailor include menu windows (such 
+as the inventory list), text windows (such as "It is written in the 
+book of ..." screens), the message window (where events of the game are
+displayed), the status window (where your character name
+and attributes are displayed), and the map window (where the map
+is drawn).
+
+Window Alignment options:
+
+    align_message  Specifies at which side of the NetHack screen the 
+                   message window is aligned. This option can be used 
+                   to align the window to "top" or "bottom".
+                   Default: [TOP] 
+
+    align_status   Specifies at which side of the NetHack screen the 
+                   status window is aligned. This option can be used
+                   to align the window to "top" or "bottom".
+                   Default: [BOTTOM] 
+
+Map Window options:
+
+    map_mode       Specifies which map mode to use. 
+                   The following map modes are available: 
+                   tiles (display things on the map with colored tiles), 
+                   ascii4x6, ascii6x8, ascii8x8, ascii16x8, ascii7x12,
+                   ascii8x12, ascii16x12, ascii12x16, ascii10x18
+                   (which use that size font to display things on 
+                   the map), or fit_to_screen (an ascii mode which
+                   forces things to fit on a single screen).
+                   Default: [tiles]
+
+    scroll_margin  Specifies the number of map cells from the edge
+                   of the map window where scrolling will take place.
+                   Default: [5] 
+
+    tile_file      An alternative file containing bitmap to use for 
+                   tiles. This file should be a .bmp file and should 
+                   be organized as 40 rectangular tiles wide. It is 
+                   beyond the scope of this document to describe the 
+                   exact contents of each tile in the .bmp, which must
+                   match the object lists used when building NetHack.
+
+    tile_height    Used with tile_file to specify the height of each 
+                   tile in pixels. This option may only be specified
+                   in the defaults.nh config file.
+                   Default: [16] 
+
+    tile_width     Used with tile_file to specify the width of each 
+                   tile in pixels. This option may only be specified
+                   in the defaults.nh config file. 
+                   Default: [16]
+
+Other Window options:
+
+    windowcolors   Specifies the colors for various windows
+                   This option may only be specified in the
+                   defaults.nh config file and has the following
+                   format:
+                       window-type foreground/background
+                   Notes:
+                      - Both foreground and background colors are
+                        required, and a slash must separate them.
+                      - "window-type" is either "message" or "status"
+                        (Short forms are: "msg" or "sts").
+                      - "foreground" and "background" may be specified as
+                        a color name (such as "blue"), or by a six
+                        digit hexadecimal RGB color value (such as
+                        "#8F8F8F")
+                      - The following color names are available:
+                        black, red, green, brown, blue, magenta,
+                        cyan, gray (or grey), orange, brightgreen,
+                        yellow, brightblue, brightmagenta, brightcyan,
+                        white, trueblack, purple, silver, maroon, fuchsia,
+                        lime, olive, navy, teal, aqua. In addition, you 
+                        can use the following names to refer to default 
+                        Windows settings: activeborder, activecaption, 
+                        appworkspace, background, btnface, btnshadow, btntext, 
+                        captiontext, graytext, highlight, highlighttext, 
+                        inactiveborder, inactivecaption, menu, menutext, 
+                        scrollbar, window, windowframe, windowtext.
+
+                        Example:
+                        OPTIONS=windowcolors:sts #00FF80/blue msg menutext/menu
+
+    font_menu      Specifies the name of the menu font.
+    font_message   Specifies the name of the message font.
+    font_status    Specifies the name of the status font.
+    font_text      Specifies the name of the text font.
+
+    font_size_menu Specifies the size of the menu font.
+
+    font_size_message
+                   Specifies the size of the message font.
+
+    font_size_status
+                   Specifies the size of the status font.
+
+    font_size_text Specifies the size of the text font.
+
+Miscellaneous options: 
+
+    vary_msgcount  Number of lines to display in message window. 
+
+
+4. NetHack for Windows - Graphical Interface, Additional/Enhanced Commands
+-------------------------------------------------------------------------
+
+The following function keys are active in
+the "NetHack for Windows - Graphical Interface": 
+
+    F4             Toggle level overview mode on/off 
+                   This key will toggle the map between a view that 
+                   is mapped to fit exactly to the window, and the 
+                   view that shows the various symbols in their 
+                   normal size. This is useful for getting an idea 
+                   of where you are in a level. 
+
+    F5             Toggle tiled display on/off. 
+                   This key switches between the tiled and the 
+                   traditional ASCII display. This is equivalent to 
+                   using the "map_mode" option. 
+
+    F10            Activate menu bar. 
+                   This key will activate the menu bar, allowing you 
+                   to select between the menus: File, Map, 
+                   Window Settings, and Help. 
+
+5. Graphical Port Menus
+-----------------------
+
+File
+  Save - Allows you to save and exit the game
+  Quit - Allows you to quit the game
+
+Map - Provides for selection of map mode. Equivalent to using 
+the map_mode option. 
+
+Window Settings - Changes your logged-on user's settings for NetHack.
+In 3.4.0, only one setting is available: NetHack mode, which can be
+checked or unchecked. NetHack mode allows you to use the ALT key for
+game key commands [see list above]. You can use F10 to access the
+menu bar while in NetHack mode. You can also clear your logged-on
+user's settings for NetHack. Settings in this window are saved in
+your logged-on user's registry. 
+
+Help - Provides help about various portions of NetHack.
+
+
+6. Numeric Keypad (for "OPTION=number_pad" mode)
+------------------------------------------------
+
+The numeric keypad and surrounding characters act as macros for different
+commands in NetHack.  The Num Lock should be toggled to "on" to make the
+most of these keys:
+
+          Key         Normal       Shift-Key
+       ----------   ----------    -------------
+       1, 2, 3, 4   Move In       Run In
+       6, 7, 8, 9   Direction     Direction
+
+        0 (Ins)     Inventory     Categorized
+                                  Inventory
+
+        . (Del)     Wait Turn     : - Look Here
+
+        +           Spell List    P - Put on an
+                                  accessory
+
+        -           m - Move      Previous
+                    Only          Message
+
+    NetHack for Windows - tty Interface Specific Behavior:
+    ------------------------------------------------------
+
+      In the non-graphical (tty) interface, when you use the Ctrl key with a
+      directional key (1, 2, 3, 4, 6, 7, 8, 9) it means "go in specified
+      direction until you hit a wall or run into something interesting."
+
+    NetHack for Windows - Graphical Interface Specific Behavior:
+    ------------------------------------------------------------
+
+      It is possible to scroll or pan the map in a specific direction:
+
+        Ctrl-Shift-Left  (4)     Scroll (Pan) map left
+        Ctrl-Shift-Right (6)     Scroll (Pan) map right
+        Ctrl-Shift-Up    (8)     Scroll (Pan) map up
+        Ctrl-Shift-Down  (2)     Scroll (Pan) map down
+        Ctrl-Shift-Home  (7)     Scroll (Pan) map left to leftmost corner
+        Ctrl-Shift-End   (1)     Scroll (Pan) map left to rightmost corner
+        Ctrl-Shift-PgUp  (9)     Scroll (Pan) map left to uppermost corner
+        Ctrl-Shift-PgDn  (3)     Scroll (Pan) map left to lowermost corner
+
+
+
diff -Naurd ../nethack-3.3.1/sys/winnt/win32api.h ./sys/winnt/win32api.h
--- ../nethack-3.3.1/sys/winnt/win32api.h Thu Oct 21 22:32:19 1999
+++ ./sys/winnt/win32api.h Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*	SCCS Id: @(#)win32api.h	 3.3	 96/02/15		  */
+/*	SCCS Id: @(#)win32api.h	 3.4	 1996/02/15		  */
 /* Copyright (c) NetHack PC Development Team 1996                 */
 /* NetHack may be freely redistributed.  See license for details. */
 
diff -Naurd ../nethack-3.3.1/sys/winnt/winnt.c ./sys/winnt/winnt.c
--- ../nethack-3.3.1/sys/winnt/winnt.c Sun Jan 30 19:19:00 2000
+++ ./sys/winnt/winnt.c Fri Mar 22 14:40:55 2002
@@ -1,4 +1,4 @@
-/*	SCCS Id: @(#)winnt.c	 3.3	 97/04/12		  */
+/*	SCCS Id: @(#)winnt.c	 3.4	 1997/04/12		  */
 /* Copyright (c) NetHack PC Development Team 1993, 1994 */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -12,7 +12,9 @@
 #define NEED_VARARGS
 #include "hack.h"
 #include <dos.h>
+#ifndef __BORLANDC__
 #include <direct.h>
+#endif
 #include <ctype.h>
 #include "win32api.h"
 
@@ -159,7 +161,7 @@
 nt_regularize(s)	/* normalize file name */
 register char *s;
 {
-	register char *lp;
+	register unsigned char *lp;
 
 	for (lp = s; *lp; lp++)
 	    if ( *lp == '?' || *lp == '"' || *lp == '\\' ||
@@ -174,11 +176,10 @@
 char *get_username(lan_username_size)
 int *lan_username_size;
 {
-	static char username_buffer[BUFSZ];
+	static TCHAR username_buffer[BUFSZ];
 	unsigned int status;
-	int i = 0;
+	DWORD i = BUFSZ - 1;
 
-	i = BUFSZ - 1;
 	/* i gets updated with actual size */
 	status = GetUserName(username_buffer, &i);		
 	if (status) username_buffer[i] = '\0';
diff -Naurd ../nethack-3.3.1/sys/winnt/winnt.cnf ./sys/winnt/winnt.cnf
--- ../nethack-3.3.1/sys/winnt/winnt.cnf Wed Aug 9 19:33:59 2000
+++ ./sys/winnt/winnt.cnf Thu Jan 1 01:00:00 1970
@@ -1,106 +0,0 @@
-# Sample config file for win32 NetHack
-# A '#' at the beginning of a line means the rest of the line is a comment.
-#
-# Some options MUST be set in this file, other options can be toggled while
-# playing.  For a list of options available see the <opthelp.> file.
-#
-# To change the configuration, comment out the unwanted lines, and
-# uncomment the configuration you want.
-
-# Use the IBM character set rather than just plain ascii characters.
-OPTIONS=IBMGraphics
-
-# *** OPTIONS ***
-# Some options to set personal preferences.  Uncomment and change these to
-# suit your personal preference.  If several people are to use the same
-# configuration, options like these should not be set.
-#
-#OPTIONS=name:Janet,role:Valkyrie,race:Human,gender:female,align:lawful
-#OPTIONS=dogname:Fido,catname:Morris,fruit:guava
-#OPTIONS=horsename:Silver
-#OPTIONS=autopickup,pickup_types:$"=/!?+
-#OPTIONS=packorder:")[%?+/=!(*0_`
-#OPTIONS=scores:10 top/2 around/own
-#OPTIONS=nolegacy,noverbose
-#OPTIONS=menustyle:traditional
-
-#
-# General options.  You might also set "silent" so as not to attract
-# the boss's attention.
-#
-OPTIONS=time,noshowexp,number_pad,lit_corridor,rest_on_space
-#
-# If you want to get rid of "use #quit to quit..." use:
-#OPTIONS=suppress_alert:3.3.1
-#
-
-#
-#HACKDIR=c:\games\nethack
-# 
-# Note: Under MSDOS ports HACKDIR defaults to the location 
-#       of the NetHack.exe file. Setting HACKDIR above will override that.
-#
-#   LEVELS and SAVE default to HACKDIR
-#
-#LEVELS=c:\games\nethack\bones
-#SAVE=c:\games\nethack\bones
-
-# *** CHARACTER GRAPHICS ***
-#
-# See the on-line help or the Guidebook for which symbols are in which
-# positions.
-#
-# If you merely set the IBMgraphics option as above, NetHack will use IBM
-# extended ASCII for dungeon characters.  If you don't like the selections,
-# you can make up your own via these graphics options, but you should still
-# set IBMgraphics if you are using IBM graphics characters to get the correct
-# processing.
-#
-# ================================================
-# An example using the IBM graphics character set:
-#DUNGEON=  032 179 196 218 191 192 217 197 193 194 \
-#	   180 195 249 239 239 254 254 240 241 249 \
-#	   177 177 060 062 060 062 220 124 190 035 \
-#	   244 247 249 247 042 042 186 205 046 035 \
-#	   247
-#
-#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
-#	   094 094 094 094 232 232 232 157 094 094 \
-#	   094 094
-#
-#EFFECTS=  179 196 092 047 042 033 041 040	   \
-#	   048 035 064 042			   \
-#	   047 045 092 058 058 092 045 047	   \
-#	   047 045 092 058 032 058 092 045 047
-#
-# ================================================
-# Some alternatives:
-#DUNGEON=  032 186 205 201 187 200 188 206 202 203 \
-#	   185 204 249 239 239 254 254 240 241 249 \
-#	   177 177 060 062 060 062 095 124 092 035 \
-#	   244 247 249 247 042 042 179 196 046 035 \
-#	   247
-#
-#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
-#	   094 094 094 094 094 034 094 094 094 094 \
-#	   094 094
-
-# ================================================
-# Here is a recommendation sent in by Michael Feir
-# for use by blind NetHack players.
-#
-#DUNGEON=  032 124 045 124 124 124 124 045 045 045 \
-#          124 124 046 045 124 043 043 046 035 035 \
-#          060 062 060 062 095 092 035 126 126 126 \
-#          126 042 042 035 035 032 035 126
-#
-#TRAPS=    094 094 094 094 094 094 094 094 094 094 \
-#          094 094 094 094 094 094 094 094 094 094 \
-#          094 094
-#
-#EFFECTS=  124 095 092 047 042 033 041 040         \
-#          048 035 064 042                         \
-#          047 045 092 058 058 092 045 047         \
-#          047 045 092 058 032 058 092 045 047
-
-

