Merge remote-tracking branch 'origin/NetHack-3.6.0'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Copyright (c) NetHack Development Team 1990-2015
|
||||
Copyright (c) NetHack Development Team 1990-2017
|
||||
NetHack may be freely redistributed. See license for details.
|
||||
==============================================================
|
||||
Instructions for compiling and installing
|
||||
@@ -14,28 +14,19 @@ 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, David Cohrs,
|
||||
Alex Kompel, Dion Nicolaas, Yitzhak Sapir, and Janet Walz maintained the
|
||||
tty and graphical win32 versions of NetHack 3.6.1.
|
||||
Alex Kompel, Dion Nicolaas, Yitzhak Sapir, Derek S. Ray, Michael Allison,
|
||||
Pasi Kallinen, Bart House, and Janet Walz contributed to the maintainance
|
||||
of the tty and graphical windows versions of NetHack 3.6.1.
|
||||
|
||||
You can build a TTY version of NetHack and a Windows Graphical
|
||||
version. You can use one of the following build environments:
|
||||
|
||||
o A copy of Microsoft Visual Studio 2017 Express
|
||||
o A copy of Microsoft Visual Studio 2017 Community Edition
|
||||
OR Microsoft Visual Studio 2015 Express
|
||||
|
||||
OR
|
||||
|
||||
o A copy of Microsoft Visual Studio 2015 Express
|
||||
|
||||
OR
|
||||
|
||||
o A copy of Microsoft Visual Studio 2013 Express
|
||||
The current NetHack code has not been tested with earlier versions
|
||||
of the compiler.
|
||||
|
||||
OR
|
||||
|
||||
o A copy of MinGW. MinGW is a collection of header
|
||||
o (Untested for 3.6) A copy of MinGW. MinGW is a collection of header
|
||||
files and import libraries with which native Windows32 programs
|
||||
can be built; the MinGW distribution contains the GNU Compiler
|
||||
Collection. You can download MinGW at
|
||||
@@ -43,24 +34,18 @@ version. You can use one of the following build environments:
|
||||
Earlier versions of MinGW will not allow you to build the Windows
|
||||
Graphical version.
|
||||
|
||||
|
||||
In addition to the makefiles that allow you to build NetHack from the
|
||||
command line, there is also a set of project files and a workspace file
|
||||
that allow you to build the Windows Graphical version from Microsoft
|
||||
Visual C's IDE (Integrated Development Environment.)
|
||||
|
||||
/--------------------------------------------------------\
|
||||
| Building And Running Using Visual Studio 2015 or |
|
||||
| Visual Studio 2017 |
|
||||
\--------------------------------------------------------/
|
||||
|
||||
If you are NOT using Visual Studio 2015 or Visual Studio 2017, proceed
|
||||
to "FIRST STEP - MOVING THINGS AROUND".
|
||||
If you are NOT using Visual Studio 2015 or Visual Studio 2017 IDE, or
|
||||
you prefer to build using a Make utility and a Makefile proceed
|
||||
to "Building Using Make".
|
||||
|
||||
When using either Visual Studio 2015 or Visual Studio 2017, you do not
|
||||
need to move things around. You simply need to load the solution file
|
||||
within the IDE, build the solution and run the version of NetHack
|
||||
you wish to run.
|
||||
When using either Visual Studio 2015 or Visual Studio 2017, you simply
|
||||
need to load the solution file within the IDE, build the solution and
|
||||
run the version of NetHack you wish to run.
|
||||
|
||||
The Visual Studio 2015 NetHack solution file can be found here:
|
||||
win\win32\vs2015\NetHack.sln
|
||||
@@ -78,15 +63,23 @@ So the steps are:
|
||||
You can also build all the projects for all platforms and configurations
|
||||
using a "build.bat" batch file found in the same directory as the solution.
|
||||
|
||||
Change to the appropriate directory (i.e. win\win32\vs2015 for VS2015 builds)
|
||||
and run "build.bat".
|
||||
Change to the appropriate directory (i.e. win\win32\vs2015 for VS2015 builds,
|
||||
win\win32\vs2017 for VS2017 builds) and run "build.bat".
|
||||
|
||||
Note: The Visual Studio project files distributed for NetHack 3.6.1 are configured for the
|
||||
Windows SDK version 10.0.15063.0. At the time of writing, the Windows SDK version that
|
||||
is distributed with VS2017 Community Edition is a newer 10.0.16299.0. If you have a build
|
||||
error MSB8036, you will simply need to change the expected SDK version as follows:
|
||||
|
||||
o Open the solution in the IDE and in the project property pages, right-click the
|
||||
solution and select "Retarget solution".
|
||||
|
||||
/-----------------------------------\
|
||||
| FIRST STEP - MOVING THINGS AROUND |
|
||||
| Building Using Make |
|
||||
\-----------------------------------/
|
||||
|
||||
The first step in building either version of NetHack is to execute
|
||||
sys\winnt\nhsetup.bat to move some files to their required locations.
|
||||
The first step in building either version of NetHack via Makefile is to
|
||||
execute sys\winnt\nhsetup.bat to move some files to their required locations.
|
||||
|
||||
From the command prompt:
|
||||
cd sys\winnt
|
||||
@@ -95,19 +88,9 @@ From the command prompt:
|
||||
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 from the command line, proceed to "BUILDING FROM
|
||||
THE COMMAND LINE."
|
||||
|
||||
If you wish to build using Visual C's IDE, proceed now to "BUILDING
|
||||
USING VISUAL C'S IDE."
|
||||
|
||||
/--------------------------------\
|
||||
| BUILDING FROM THE COMMAND LINE |
|
||||
\--------------------------------/
|
||||
@@ -143,10 +126,11 @@ I. Dispelling the Myths:
|
||||
|
||||
We have provided a Makefile for each of the following compilers:
|
||||
|
||||
o Microsoft Visual Studio 2013 Express Visual C++ Compiler
|
||||
o Microsoft Visual Studio 2015 or 2017 C++ Compiler
|
||||
The Community Editions are fine and available at no cost
|
||||
o MinGW 2.0 (with GCC 3.2)
|
||||
|
||||
The Microsoft Visual Studio 2013 Express Makefile was created for use
|
||||
The Microsoft Visual Studio 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
|
||||
compiler, but that has not been tested.
|
||||
@@ -168,67 +152,10 @@ Setting Up
|
||||
all the necessary environment variables for the compiler environment
|
||||
are set correctly.
|
||||
|
||||
Visual Studio 2013 Express
|
||||
|
||||
The installation should have placed a command prompt option on the
|
||||
Start menus that is properly configured for building:
|
||||
From
|
||||
Start | All Programs | Microsoft Visual Studio 2013 Express
|
||||
Select
|
||||
Visual Studio Command Prompt 2013
|
||||
|
||||
Anyway, once you are at a command prompt (cmd.exe) regardless of how you
|
||||
got there, you can use one of the following sets of commands to prepare
|
||||
your environment for building:
|
||||
|
||||
For a 32-bit x86 build (like the official binary):
|
||||
cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
|
||||
vcvarsall x86
|
||||
|
||||
For a 64-bit x64 build:
|
||||
cd "\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
|
||||
vcvarsall x86_amd64
|
||||
|
||||
-----------------------------------------------------------
|
||||
vcvarsall.bat | Compiler | Build-computer | Build output
|
||||
argument | | architecture | architecture
|
||||
--------------+------------+----------------+--------------
|
||||
X86 | x86 32-bit | x86, x64 | x86
|
||||
| native | |
|
||||
--------------+------------+----------------+--------------
|
||||
x86_amd64 | x64 on x86 | x86, x64 | x64
|
||||
| cross | |
|
||||
--------------+------------+----------------+--------------
|
||||
amd64 | x64 64-bit | x64 | x64
|
||||
| native | |
|
||||
--------------+------------+----------------+--------------
|
||||
amd64_x86 | x86 on | x64 | x86
|
||||
| x64 cross | |
|
||||
-----------------------------------------------------------
|
||||
|
||||
Change your current directory to the src subfolder of the nethack
|
||||
source tree.
|
||||
cd src
|
||||
|
||||
At this time, if you are determined to build an x64 version
|
||||
with the Microsoft Visual Studio 2013 compiler,
|
||||
one extra NetHack-specific step is needed. Edit the Makefile in the src
|
||||
directory and change this in the section marked as 1.:
|
||||
#
|
||||
# 64 bit
|
||||
#TARGET_CPU=x64
|
||||
#
|
||||
# 32 bit
|
||||
TARGET_CPU=x86
|
||||
to this:
|
||||
#
|
||||
# 64 bit
|
||||
TARGET_CPU=x64
|
||||
#
|
||||
# 32 bit
|
||||
#TARGET_CPU=x86
|
||||
|
||||
|
||||
GCC
|
||||
|
||||
For the GCC Makefile, add <mingw>\bin to your path, where <mingw>
|
||||
@@ -312,7 +239,7 @@ Compiling
|
||||
|
||||
5. Now that everything is set up...
|
||||
|
||||
For Visual Studio 2013 Express, as mentioned above, you should now be
|
||||
For the Visual Studio compiler, as mentioned above, you should now be
|
||||
at the command prompt to carry out the build and your current
|
||||
directory should be the src subdirectory in the NetHack source tree.
|
||||
|
||||
@@ -363,201 +290,8 @@ Notes:
|
||||
- a 64-bit (x64) .exe file,
|
||||
which should run on any 64-bit Windows O/S.
|
||||
|
||||
To run NetHack, proceed to RUNNING NETHACK.
|
||||
|
||||
/-------------------------------------------------\
|
||||
| BUILDING USING VISUAL STUDIO 2013 EXPRESS IDE |
|
||||
\-------------------------------------------------/
|
||||
|
||||
Only the native port built on the Windows API, or Graphical
|
||||
NetHack, can be built using the Visual Studo 2013 Express IDE.
|
||||
|
||||
I. Dispelling the Myths:
|
||||
|
||||
Compiling NetHack using the Visual C IDE is straightforward, as long
|
||||
as you have your compiler and tools correctly installed.
|
||||
|
||||
It is again 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 machine
|
||||
using the Visual Studio 2013 Express IDE:
|
||||
|
||||
Setting Up
|
||||
|
||||
1. It almost goes without saying that you should make sure that your
|
||||
tools are set up and running correctly. (For the Microsoft Visual
|
||||
Studio 2013 ExpressIDE it should correctly fire up when you choose
|
||||
it:
|
||||
Start | All Programs | Microsoft Visual Studio 2013 Express
|
||||
and select
|
||||
Visual C++ 2013 Express
|
||||
|
||||
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 building Graphical NetHack with the Visual
|
||||
C IDE:
|
||||
|
||||
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 C 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.
|
||||
Note: It's possible to build a graphical version using the Makefile,
|
||||
as explained above. However, the IDE build has full game
|
||||
functionality.
|
||||
|
||||
Start the Visual Studio 2013 Express IDE:
|
||||
Start | All Programs | Microsoft Visual Studio 2013 Express
|
||||
and select
|
||||
Visual C++ 2013 Express
|
||||
|
||||
In the Visual C++ 2013 Express IDE menus, choose:
|
||||
File | Open Project/Solution
|
||||
|
||||
|
||||
4. Set up for the build.
|
||||
|
||||
In the Visual C dialog box, navigate to the top of
|
||||
your NetHack source directory.
|
||||
|
||||
In there, highlight "nethack.sln" for Visual C++ 2013 Express Edition
|
||||
and click on Open.
|
||||
|
||||
Once the workspace or solution has been opened, you should see
|
||||
the following list in the Visual C selection left pane:
|
||||
+ dgncomp
|
||||
+ dgnstuff
|
||||
+ dlb_main
|
||||
+ levcomp
|
||||
+ levstuff
|
||||
+ makedefs
|
||||
+ nethackw
|
||||
+ recover
|
||||
+ tile2bmp
|
||||
+ tilemap
|
||||
+ uudecode
|
||||
|
||||
On the Visual C++ 2013 Express IDE menus, NetHackW should be the startup
|
||||
project in bold, but if it isn't make it so by right-clicking and
|
||||
choosing "set as Startup Project."
|
||||
|
||||
In Visual C 2013 Express IDE menus right-click on
|
||||
"Solution NetHack (14 Projects)" and select "Configuration Manager."
|
||||
|
||||
Set the "Active Solution Configuration" to either
|
||||
Debug
|
||||
or
|
||||
Release
|
||||
and click the "Close" button.
|
||||
|
||||
|
||||
The Release build of NetHackW which does not contain all the
|
||||
debugging information and is smaller, and runs slightly quicker.
|
||||
The Debug build of NetHackW will spend time writing debug information
|
||||
to the disk as the game is played. Unless you are debugging or
|
||||
enhancing NetHack for Windows, you probably will want to choose the
|
||||
Release build.
|
||||
|
||||
Building
|
||||
|
||||
5. Start your build.
|
||||
|
||||
On the Visual C++ Express IDE menus once again, choose:
|
||||
Debug | Build Solution
|
||||
or press <F7> to accomplish the same thing.
|
||||
|
||||
That 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
|
||||
all the support files that it needs.
|
||||
|
||||
|
||||
|
||||
/-----------------\
|
||||
| RUNNING NETHACK |
|
||||
\-----------------/
|
||||
|
||||
I. Checking the installation:
|
||||
Make sure all of the support files -- Guidebook.txt, license,
|
||||
Defaults.nh, NetHack.exe or NetHackW.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 or NetHackW.exe executable resides. You only need to
|
||||
set HACKDIR in defaults.nh if, for some reason, you wish to override
|
||||
that (be careful).
|
||||
|
||||
II. Executing the game
|
||||
|
||||
1. 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" or "nethackw"
|
||||
or "nethackw -umike" to start it up. Alternatively, you can
|
||||
explicitly invoke it with a command such as
|
||||
"c:\nethack\binary\nethack.exe" or "c:\nethack\binary\nethackw.exe"
|
||||
(specifying whatever drive and directory your NetHack executable
|
||||
resides in) each time.
|
||||
|
||||
2. Running from a Windows 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.6.1 Console version
|
||||
Command Line : C:\NETHACK\BINARY\NETHACK.EXE
|
||||
|
||||
Description : NetHack 3.6.1 Graphical Interface
|
||||
Command Line : C:\NETHACK\BINARY\NETHACKW.EXE
|
||||
|
||||
(changing the directory to the appropriate one of course)
|
||||
|
||||
III. Play NetHack. If it works, you're done!
|
||||
|
||||
NetHack.exe is the tty version. NetHackW.exe is the graphical version.
|
||||
Play NetHack.
|
||||
|
||||
PROBLEMS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# NetHack 3.6 Makefile.msc $NHDT-Date: 1451610993 2016/01/01 01:16:33 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.101 $ */
|
||||
# Copyright (c) NetHack PC Development Team 1993-2015
|
||||
# Copyright (c) NetHack PC Development Team 1993-2017
|
||||
#
|
||||
#==============================================================================
|
||||
# Build Tools Environment
|
||||
@@ -9,7 +9,7 @@
|
||||
# Visual Studio Compilers Tested:
|
||||
# - Microsoft Visual Studio 2010 Express, with the Platform SDK
|
||||
# - Microsoft Visual Studio 2013 Express
|
||||
# - Microsoft Visual Studio 2015 Express (pre-release)
|
||||
# - Microsoft Visual Studio 2017 Community Edition
|
||||
#
|
||||
#==============================================================================
|
||||
# This is used for building two versions of NetHack:
|
||||
@@ -35,7 +35,9 @@
|
||||
# is too old or untested.
|
||||
#
|
||||
|
||||
!IF "$(_NMAKE_VER)" == "14.00.22310.1"
|
||||
!IF "$(_NMAKE_VER)" == "14.11.25547.0"
|
||||
VSVER=2017
|
||||
!ELSEIF "$(_NMAKE_VER)" == "14.00.22310.1"
|
||||
VSVER=2015
|
||||
!ELSEIF "$(_NMAKE_VER)" == "12.00.21005.1"
|
||||
VSVER=2013
|
||||
@@ -68,11 +70,15 @@ VSVER=0000 #untested version
|
||||
# 32 bit
|
||||
TARGET_CPU=x86
|
||||
|
||||
!ELSE
|
||||
!IF ($(VSVER) == 0000)
|
||||
!ERROR Unsupported and untested version of Visual Studio
|
||||
!ELSE
|
||||
# For VS2010 use "setenv /x86" or "setenv /x64" before invoking make process
|
||||
# DO NOT DELETE THE FOLLOWING LINE
|
||||
!include <win32.mak>
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
#
|
||||
#---------------------------------------------------------------
|
||||
# 2. Where do you want the game to be built (which folder)?
|
||||
@@ -179,18 +185,18 @@ DLBFLG =
|
||||
TARGET_CPU=x86
|
||||
!ENDIF
|
||||
|
||||
!IF "$(_NMAKE_VER)" == "10.00.40219.01"
|
||||
CL2013=
|
||||
!IF ($(VSVER) == 2010)
|
||||
CL_RECENT=
|
||||
!ELSE
|
||||
! IF ($(VSVER) > 2010)
|
||||
CL2013=-sdl
|
||||
CL_RECENT=-sdl
|
||||
! ENDIF
|
||||
!ENDIF
|
||||
|
||||
ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \
|
||||
-D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \
|
||||
-DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" -EHsc -fp:precise -Gd -GF -GS -Gy \
|
||||
$(CL2013) -WX- -Zc:forScope -Zc:wchar_t -Zi
|
||||
$(CL_RECENT) -WX- -Zc:forScope -Zc:wchar_t -Zi
|
||||
cdebug= -analyze- -D"_DEBUG" -Gm -MTd -RTC1 -Od
|
||||
crelease= -analyze- -D"_MBCS" -errorReport:prompt -Gm- -MT -O2 -Ot -Ox -Oy
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
@REM NetHack 3.6 nhsetup.bat $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.33 $ */
|
||||
@REM Copyright (c) NetHack PC Development Team 1993-2015
|
||||
@REM Copyright (c) NetHack PC Development Team 1993-2017
|
||||
@REM NetHack may be freely redistributed. See license for details.
|
||||
@REM Win32 setup batch file, see Install.nt for details
|
||||
@REM
|
||||
@echo off
|
||||
pushd %~dp0
|
||||
set WIN32PATH=..\..\win\win32
|
||||
set BUILDPATH=..\..\build
|
||||
set BINPATH=..\..\binary
|
||||
set VCDir=
|
||||
|
||||
@@ -21,55 +20,7 @@ goto :EOF
|
||||
|
||||
:main
|
||||
|
||||
:vscheck2015
|
||||
rem cannot use the registry trick as in vc2010
|
||||
rem 14 = 2015
|
||||
SET VCVERS=14
|
||||
rem Finally, let's determine the root folder for this VC installation.
|
||||
call set VCROOT=%%VS%VCVERS%0COMNTOOLS%%
|
||||
if "%VCROOT:~-1%"=="\" set VCROOT=%VCROOT:~0,-1%
|
||||
rem VCROOT=VSDir\Common7\Tools
|
||||
call :dirname VCROOT "%VCROOT%"
|
||||
rem VCROOT=VSDir\Common7
|
||||
call :dirname VCROOT "%VCROOT%"
|
||||
rem VCROOT=VSDir
|
||||
set VCDir=%VCROOT%\VC
|
||||
SET MSVCVERSION=2015
|
||||
|
||||
if not defined VCDir goto :studiocheck2010
|
||||
if not exist "%VCDir%" goto :studiocheck2010
|
||||
|
||||
goto :fallback
|
||||
|
||||
:studiocheck2010
|
||||
@REM Set fallbacks here for 32-bit VS2010
|
||||
SET REGTREE=HKLM\Software\Microsoft\VCExpress\12.0\Setup\VC
|
||||
SET MSVCVERSION=2010
|
||||
|
||||
@REM if we're in a 64-bit cmd prompt, gotta include Wow6432Node
|
||||
echo Checking for 64-bit environment...
|
||||
if "%ProgramFiles%" NEQ "%ProgramFiles(x86)%" SET REGTREE=HKLM\Software\Wow6432Node\Microsoft\VCExpress\12.0\Setup\VC
|
||||
|
||||
@REM i can see your house from here... or at least your VC++ folder
|
||||
echo Checking version of VC++ installed...
|
||||
echo Checking for VC2013 Express...
|
||||
for /f "usebackq skip=2 tokens=1-2*" %%a IN (`reg query %REGTREE% /v ProductDir`) do @set VCDir="%%c"
|
||||
if not defined VCDir goto :othereditions
|
||||
if not exist %VCDir% goto :othereditions
|
||||
|
||||
set MSVCVERSION=2013
|
||||
goto :fallback
|
||||
|
||||
:othereditions
|
||||
@REM TODO: teach ourselves to detect full versions of Studio, which are under a different registry hive
|
||||
echo VC2013 Express not found; dropping back.
|
||||
|
||||
:fallback
|
||||
echo Using VS%MSVCVERSION%.
|
||||
set SRCPATH=%WIN32PATH%\vs%MSVCVERSION%
|
||||
|
||||
:nxtcheck
|
||||
echo Checking to see if directories are set up properly...
|
||||
echo Checking to see if source tree 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
|
||||
@@ -77,6 +28,9 @@ if not exist ..\..\util\makedefs.c goto :err_dir
|
||||
if not exist ..\..\sys\winnt\winnt.c goto :err_dir
|
||||
echo Directories look ok.
|
||||
|
||||
:movemakes
|
||||
echo Moving Makefiles into ..\..\src for those not using Visual Studio
|
||||
REM Some file movemet for those that still want to use MAKE or NMAKE and a Makefile
|
||||
:do_tty
|
||||
if NOT exist %BINPATH%\*.* mkdir %BINPATH%
|
||||
if NOT exist %BINPATH%\license copy ..\..\dat\license %BINPATH%\license >nul
|
||||
@@ -102,77 +56,38 @@ echo ..\..\src\Makefile.gcc-orig
|
||||
copy Makefile.gcc ..\..\src\Makefile.gcc >nul
|
||||
echo MinGW Makefile copied ok.
|
||||
|
||||
:do_win
|
||||
if not exist %SRCPATH%\nethack.sln goto :err_win
|
||||
|
||||
echo.
|
||||
if exist %BUILDPATH%\*.* goto projectcopy
|
||||
|
||||
echo Creating %BUILDPATH% directory...
|
||||
mkdir %BUILDPATH%
|
||||
|
||||
:projectcopy
|
||||
|
||||
@REM Visual Studio Express solution file
|
||||
if NOT exist %SRCPATH%\nethack.sln goto skipsoln
|
||||
echo Copying %SRCPATH%\nethack.sln to ..\..\nethack.sln...
|
||||
copy %SRCPATH%\nethack.sln ..\.. >nul
|
||||
:skipsoln
|
||||
|
||||
if NOT exist %BINPATH%\*.* echo Creating %BINPATH% directory...
|
||||
if NOT exist %BINPATH%\*.* mkdir %BINPATH%
|
||||
if NOT exist %BINPATH%\license copy ..\..\dat\license %BINPATH%\license >nul
|
||||
|
||||
echo Copying Visual C project files to %BUILDPATH% directory...
|
||||
|
||||
copy %WIN32PATH%\dgnstuff.mak %BUILDPATH% >nul
|
||||
copy %WIN32PATH%\levstuff.mak %BUILDPATH% >nul
|
||||
copy %WIN32PATH%\tiles.mak %BUILDPATH% >nul
|
||||
|
||||
@REM Visual C++ 201X Express project files
|
||||
:vcexpress
|
||||
if NOT exist %SRCPATH%\makedefs.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\tile2bmp.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\tilemap.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\uudecode.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\NetHackW.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\NetHack.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\dgncomp.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\dgnstuff.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\dlb_main.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\levcomp.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\levstuff.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\recover.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\tiles.vcxproj goto skipvcexpress
|
||||
if NOT exist %SRCPATH%\nhdefkey.vcxproj goto skipvcexpress
|
||||
|
||||
copy %SRCPATH%\makedefs.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\tile2bmp.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\tilemap.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\uudecode.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\NetHackW.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\NetHack.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\dgncomp.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\dgnstuff.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\dlb_main.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\levcomp.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\levstuff.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\recover.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\tiles.vcxproj %BUILDPATH% >nul
|
||||
copy %SRCPATH%\nhdefkey.vcxproj %BUILDPATH% >nul
|
||||
echo LIBRARY nhdefkey >%BUILDPATH%\nhdefkey64.def
|
||||
echo LIBRARY nhdefkey >%BUILDPATH%\nhdefkey.def
|
||||
echo EXPORTS >>%BUILDPATH%\nhdefkey.def
|
||||
echo ProcessKeystroke >>%BUILDPATH%\nhdefkey.def
|
||||
echo NHkbhit >>%BUILDPATH%\nhdefkey.def
|
||||
echo CheckInput >>%BUILDPATH%\nhdefkey.def
|
||||
echo SourceWhere >>%BUILDPATH%\nhdefkey.def
|
||||
echo SourceAuthor >>%BUILDPATH%\nhdefkey.def
|
||||
echo KeyHandlerName >>%BUILDPATH%\nhdefkey.def
|
||||
|
||||
echo Done copying files.
|
||||
:skipvcexpress
|
||||
|
||||
:vscheck2017
|
||||
SET REGTREE=HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7
|
||||
@REM i can see your house from here... or at least your VC++ folder
|
||||
echo Checking version of VC++ installed...
|
||||
echo Checking for VC2017 Community Edition...
|
||||
for /f "usebackq skip=2 tokens=1-2*" %%a IN (`reg query %REGTREE% /v 15.0`) do @set VCDir="%%c"
|
||||
if not defined VCDir goto :vscheck2015
|
||||
if not exist %VCDir% goto :vscheck2015
|
||||
set MSVCVERSION=2017
|
||||
goto :fallback
|
||||
|
||||
:vscheck2015
|
||||
rem cannot use the registry trick used for vc2017
|
||||
rem 14 = 2015
|
||||
SET VCVERS=14
|
||||
rem Finally, let's determine the root folder for this VC installation.
|
||||
set VCROOT=%%VS%VCVERS%0COMNTOOLS%%
|
||||
if "%VCROOT:~-1%"=="\" set VCROOT=%VCROOT:~0,-1%
|
||||
rem VCROOT=VSDir\Common7\Tools
|
||||
call :dirname VCROOT "%VCROOT%"
|
||||
rem VCROOT=VSDir\Common7
|
||||
call :dirname VCROOT "%VCROOT%"
|
||||
rem VCROOT=VSDir
|
||||
set VCDir=%VCROOT%\VC
|
||||
SET MSVCVERSION=2015
|
||||
|
||||
:fallback
|
||||
echo Using VS%MSVCVERSION%.
|
||||
set SRCPATH=%WIN32PATH%\vs%MSVCVERSION%
|
||||
echo NetHack VS%MSVCVERSION% project files are in %SRCPATH%
|
||||
goto :done
|
||||
|
||||
:err_win
|
||||
@@ -182,12 +97,6 @@ echo Check "Install.nt" for a list of the steps required
|
||||
echo to build NetHack.
|
||||
goto :fini
|
||||
|
||||
:err_data
|
||||
echo A required file ..\..\dat\data.bas seems to be missing.
|
||||
echo Check "Files." in the root directory for your NetHack distribution
|
||||
echo and make sure that all required files exist.
|
||||
goto :fini
|
||||
|
||||
:err_dir
|
||||
echo Your directories are not set up properly, please re-read the
|
||||
echo documentation and sys/winnt/Install.nt.
|
||||
|
||||
Reference in New Issue
Block a user