summaryrefslogtreecommitdiff
path: root/doc/makedocs.bat
blob: 537239485f9960dc79c76bfdd6412accec5d4cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
@echo off
if "%1"=="clean" goto makeclean
if "%1"=="CLEAN" goto makeclean
if "%1"=="spotless" goto spotless
if "%1"=="SPOTLESS" goto spotless
if "%1"=="install" goto install
if "%1"=="INSTALL" goto install

cls
echo.
echo.
echo.
echo    Usage:
echo.
echo        makedocs - no parameters - makes all Docs
echo        makedocs install - installs already made docs in subdirectories
echo        makedocs clean - removes docs from current directory
echo        makedocs spotless - removes all - including default install dirs
echo.
echo.
echo.
echo.
echo        Makedocs(.bat), with no parameters will create Nasm Documentation
echo        in several formats: plain ascii text, ps, html, rtf, Windows help
echo        format, and if you've got an "info" system installed, info format.
echo.
echo.
echo                This requires Perl, and almost 4MB disk space.
echo.
echo.
choice "                     Proceed with making docs? "
if errorlevel 2 goto exit

:makeall

echo.
echo.
echo                        This takes a while. Stretch!
echo.
echo.

perl inslist.pl
perl rdsrc.pl<nasmdoc.src
echo.
echo.
choice "                       Make *info* files? "
if errorlevel 2 goto noinfo
:makeinfo
echo.
echo.
makeinfo nasmdoc.tex

:noinfo

:install

if not exist nasmdoc.txt goto nofiles
if not exist nasmdoc0.htm goto nofiles
if not exist nasmdo10.htm goto nofiles
if not exist nasmdoc.hpj goto nofiles
if not exist nasmdoc.rtf goto nofiles
if not exist nasmdoc.ps goto nofiles
if not exist nasmdoc.tex goto nofiles
goto gotfiles
:nofiles
echo.
echo.
echo.
echo.
echo                       Alert!      Files missing!
echo.
echo.
choice "               Would you like to make them now? "
if errorlevel 2 goto exit
goto makeall

:gotfiles

:: get current path

set oldprompt=%prompt%
echo @prompt set nasdoc=$p>temp1.bat
command /c temp1.bat>temp2.bat
call temp2
del temp1.bat
del temp2.bat
set prompt=%oldprompt%
set oldprompt=

echo.
echo.
echo.
echo.
echo        Current Directory is %nasdoc%
echo        Nasm Documentation will be installed under this
echo        as %nasdoc%\text\nasmdoc.txt, etc.
echo.
echo.
choice "                   Change this directory? "
if errorlevel 2 goto dirok

echo.
echo.
echo.
echo.
echo      Directory *above* the directory you name (at least) should exist.
echo      Nasm documentation will be installed *under* the directory you
echo      name. E.G. \docs\nasm\html, etc. No trailing backslash!
echo.
echo.

echo                Enter new name for base directory:
set input=
fc con nul /lb1 /n|date|find "1:">magic.bat
echo set input=%%5>enter.bat
call magic
set nasdoc=%input%
del magic.bat
del enter.bat
set input=

echo.
echo.
md %nasdoc%
echo.
echo.

choice "  Install Text docs in %nasdoc%\text ? "
if errorlevel 2 goto notext
md %nasdoc%\text
copy nasmdoc.txt %nasdoc%\text
:notext

choice "  Install Html docs in %nasdoc%\html ? "
if errorlevel 2 goto nohtml
md %nasdoc%\html
copy *.htm %nasdoc%\html
:nohtml

choice "  Install Info docs in %nasdoc%\info ? "
if errorlevel 2 goto noinfodocs
if not exist nasm.inf goto inofiles
if not exist nasm.i9 goto inofiles
goto gotifiles
:inofiles
echo.
echo.
echo                       Alert!      Files missing!
echo.
echo.
choice "               Would you like to make them now? "
if errorlevel 2 goto noinfodocs
if not exist nasmdoc.tex goto makeall
goto makeinfo

:gotifiles

md %nasdoc%\info
copy nasm.i* %nasdoc%\info
:noinfodocs

choice "  Install Winhelp docs in %nasdoc%\winhelp ? "
if errorlevel 2 goto nowinhelp
md %nasdoc%\winhelp
copy nasmdoc.rtf %nasdoc%\winhelp
copy nasmdoc.hpj %nasdoc%\winhelp
:nowinhelp

choice "  Install Postscript docs in %nasdoc%\ps ? "
if errorlevel 2 goto nops
md %nasdoc%\ps
copy nasmdoc.ps %nasdoc%\ps
:nops
goto cleanup

:dirok

choice "  Install Text docs in .\text ? "
if errorlevel 2 goto notext2
md text
copy nasmdoc.txt text
:notext2

choice "  Install Html docs in .\html ? "
if errorlevel 2 goto nohtml2
md html
copy *.htm html
:nohtml2

choice "  Install Info docs in .\info ? "
if errorlevel 2 goto nid2

if not exist nasm.inf goto inof2
if not exist nasm.i9 goto inof2
goto gifiles2
:inof2
echo.
echo.
echo                       Alert!      Files missing!
echo.
echo.
choice "               Would you like to make them now? "
if errorlevel 2 goto nid2
if not exist nasmdoc.tex goto makeall
goto makeinfo

:gifiles2

md info
copy nasm.i* info
:nid2

choice "  Install Winhelp docs in .\winhelp ? "
if errorlevel 2 goto nwhelp2
md winhelp
copy nasmdoc.rtf winhelp
copy nasmdoc.hpj winhelp
:nwhelp2

choice "  Install Postscript docs in .\ps ? "
if errorlevel 2 goto nops2
md ps
copy nasmdoc.ps ps
:nops2


:cleanup
set nasdoc=

echo.
echo.
echo.
echo.
choice "        Remove all files created, but not installed?"
if not errorlevel 2 goto makeclean

goto exit

:spotless
deltree /y text
deltree /y html
deltree /y info
deltree /y winhelp
deltree /y ps

:makeclean
del *.htm
del *.rtf
del *.hpj
del *.txt
del *.tex
del *.ps
del nasm.i*

:exit