OSDN Git Service

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