NHDT->ANH, nethack->anethack, nhdat->anhdat
[aNetHack.git] / sys / msdos / setup.bat
blob75584675ac15d5885792c1d90a5dc3d050c02033
1 @echo off
2 REM    aNetHack 0.0.1 setup.bat   $ANH-Date: 1432512792 2015/05/25 00:13:12 $ $ANH-Branch: master $:$ANH-Revision: 1.9 $
3 REM    Copyright (c) aNetHack PC Development Team 1990 - 2012
4 REM    aNetHack may be freely redistributed.  See license for details.
6 echo.
7 echo   Copyright (c) aNetHack PC Development Team 1990 - 2012
8 echo   aNetHack may be freely redistributed.  See license for details.
9 echo.
10 REM setup batch file for msdos, see Install.dos for details.
12 if not %1.==. goto ok_parm
13 goto err_set
15 :ok_parm
16 echo Checking to see if directories are set up properly ...
17 if not exist ..\..\include\hack.h  goto err_dir
18 if not exist ..\..\src\hack.c      goto err_dir
19 if not exist ..\..\dat\wizard.des  goto err_dir
20 if not exist ..\..\util\makedefs.c goto err_dir
21 if not exist ..\..\win\tty\wintty.c goto err_dir
22 if not exist ..\share\lev_yacc.c   goto err_dir
23 echo Directories OK.
25 if not exist ..\..\binary\* mkdir ..\..\binary
26 if NOT exist ..\..\binary\license copy ..\..\dat\license ..\..\binary\license >nul
28 if exist ..\..\dat\data.bas goto long1ok
29 if exist ..\..\dat\data.base goto long1a
30 if exist ..\..\dat\data~1.bas goto long1b
31 goto err_long
32 :long1a
33 echo Changing some long-named distribution file names:
34 echo "Copying ..\..\dat\data.base -> ..\..\dat\data.bas"
35 copy ..\..\dat\data.base ..\..\dat\data.bas
36 if exist ..\..\dat\data.old del /Q ..\..\dat\data.old
37 ren ..\..\dat\data.base data.old
38 goto long1ok
39 :long1b
40 echo Changing some long-named distribution file names:
41 echo "Copying ..\..\dat\data~1.bas -> ..\..\dat\data.bas"
42 copy ..\..\dat\data~1.bas ..\..\dat\data.bas
43 if exist ..\..\dat\data.old del /Q ..\..\dat\data.old
44 ren ..\..\dat\data~1.bas data.old
45 :long1ok
47 if exist ..\..\include\patchlev.h goto long2ok
48 if exist ..\..\include\patchlevel.h goto long2a
49 if exist ..\..\include\patchl~1.h goto long2b
50 goto err_long
51 :long2a
52 echo "Copying ..\..\include\patchlevel.h -> ..\..\include\patchlev.h"
53 copy ..\..\include\patchlevel.h ..\..\include\patchlev.h
54 if exist ..\..\include\patchlev.old del /Q ..\..\include\patchlev.old
55 ren ..\..\include\patchlevel.h patchlev.old
56 goto long2ok
57 :long2b
58 echo "Copying ..\..\include\patchl~1.h -> ..\..\include\patchlev.h"
59 copy ..\..\include\patchl~1.h ..\..\include\patchlev.h
60 if exist ..\..\include\patchlev.old del /Q ..\..\include\patchlev.old
61 ren ..\..\include\patchl~1.h patchlev.old
62 :long2ok
64 REM Missing guidebook is not fatal to the build process
65 if exist ..\..\doc\guideboo.txt goto long3ok
66 if exist ..\..\doc\guidebook.txt goto long3a
67 if exist ..\..\doc\guideb~1.txt goto long3b
68 goto warn3long
69 :long3a
70 echo "Copying ..\..\doc\guidebook.txt -> ..\..\doc\guideboo.txt"
71 copy ..\..\doc\guidebook.txt ..\..\doc\guideboo.txt
72 if exist ..\..\doc\guideboo.old del /Q ..\..\doc\guideboo.old
73 ren ..\..\doc\guidebook.txt guideboo.old
74 goto long3ok
75 :long3b
76 echo "Copying ..\..\doc\guideb~1.txt -> ..\..\doc\guideboo.txt"
77 copy ..\..\doc\guideb~1.txt ..\..\doc\guideboo.txt
78 if exist ..\..\doc\guideboo.old del /Q ..\..\doc\guideboo.old
79 ren ..\..\doc\guideb~1.txt guideboo.old
80 goto long3ok
81 :warn3long
82 echo "Warning - There is no aNetHack Guidebook (..\..\doc\guideboo.txt)"
83 echo "          included in your distribution.  Build will proceed anyway."
84 :long3ok
86 if "%1"=="GCC"   goto ok_gcc
87 if "%1"=="gcc"   goto ok_gcc
88 if "%1"=="nmake" goto ok_msc
89 if "%1"=="NMAKE" goto ok_msc
90 if "%1"=="BC"   goto ok_bc
91 if "%1"=="bc"   goto ok_bc
92 if "%1"=="MSC"   goto ok_msc
93 if "%1"=="msc"   goto ok_msc
94 goto err_set
96 :ok_gcc
97 echo Symbolic links, msdos style
98 echo "Makefile.GCC -> ..\..\src\makefile"
99 copy makefile.GCC ..\..\src\makefile
100 goto done
102 :ok_msc
103 echo Copying Makefile for Microsoft C and Microsoft NMAKE.
104 echo "Makefile.MSC -> ..\..\src\makefile"
105 copy Makefile.MSC ..\..\src\makefile
106 echo Copying overlay schemas to ..\..\src
107 copy schema*.MSC ..\..\src\schema*.DEF
108 :ok_cl
109 goto done
111 :ok_bc
112 echo Copying Makefile for Borland C and Borland's MAKE.
113 echo "Makefile.BC -> ..\..\src\makefile"
114 copy Makefile.BC ..\..\src\makefile
115 echo Copying overlay schemas to ..\..\src
116 copy schema*.BC ..\..\src
117 goto done
119 :err_long
120 echo.
121 echo ** ERROR - New file system with "long file name support" problem. **
122 echo A couple of aNetHack distribution files that are packaged with 
123 echo a long filename ( exceeds 8.3) appear to be missing from your 
124 echo distribution.
125 echo The following files need to exist under the names on the
126 echo right in order to build aNetHack:
127 echo.
128 echo  ..\..\dat\data.base        needs to be copied to ..\..\dat\data.bas
129 echo  ..\..\include\patchlevel.h needs to be copied to ..\..\include\patchlev.h
130 echo.
131 echo setup.bat was unable to perform the necessary changes because at least
132 echo one of the files doesn't exist under its short name, and the 
133 echo original (long) file name to copy it from was not found either.
134 echo.
135 goto end
137 :err_set
138 echo.
139 echo Usage:
140 echo "%0 <GCC | MSC | BC >"
141 echo.
142 echo    Run this batch file specifying on of the following:
143 echo            GCC, MSC, BC
144 echo.
145 echo    (depending on which compiler and/or make utility you are using).
146 echo.
147 echo    The GCC argument is for use with djgpp and the NDMAKE utility.
148 echo.
149 echo    The MSC argument is for use with Microsoft C and the NMAKE utility
150 echo    that ships with it (MSC 7.0 or greater only, including Visual C).
151 echo.
152 echo    The BC argument is for use with Borland C and Borland's MAKE utility
153 echo    that ships with it (Borland C++ 3.1 only).
154 echo.
155 goto end
157 :err_dir
158 echo/
159 echo Your directories are not set up properly, please re-read the
160 echo Install.dos and README documentation.
161 goto end
163 :done
164 echo Setup Done!
165 echo Please continue with next step from Install.dos.
167 :end