blob: f9ddf8400f1b1d7767d699e03908724a3fb7470e [file] [log] [blame]
Restorer424da592023-11-11 18:26:00 +00001#
2# Makefile for the Vim documentation on Windows
3#
4# 17.11.23, Restorer, <restorer@mail2k.ru>
5
6# Common components
7!INCLUDE Make_all.mak
8
9
10# TODO: to think about what to use instead of awk. PowerShell?
11#AWK =
12
13# Correct the following line for the where executeable file vim is installed
14VIMEXE = D:\Programs\Vim\vim90\vim.exe
15
16# Correct the following line for the directory where gettext et al is installed
17GETTEXT_PATH = D:\Programs\GetText\bin
18
19# In case some package like GnuWin32, UnixUtils
20# or something similar is installed on the system.
21# If the "touch" program is installed on the system, but it is not registered
22# in the %PATH% environment variable, then specify the full path to this file.
23!IF EXIST ("touch.exe")
24TOUCH = touch.exe $@
25!ELSE
26TOUCH = @if exist $@ ( copy /b $@+,, ) else ( type nul >$@ )
27!ENDIF
28
29# In case some package like GnuWin32, UnixUtils, gettext
30# or something similar is installed on the system.
31# If the "iconv" program is installed on the system, but it is not registered
32# in the %PATH% environment variable, then specify the full path to this file.
33!IF EXIST ("iconv.exe")
34ICONV = iconv.exe
35!ELSEIF EXIST ("$(GETTEXT_PATH)\iconv.exe")
36ICONV="$(GETTEXT_PATH)\iconv.exe"
37!ENDIF
38
39RM = del /q
40
41.SUFFIXES :
42.SUFFIXES : .c .o .txt .html
43
44
45all : tags perlhtml $(CONVERTED)
46
47# Use "doctags" to generate the tags file. Only works for English!
48tags : doctags $(DOCS)
49 doctags $(DOCS) | sort /L C /O tags
50 powershell -nologo -noprofile -Command \
51 "(Get-Content -Raw tags | Get-Unique | % {$$_ -replace \"`r\", \"\"}) \
52 | New-Item -Force -Path . -ItemType file -Name tags"
53
54doctags : doctags.c
55 $(CC) doctags.c
56
57
58# Use Vim to generate the tags file. Can only be used when Vim has been
59# compiled and installed. Supports multiple languages.
60vimtags : $(DOCS)
61 $(VIMEXE) --clean -esX -V1 -u doctags.vim
62
63
64uganda.nsis.txt : uganda.*
65 !powershell -nologo -noprofile -Command \
66 $$ext=(Get-Item $?).Extension; (Get-Content $? ^| \
67 % {$$_ -replace '\s*\*[-a-zA-Z0-9.]*\*', '' -replace 'vim:tw=78:.*', ''}) \
68 ^| Set-Content $*$$ext
69 !powershell -nologo -noprofile -Command \
70 $$ext=(Get-Item $?).Extension; \
71 (Get-Content -Raw $(@B)$$ext).Trim() -replace '(\r\n){3,}', '$$1$$1' \
72 ^| Set-Content $(@B)$$ext
73
74
75# TODO:
76#html: noerrors tags $(HTMLS)
77# if exist errors.log (more errors.log)
78
79# TODO:
80#noerrors:
81# $(RM) errors.log
82
83# TODO:
84#.txt.html:
85
86
87# TODO:
88#index.html: help.txt
89
90
91# TODO:
92#vimindex.html: index.txt
93
94
95# TODO:
96#tags.ref tags.html: tags
97
98# Perl version of .txt to .html conversion.
99# There can't be two rules to produce a .html from a .txt file.
100# Just run over all .txt files each time one changes. It's fast anyway.
101perlhtml : tags $(DOCS)
102 vim2html.pl tags $(DOCS)
103
104# Check URLs in the help with "curl" or "powershell".
105test_urls :
106 $(VIMEXE) -S test_urls.vim
107
108clean :
109 $(RM) doctags.exe doctags.obj
110 $(RM) *.html vim-stylesheet.css
111
112
113
114arabic.txt :
115 $(TOUCH)
116
117farsi.txt :
118 $(TOUCH)
119
120hebrew.txt :
121 $(TOUCH)
122
123russian.txt :
124 $(TOUCH)
125
126gui_w32.txt :
127 $(TOUCH)
128
129if_ole.txt :
130 $(TOUCH)
131
132os_390.txt :
133 $(TOUCH)
134
135os_amiga.txt :
136 $(TOUCH)
137
138os_beos.txt :
139 $(TOUCH)
140
141os_dos.txt :
142 $(TOUCH)
143
144os_haiku.txt :
145 $(TOUCH)
146
147os_mac.txt :
148 $(TOUCH)
149
150os_mint.txt :
151 $(TOUCH)
152
153os_msdos.txt :
154 $(TOUCH)
155
156os_os2.txt :
157 $(TOUCH)
158
159os_qnx.txt :
160 $(TOUCH)
161
162os_risc.txt :
163 $(TOUCH)
164
165os_win32.txt :
166 $(TOUCH)
167
168
169convert-all : $(CONVERTED)
170!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
171!ERROR The program "PowerShell" version 3.0 or higher is required to work
172!ENDIF
173
174vim-da.UTF-8.1 : vim-da.1
175!IF DEFINED (ICONV)
176 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
177!ELSE
178# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
179 powershell -nologo -noprofile -Command \
180 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
181 1>nul New-Item -Force -Path . -ItemType file -Name $@
182!ENDIF
183
184vimdiff-da.UTF-8.1 : vimdiff-da.1
185!IF DEFINED (ICONV)
186 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
187!ELSE
188# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
189 powershell -nologo -noprofile -Command \
190 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
191 1>nul New-Item -Force -Path . -ItemType file -Name $@
192!ENDIF
193
194vimtutor-da.UTF-8.1 : vimtutor-da.1
195!IF DEFINED (ICONV)
196 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
197!ELSE
198# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
199 powershell -nologo -noprofile -Command \
200 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
201 1>nul New-Item -Force -Path . -ItemType file -Name $@
202!ENDIF
203
204vim-de.UTF-8.1 : vim-de.1
205!IF DEFINED (ICONV)
206 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
207!ELSE
208# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
209 powershell -nologo -noprofile -Command \
210 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
211 1>nul New-Item -Force -Path . -ItemType file -Name $@
212!ENDIF
213
214evim-fr.UTF-8.1 : evim-fr.1
215!IF DEFINED (ICONV)
216 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
217!ELSE
218# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
219 powershell -nologo -noprofile -Command \
220 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
221 1>nul New-Item -Force -Path . -ItemType file -Name $@
222!ENDIF
223
224vim-fr.UTF-8.1 : vim-fr.1
225!IF DEFINED (ICONV)
226 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
227!ELSE
228# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
229 powershell -nologo -noprofile -Command \
230 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
231 1>nul New-Item -Force -Path . -ItemType file -Name $@
232!ENDIF
233
234vimdiff-fr.UTF-8.1 : vimdiff-fr.1
235!IF DEFINED (ICONV)
236 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
237!ELSE
238# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
239 powershell -nologo -noprofile -Command \
240 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
241 1>nul New-Item -Force -Path . -ItemType file -Name $@
242!ENDIF
243
244vimtutor-fr.UTF-8.1 : vimtutor-fr.1
245!IF DEFINED (ICONV)
246 $(ICONV) -f ISO-8859-1 -t utf-8 $? >$@
247!ELSE
248# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
249 powershell -nologo -noprofile -Command \
250 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
251 1>nul New-Item -Force -Path . -ItemType file -Name $@
252!ENDIF
253
254xxd-fr.UTF-8.1 : xxd-fr.1
255!IF DEFINED (ICONV)
256 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
257!ELSE
258# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
259 powershell -nologo -noprofile -Command \
260 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
261 1>nul New-Item -Force -Path . -ItemType file -Name $@
262!ENDIF
263
264evim-it.UTF-8.1 : evim-it.1
265!IF DEFINED (ICONV)
266 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
267!ELSE
268# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
269 powershell -nologo -noprofile -Command \
270 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
271 1>nul New-Item -Force -Path . -ItemType file -Name $@
272!ENDIF
273
274vim-it.UTF-8.1 : vim-it.1
275!IF DEFINED (ICONV)
276 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
277!ELSE
278# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
279 powershell -nologo -noprofile -Command \
280 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
281 1>nul New-Item -Force -Path . -ItemType file -Name $@
282!ENDIF
283
284vimdiff-it.UTF-8.1 : vimdiff-it.1
285!IF DEFINED (ICONV)
286 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
287!ELSE
288# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
289 powershell -nologo -noprofile -Command \
290 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
291 1>nul New-Item -Force -Path . -ItemType file -Name $@
292!ENDIF
293
294vimtutor-it.UTF-8.1 : vimtutor-it.1
295!IF DEFINED (ICONV)
296 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
297!ELSE
298# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
299 powershell -nologo -noprofile -Command \
300 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
301 1>nul New-Item -Force -Path . -ItemType file -Name $@
302!ENDIF
303
304xxd-it.UTF-8.1 : xxd-it.1
305!IF DEFINED (ICONV)
306 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
307!ELSE
308# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
309 powershell -nologo -noprofile -Command \
310 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
311 1>nul New-Item -Force -Path . -ItemType file -Name $@
312!ENDIF
313
314evim-pl.UTF-8.1 : evim-pl.1
315!IF DEFINED (ICONV)
316 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
317!ELSE
318# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
319 powershell -nologo -noprofile -Command \
320 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
321 1>nul New-Item -Force -Path . -ItemType file -Name $@
322!ENDIF
323
324vim-pl.UTF-8.1 : vim-pl.1
325!IF DEFINED (ICONV)
326 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
327!ELSE
328# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
329 powershell -nologo -noprofile -Command \
330 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
331 1>nul New-Item -Force -Path . -ItemType file -Name $@
332!ENDIF
333
334vimdiff-pl.UTF-8.1 : vimdiff-pl.1
335!IF DEFINED (ICONV)
336 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
337!ELSE
338# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
339 powershell -nologo -noprofile -Command \
340 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
341 1>nul New-Item -Force -Path . -ItemType file -Name $@
342!ENDIF
343
344vimtutor-pl.UTF-8.1 : vimtutor-pl.1
345!IF DEFINED (ICONV)
346 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
347!ELSE
348# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
349 powershell -nologo -noprofile -Command \
350 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
351 1>nul New-Item -Force -Path . -ItemType file -Name $@
352!ENDIF
353
354xxd-pl.UTF-8.1 : xxd-pl.1
355!IF DEFINED (ICONV)
356 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
357!ELSE
358# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
359 powershell -nologo -noprofile -Command \
360 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
361 1>nul New-Item -Force -Path . -ItemType file -Name $@
362!ENDIF
363
364evim-ru.UTF-8.1 : evim-ru.1
365!IF DEFINED (ICONV)
366 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
367!ELSE
368# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
369 powershell -nologo -noprofile -Command \
370 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
371 1>nul New-Item -Force -Path . -ItemType file -Name $@
372!ENDIF
373
374vim-ru.UTF-8.1 : vim-ru.1
375!IF DEFINED (ICONV)
376 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
377!ELSE
378# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
379 powershell -nologo -noprofile -Command \
380 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
381 1>nul New-Item -Force -Path . -ItemType file -Name $@
382!ENDIF
383
384vimdiff-ru.UTF-8.1 : vimdiff-ru.1
385!IF DEFINED (ICONV)
386 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
387!ELSE
388# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
389 powershell -nologo -noprofile -Command \
390 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
391 1>nul New-Item -Force -Path . -ItemType file -Name $@
392!ENDIF
393
394vimtutor-ru.UTF-8.1 : vimtutor-ru.1
395!IF DEFINED (ICONV)
396 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
397!ELSE
398# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
399 powershell -nologo -noprofile -Command \
400 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
401 1>nul New-Item -Force -Path . -ItemType file -Name $@
402!ENDIF
403
404xxd-ru.UTF-8.1 : xxd-ru.1
405!IF DEFINED (ICONV)
406 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
407!ELSE
408# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
409 powershell -nologo -noprofile -Command \
410 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
411 1>nul New-Item -Force -Path . -ItemType file -Name $@
412!ENDIF
413
414evim-tr.UTF-8.1 : evim-tr.1
415!IF DEFINED (ICONV)
416 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
417!ELSE
418# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
419 powershell -nologo -noprofile -Command \
420 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
421 1>nul New-Item -Force -Path . -ItemType file -Name $@
422!ENDIF
423
424vim-tr.UTF-8.1 : vim-tr.1
425!IF DEFINED (ICONV)
426 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
427!ELSE
428# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
429 powershell -nologo -noprofile -Command \
430 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
431 1>nul New-Item -Force -Path . -ItemType file -Name $@
432!ENDIF
433
434vimdiff-tr.UTF-8.1 : vimdiff-tr.1
435!IF DEFINED (ICONV)
436 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
437!ELSE
438# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
439 powershell -nologo -noprofile -Command \
440 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
441 1>nul New-Item -Force -Path . -ItemType file -Name $@
442!ENDIF
443
444vimtutor-tr.UTF-8.1 : vimtutor-tr.1
445!IF DEFINED (ICONV)
446 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
447!ELSE
448# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
449 powershell -nologo -noprofile -Command \
450 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
451 1>nul New-Item -Force -Path . -ItemType file -Name $@
452!ENDIF
453
454
455
456# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: