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/.
+ http://www.borland.com/bcppbuilder/freecompiler/
- OR
+ OR
o A copy of MinGW 2.0. MinGW is a collection of header files and import
libraries with which native Windows32 programs can be made; the
MinGW 2.0 distribution contains the GNU Compiler Collection.
You can download MinGW at
- http://www.mingw.org/
+ http://www.mingw.org/
Earlier versions of MinGW will not allow you to build the Windows
Graphical version.
FIRST STEP
The first step in building either version of NetHack is to execute
-sys/winnt/nhsetup.bat.
+sys\winnt\nhsetup.bat.
From the command prompt:
cd sys\winnt
to build both; they will be able to use the same datafiles, save files
and bones files.
-I. Dispelling the Myths:
+I. Dispelling the Myths:
Compiling NetHack for Win32 is not as easy as it sounds, nor as hard
as it looks, however it will behoove you to read this entire section
make /f Makefile.bcc install
For GCC:
- make -f Makefile.gcc install
+ mingw32-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
make /f Makefile.bcc
For GCC:
- make -f Makefile.gcc
+ mingw32-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.
Only the Win32 native port built on the Windows API, or Graphical
NetHack, can be built using the Visual C IDE.
-I. Dispelling the Myths:
+I. Dispelling the Myths:
Compiling NetHack using the Visual C IDE is straightforward, as long
as you have your compiler and tools correctly installed.
functionality and is the officially released build.
Start the Visual C IDE. In the Visual C IDE menus, choose:
- File | Open Workspace
+ File | Open Workspace
4. Set up for the build.
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
+
+ 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
On the Visual C menus, choose:
Project | Set Active Project | NetHackW
On the Visual C menus again, choose either:
Build | Set Active Configuration | NetHackW - Win32 Release
- or
+ or
Build | Set Active Configuration | NetHackW - Win32 Debug
The first will create the Release build of NetHackW which does not
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.
+ for Windows, choose the Release build.
Building
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.
+ This starts the build. It is likely that the IDE message window
+ where you are doing the compiling will be occupied for a while.
6. If all has gone well to this point, you should now have a NetHack
executable called NetHackW.exe in the "binary" directory, along with
# 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.
+# This is used for building two versions of NetHack:
+# A tty port utilizing the Win32 Console I/O subsystem, Console
+# NetHack;
+# A Win32 native port built on the Windows API, Graphical NetHack or
+# NetHackW.
#
# 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)
+# 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
+# Yitzhak Sapir
#==============================================================================
# Do not delete the following 3 lines.
#
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
#
TILEUTIL32 = $(UTIL)\til2bm32.exe
TILEBMP32 = $(SRC)\tiles32.bmp
-# These should be left commented in 3.4.x
-#
-
-#SOUND = $(OBJ)\ntsound.o
+SOUND = $(OBJ)\ntsound.o
#SOUND =
# To store all the level files,
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
# NetHack 3.4.x Makefile for MinGW
#
# Win32 Compilers Tested:
-# - gcc version 2.95.3-6
+# - MinGW 1.0 (gcc version 2.95.3-6) (Console NetHack only)
+# - MinGW 2.0 (gcc version 3.2)
#
# 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.
+# This is used for building two versions of NetHack:
+# A tty port utilizing the Win32 Console I/O subsystem, Console
+# NetHack;
+# A Win32 native port built on the Windows API, Graphical NetHack or
+# NetHackW.
#
# 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)
+# 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
# Dion Nicolaas
#==============================================================================
# Graphical interface
-# Don't uncomment this line for 3.4.1
# Set to Y for a graphical version
# Set to anything else (or undefine) for a tty version
-GRAPHICAL = N
+#GRAPHICAL = Y
# Debug
# Set to Y for Debug support (to produce debug information)
$(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)winres.o
WINPINC = -I$(WIN32)
$(WIN32)/mhmenu.h $(WIN32)/mhmsg.h $(WIN32)/mhmsgwnd.h \
$(WIN32)/mhrip.h $(WIN32)/mhstatus.h \
$(WIN32)/mhtext.h $(WIN32)/resource.h $(WIN32)/winMS.h
-WINPLIBS = -lcomctl32
+WINPLIBS = -lcomctl32 -lwinmm
else
WINPORT = $(O)nttty.o
WINPFLAG= -DWIN32CON
WINPHDR =
NHRES = $(O)console.o
WINPINC =
-WINPLIBS =
+WINPLIBS = -lwinmm
endif
TILEUTIL16 = $(UTIL)/tile2bmp.exe
TILEUTIL32 = $(UTIL)/til2bm32.exe
TILEBMP32 = $(SRC)/tiles32.bmp
-# These should be left commented in 3.4.x
-#
+SOUND = $(OBJ)/ntsound.o
-#SOUND = $(OBJ)/ntsound.o
#SOUND =
# To store all the level files,
# - 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.
+# This is used for building two versions of NetHack:
+# A tty port utilizing the Win32 Console I/O subsystem, Console
+# NetHack;
+# A Win32 native port built on the Windows API, Graphical NetHack or
+# NetHackW.
#
# In addition to your C compiler,
#
#GRAPHICAL = Y
-#
# Set the gamedir according to your preference.
# If not present prior to compilation it gets created.
!IF "$(GRAPHICAL)" == "Y"
-GAME = NetHack # Game Name
-!ELSE
GAME = NetHackW # Game Name
+!ELSE
+GAME = NetHack # Game Name
!ENDIF
GAMEDIR = ..\binary # Game directory
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.