doc/changes.src: Update to include recent changes.
[nasm.git] / doc / makedocs.bat
blob537239485f9960dc79c76bfdd6412accec5d4cd5
1 @echo off
2 if "%1"=="clean" goto makeclean
3 if "%1"=="CLEAN" goto makeclean
4 if "%1"=="spotless" goto spotless
5 if "%1"=="SPOTLESS" goto spotless
6 if "%1"=="install" goto install
7 if "%1"=="INSTALL" goto install
9 cls
10 echo.
11 echo.
12 echo.
13 echo    Usage:
14 echo.
15 echo        makedocs - no parameters - makes all Docs
16 echo        makedocs install - installs already made docs in subdirectories
17 echo        makedocs clean - removes docs from current directory
18 echo        makedocs spotless - removes all - including default install dirs
19 echo.
20 echo.
21 echo.
22 echo.
23 echo        Makedocs(.bat), with no parameters will create Nasm Documentation
24 echo        in several formats: plain ascii text, ps, html, rtf, Windows help
25 echo        format, and if you've got an "info" system installed, info format.
26 echo.
27 echo.
28 echo                This requires Perl, and almost 4MB disk space.
29 echo.
30 echo.
31 choice "                     Proceed with making docs? "
32 if errorlevel 2 goto exit
34 :makeall
36 echo.
37 echo.
38 echo                        This takes a while. Stretch!
39 echo.
40 echo.
42 perl inslist.pl
43 perl rdsrc.pl<nasmdoc.src
44 echo.
45 echo.
46 choice "                       Make *info* files? "
47 if errorlevel 2 goto noinfo
48 :makeinfo
49 echo.
50 echo.
51 makeinfo nasmdoc.tex
53 :noinfo
55 :install
57 if not exist nasmdoc.txt goto nofiles
58 if not exist nasmdoc0.htm goto nofiles
59 if not exist nasmdo10.htm goto nofiles
60 if not exist nasmdoc.hpj goto nofiles
61 if not exist nasmdoc.rtf goto nofiles
62 if not exist nasmdoc.ps goto nofiles
63 if not exist nasmdoc.tex goto nofiles
64 goto gotfiles
65 :nofiles
66 echo.
67 echo.
68 echo.
69 echo.
70 echo                       Alert!      Files missing!
71 echo.
72 echo.
73 choice "               Would you like to make them now? "
74 if errorlevel 2 goto exit
75 goto makeall
77 :gotfiles
79 :: get current path
81 set oldprompt=%prompt%
82 echo @prompt set nasdoc=$p>temp1.bat
83 command /c temp1.bat>temp2.bat
84 call temp2
85 del temp1.bat
86 del temp2.bat
87 set prompt=%oldprompt%
88 set oldprompt=
90 echo.
91 echo.
92 echo.
93 echo.
94 echo        Current Directory is %nasdoc%
95 echo        Nasm Documentation will be installed under this
96 echo        as %nasdoc%\text\nasmdoc.txt, etc.
97 echo.
98 echo.
99 choice "                   Change this directory? "
100 if errorlevel 2 goto dirok
102 echo.
103 echo.
104 echo.
105 echo.
106 echo      Directory *above* the directory you name (at least) should exist.
107 echo      Nasm documentation will be installed *under* the directory you
108 echo      name. E.G. \docs\nasm\html, etc. No trailing backslash!
109 echo.
110 echo.
112 echo                Enter new name for base directory:
113 set input=
114 fc con nul /lb1 /n|date|find "1:">magic.bat
115 echo set input=%%5>enter.bat
116 call magic
117 set nasdoc=%input%
118 del magic.bat
119 del enter.bat
120 set input=
122 echo.
123 echo.
124 md %nasdoc%
125 echo.
126 echo.
128 choice "  Install Text docs in %nasdoc%\text ? "
129 if errorlevel 2 goto notext
130 md %nasdoc%\text
131 copy nasmdoc.txt %nasdoc%\text
132 :notext
134 choice "  Install Html docs in %nasdoc%\html ? "
135 if errorlevel 2 goto nohtml
136 md %nasdoc%\html
137 copy *.htm %nasdoc%\html
138 :nohtml
140 choice "  Install Info docs in %nasdoc%\info ? "
141 if errorlevel 2 goto noinfodocs
142 if not exist nasm.inf goto inofiles
143 if not exist nasm.i9 goto inofiles
144 goto gotifiles
145 :inofiles
146 echo.
147 echo.
148 echo                       Alert!      Files missing!
149 echo.
150 echo.
151 choice "               Would you like to make them now? "
152 if errorlevel 2 goto noinfodocs
153 if not exist nasmdoc.tex goto makeall
154 goto makeinfo
156 :gotifiles
158 md %nasdoc%\info
159 copy nasm.i* %nasdoc%\info
160 :noinfodocs
162 choice "  Install Winhelp docs in %nasdoc%\winhelp ? "
163 if errorlevel 2 goto nowinhelp
164 md %nasdoc%\winhelp
165 copy nasmdoc.rtf %nasdoc%\winhelp
166 copy nasmdoc.hpj %nasdoc%\winhelp
167 :nowinhelp
169 choice "  Install Postscript docs in %nasdoc%\ps ? "
170 if errorlevel 2 goto nops
171 md %nasdoc%\ps
172 copy nasmdoc.ps %nasdoc%\ps
173 :nops
174 goto cleanup
176 :dirok
178 choice "  Install Text docs in .\text ? "
179 if errorlevel 2 goto notext2
180 md text
181 copy nasmdoc.txt text
182 :notext2
184 choice "  Install Html docs in .\html ? "
185 if errorlevel 2 goto nohtml2
186 md html
187 copy *.htm html
188 :nohtml2
190 choice "  Install Info docs in .\info ? "
191 if errorlevel 2 goto nid2
193 if not exist nasm.inf goto inof2
194 if not exist nasm.i9 goto inof2
195 goto gifiles2
196 :inof2
197 echo.
198 echo.
199 echo                       Alert!      Files missing!
200 echo.
201 echo.
202 choice "               Would you like to make them now? "
203 if errorlevel 2 goto nid2
204 if not exist nasmdoc.tex goto makeall
205 goto makeinfo
207 :gifiles2
209 md info
210 copy nasm.i* info
211 :nid2
213 choice "  Install Winhelp docs in .\winhelp ? "
214 if errorlevel 2 goto nwhelp2
215 md winhelp
216 copy nasmdoc.rtf winhelp
217 copy nasmdoc.hpj winhelp
218 :nwhelp2
220 choice "  Install Postscript docs in .\ps ? "
221 if errorlevel 2 goto nops2
222 md ps
223 copy nasmdoc.ps ps
224 :nops2
227 :cleanup
228 set nasdoc=
230 echo.
231 echo.
232 echo.
233 echo.
234 choice "        Remove all files created, but not installed?"
235 if not errorlevel 2 goto makeclean
237 goto exit
239 :spotless
240 deltree /y text
241 deltree /y html
242 deltree /y info
243 deltree /y winhelp
244 deltree /y ps
246 :makeclean
247 del *.htm
248 del *.rtf
249 del *.hpj
250 del *.txt
251 del *.tex
252 del *.ps
253 del nasm.i*
255 :exit