OSDN Git Service

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