blob: 656cf75926b54ab3fa9c44881afe750a101e1e5f [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
Restorer8c14e792023-11-25 14:39:51 +000013# Correct the following line for the where executeable file vim is installed.
14# Please do not put the path in quotes.
Restorer424da592023-11-11 18:26:00 +000015VIMEXE = D:\Programs\Vim\vim90\vim.exe
16
Restorer8c14e792023-11-25 14:39:51 +000017# Correct the following line for the directory where iconv installed.
18# Please do not put the path in quotes.
19ICONV_PATH = D:\Programs\GetText\bin
Restorer424da592023-11-11 18:26:00 +000020
21# In case some package like GnuWin32, UnixUtils
22# or something similar is installed on the system.
23# If the "touch" program is installed on the system, but it is not registered
24# in the %PATH% environment variable, then specify the full path to this file.
25!IF EXIST ("touch.exe")
Restorer8c14e792023-11-25 14:39:51 +000026TOUCH = "touch.exe" %1
Restorer424da592023-11-11 18:26:00 +000027!ELSE
Restorer8c14e792023-11-25 14:39:51 +000028TOUCH = if exist %1 ( copy /b %1+,, ) else ( type nul >%1 )
Restorer424da592023-11-11 18:26:00 +000029!ENDIF
30
31# In case some package like GnuWin32, UnixUtils, gettext
32# or something similar is installed on the system.
33# If the "iconv" program is installed on the system, but it is not registered
34# in the %PATH% environment variable, then specify the full path to this file.
35!IF EXIST ("iconv.exe")
Restorer8c14e792023-11-25 14:39:51 +000036ICONV = "iconv.exe"
37!ELSEIF EXIST ("$(ICONV_PATH)\iconv.exe")
38ICONV = "$(ICONV_PATH)\iconv.exe"
Restorer424da592023-11-11 18:26:00 +000039!ENDIF
40
41RM = del /q
42
43.SUFFIXES :
44.SUFFIXES : .c .o .txt .html
45
46
47all : tags perlhtml $(CONVERTED)
48
49# Use "doctags" to generate the tags file. Only works for English!
50tags : doctags $(DOCS)
Restorer8c14e792023-11-25 14:39:51 +000051 doctags.exe $(DOCS) | sort /L C /O tags
Restorer424da592023-11-11 18:26:00 +000052 powershell -nologo -noprofile -Command \
53 "(Get-Content -Raw tags | Get-Unique | % {$$_ -replace \"`r\", \"\"}) \
54 | New-Item -Force -Path . -ItemType file -Name tags"
55
56doctags : doctags.c
57 $(CC) doctags.c
58
59
60# Use Vim to generate the tags file. Can only be used when Vim has been
61# compiled and installed. Supports multiple languages.
62vimtags : $(DOCS)
Restorer8c14e792023-11-25 14:39:51 +000063 @"$(VIMEXE)" --clean -esX -V1 -u doctags.vim
Restorer424da592023-11-11 18:26:00 +000064
65
Restorer8c14e792023-11-25 14:39:51 +000066uganda.nsis.txt : uganda.???
67 !@powershell -nologo -noprofile -Command \
Restorer424da592023-11-11 18:26:00 +000068 $$ext=(Get-Item $?).Extension; (Get-Content $? ^| \
69 % {$$_ -replace '\s*\*[-a-zA-Z0-9.]*\*', '' -replace 'vim:tw=78:.*', ''}) \
70 ^| Set-Content $*$$ext
Restorer8c14e792023-11-25 14:39:51 +000071 !@powershell -nologo -noprofile -Command \
Restorer424da592023-11-11 18:26:00 +000072 $$ext=(Get-Item $?).Extension; \
73 (Get-Content -Raw $(@B)$$ext).Trim() -replace '(\r\n){3,}', '$$1$$1' \
74 ^| Set-Content $(@B)$$ext
75
76
77# TODO:
78#html: noerrors tags $(HTMLS)
79# if exist errors.log (more errors.log)
80
81# TODO:
82#noerrors:
83# $(RM) errors.log
84
85# TODO:
86#.txt.html:
87
88
89# TODO:
90#index.html: help.txt
91
92
93# TODO:
94#vimindex.html: index.txt
95
96
97# TODO:
98#tags.ref tags.html: tags
99
100# Perl version of .txt to .html conversion.
101# There can't be two rules to produce a .html from a .txt file.
102# Just run over all .txt files each time one changes. It's fast anyway.
103perlhtml : tags $(DOCS)
104 vim2html.pl tags $(DOCS)
105
106# Check URLs in the help with "curl" or "powershell".
107test_urls :
Restorer8c14e792023-11-25 14:39:51 +0000108 "$(VIMEXE)" -S test_urls.vim
Restorer424da592023-11-11 18:26:00 +0000109
110clean :
111 $(RM) doctags.exe doctags.obj
112 $(RM) *.html vim-stylesheet.css
113
114
Restorer424da592023-11-11 18:26:00 +0000115arabic.txt :
Restorer8c14e792023-11-25 14:39:51 +0000116 <<touch.bat $@
117@$(TOUCH)
118<<
Restorer424da592023-11-11 18:26:00 +0000119
120farsi.txt :
Restorer8c14e792023-11-25 14:39:51 +0000121 <<touch.bat $@
122@$(TOUCH)
123<<
Restorer424da592023-11-11 18:26:00 +0000124
125hebrew.txt :
Restorer8c14e792023-11-25 14:39:51 +0000126 <<touch.bat $@
127@$(TOUCH)
128<<
Restorer424da592023-11-11 18:26:00 +0000129
130russian.txt :
Restorer8c14e792023-11-25 14:39:51 +0000131 <<touch.bat $@
132@$(TOUCH)
133<<
Restorer424da592023-11-11 18:26:00 +0000134
135gui_w32.txt :
Restorer8c14e792023-11-25 14:39:51 +0000136 <<touch.bat $@
137@$(TOUCH)
138<<
Restorer424da592023-11-11 18:26:00 +0000139
140if_ole.txt :
Restorer8c14e792023-11-25 14:39:51 +0000141 <<touch.bat $@
142@$(TOUCH)
143<<
Restorer424da592023-11-11 18:26:00 +0000144
145os_390.txt :
Restorer8c14e792023-11-25 14:39:51 +0000146 <<touch.bat $@
147@$(TOUCH)
148<<
Restorer424da592023-11-11 18:26:00 +0000149
150os_amiga.txt :
Restorer8c14e792023-11-25 14:39:51 +0000151 <<touch.bat $@
152@$(TOUCH)
153<<
Restorer424da592023-11-11 18:26:00 +0000154
155os_beos.txt :
Restorer8c14e792023-11-25 14:39:51 +0000156 <<touch.bat $@
157@$(TOUCH)
158<<
Restorer424da592023-11-11 18:26:00 +0000159
160os_dos.txt :
Restorer8c14e792023-11-25 14:39:51 +0000161 <<touch.bat $@
162@$(TOUCH)
163<<
Restorer424da592023-11-11 18:26:00 +0000164
165os_haiku.txt :
Restorer8c14e792023-11-25 14:39:51 +0000166 <<touch.bat $@
167@$(TOUCH)
168<<
Restorer424da592023-11-11 18:26:00 +0000169
170os_mac.txt :
Restorer8c14e792023-11-25 14:39:51 +0000171 <<touch.bat $@
172@$(TOUCH)
173<<
Restorer424da592023-11-11 18:26:00 +0000174
175os_mint.txt :
Restorer8c14e792023-11-25 14:39:51 +0000176 <<touch.bat $@
177@$(TOUCH)
178<<
Restorer424da592023-11-11 18:26:00 +0000179
180os_msdos.txt :
Restorer8c14e792023-11-25 14:39:51 +0000181 <<touch.bat $@
182@$(TOUCH)
183<<
Restorer424da592023-11-11 18:26:00 +0000184
185os_os2.txt :
Restorer8c14e792023-11-25 14:39:51 +0000186 <<touch.bat $@
187@$(TOUCH)
188<<
Restorer424da592023-11-11 18:26:00 +0000189
190os_qnx.txt :
Restorer8c14e792023-11-25 14:39:51 +0000191 <<touch.bat $@
192@$(TOUCH)
193<<
Restorer424da592023-11-11 18:26:00 +0000194
195os_risc.txt :
Restorer8c14e792023-11-25 14:39:51 +0000196 <<touch.bat $@
197@$(TOUCH)
198<<
Restorer424da592023-11-11 18:26:00 +0000199
200os_win32.txt :
Restorer8c14e792023-11-25 14:39:51 +0000201 <<touch.bat $@
202@$(TOUCH)
203<<
Restorer424da592023-11-11 18:26:00 +0000204
205convert-all : $(CONVERTED)
206!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
207!ERROR The program "PowerShell" version 3.0 or higher is required to work
208!ENDIF
209
210vim-da.UTF-8.1 : vim-da.1
211!IF DEFINED (ICONV)
212 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
213!ELSE
214# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
215 powershell -nologo -noprofile -Command \
216 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
217 1>nul New-Item -Force -Path . -ItemType file -Name $@
218!ENDIF
219
220vimdiff-da.UTF-8.1 : vimdiff-da.1
221!IF DEFINED (ICONV)
222 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
223!ELSE
224# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
225 powershell -nologo -noprofile -Command \
226 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
227 1>nul New-Item -Force -Path . -ItemType file -Name $@
228!ENDIF
229
230vimtutor-da.UTF-8.1 : vimtutor-da.1
231!IF DEFINED (ICONV)
232 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
233!ELSE
234# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
235 powershell -nologo -noprofile -Command \
236 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
237 1>nul New-Item -Force -Path . -ItemType file -Name $@
238!ENDIF
239
240vim-de.UTF-8.1 : vim-de.1
241!IF DEFINED (ICONV)
242 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
243!ELSE
244# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
245 powershell -nologo -noprofile -Command \
246 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
247 1>nul New-Item -Force -Path . -ItemType file -Name $@
248!ENDIF
249
250evim-fr.UTF-8.1 : evim-fr.1
251!IF DEFINED (ICONV)
252 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
253!ELSE
254# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
255 powershell -nologo -noprofile -Command \
256 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
257 1>nul New-Item -Force -Path . -ItemType file -Name $@
258!ENDIF
259
260vim-fr.UTF-8.1 : vim-fr.1
261!IF DEFINED (ICONV)
262 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
263!ELSE
264# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
265 powershell -nologo -noprofile -Command \
266 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
267 1>nul New-Item -Force -Path . -ItemType file -Name $@
268!ENDIF
269
270vimdiff-fr.UTF-8.1 : vimdiff-fr.1
271!IF DEFINED (ICONV)
272 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
273!ELSE
274# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
275 powershell -nologo -noprofile -Command \
276 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
277 1>nul New-Item -Force -Path . -ItemType file -Name $@
278!ENDIF
279
280vimtutor-fr.UTF-8.1 : vimtutor-fr.1
281!IF DEFINED (ICONV)
282 $(ICONV) -f ISO-8859-1 -t utf-8 $? >$@
283!ELSE
284# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
285 powershell -nologo -noprofile -Command \
286 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
287 1>nul New-Item -Force -Path . -ItemType file -Name $@
288!ENDIF
289
290xxd-fr.UTF-8.1 : xxd-fr.1
291!IF DEFINED (ICONV)
292 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
293!ELSE
294# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
295 powershell -nologo -noprofile -Command \
296 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
297 1>nul New-Item -Force -Path . -ItemType file -Name $@
298!ENDIF
299
300evim-it.UTF-8.1 : evim-it.1
301!IF DEFINED (ICONV)
302 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
303!ELSE
304# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
305 powershell -nologo -noprofile -Command \
306 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
307 1>nul New-Item -Force -Path . -ItemType file -Name $@
308!ENDIF
309
310vim-it.UTF-8.1 : vim-it.1
311!IF DEFINED (ICONV)
312 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
313!ELSE
314# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
315 powershell -nologo -noprofile -Command \
316 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
317 1>nul New-Item -Force -Path . -ItemType file -Name $@
318!ENDIF
319
320vimdiff-it.UTF-8.1 : vimdiff-it.1
321!IF DEFINED (ICONV)
322 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
323!ELSE
324# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
325 powershell -nologo -noprofile -Command \
326 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
327 1>nul New-Item -Force -Path . -ItemType file -Name $@
328!ENDIF
329
330vimtutor-it.UTF-8.1 : vimtutor-it.1
331!IF DEFINED (ICONV)
332 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
333!ELSE
334# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
335 powershell -nologo -noprofile -Command \
336 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
337 1>nul New-Item -Force -Path . -ItemType file -Name $@
338!ENDIF
339
340xxd-it.UTF-8.1 : xxd-it.1
341!IF DEFINED (ICONV)
342 $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
343!ELSE
344# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
345 powershell -nologo -noprofile -Command \
346 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
347 1>nul New-Item -Force -Path . -ItemType file -Name $@
348!ENDIF
349
350evim-pl.UTF-8.1 : evim-pl.1
351!IF DEFINED (ICONV)
352 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
353!ELSE
354# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
355 powershell -nologo -noprofile -Command \
356 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
357 1>nul New-Item -Force -Path . -ItemType file -Name $@
358!ENDIF
359
360vim-pl.UTF-8.1 : vim-pl.1
361!IF DEFINED (ICONV)
362 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
363!ELSE
364# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
365 powershell -nologo -noprofile -Command \
366 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
367 1>nul New-Item -Force -Path . -ItemType file -Name $@
368!ENDIF
369
370vimdiff-pl.UTF-8.1 : vimdiff-pl.1
371!IF DEFINED (ICONV)
372 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
373!ELSE
374# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
375 powershell -nologo -noprofile -Command \
376 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
377 1>nul New-Item -Force -Path . -ItemType file -Name $@
378!ENDIF
379
380vimtutor-pl.UTF-8.1 : vimtutor-pl.1
381!IF DEFINED (ICONV)
382 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
383!ELSE
384# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
385 powershell -nologo -noprofile -Command \
386 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
387 1>nul New-Item -Force -Path . -ItemType file -Name $@
388!ENDIF
389
390xxd-pl.UTF-8.1 : xxd-pl.1
391!IF DEFINED (ICONV)
392 $(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
393!ELSE
394# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
395 powershell -nologo -noprofile -Command \
396 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
397 1>nul New-Item -Force -Path . -ItemType file -Name $@
398!ENDIF
399
400evim-ru.UTF-8.1 : evim-ru.1
401!IF DEFINED (ICONV)
402 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
403!ELSE
404# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
405 powershell -nologo -noprofile -Command \
406 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
407 1>nul New-Item -Force -Path . -ItemType file -Name $@
408!ENDIF
409
410vim-ru.UTF-8.1 : vim-ru.1
411!IF DEFINED (ICONV)
412 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
413!ELSE
414# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
415 powershell -nologo -noprofile -Command \
416 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
417 1>nul New-Item -Force -Path . -ItemType file -Name $@
418!ENDIF
419
420vimdiff-ru.UTF-8.1 : vimdiff-ru.1
421!IF DEFINED (ICONV)
422 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
423!ELSE
424# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
425 powershell -nologo -noprofile -Command \
426 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
427 1>nul New-Item -Force -Path . -ItemType file -Name $@
428!ENDIF
429
430vimtutor-ru.UTF-8.1 : vimtutor-ru.1
431!IF DEFINED (ICONV)
432 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
433!ELSE
434# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
435 powershell -nologo -noprofile -Command \
436 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
437 1>nul New-Item -Force -Path . -ItemType file -Name $@
438!ENDIF
439
440xxd-ru.UTF-8.1 : xxd-ru.1
441!IF DEFINED (ICONV)
442 $(ICONV) -f KOI8-R -t UTF-8 $? >$@
443!ELSE
444# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
445 powershell -nologo -noprofile -Command \
446 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
447 1>nul New-Item -Force -Path . -ItemType file -Name $@
448!ENDIF
449
450evim-tr.UTF-8.1 : evim-tr.1
451!IF DEFINED (ICONV)
452 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
453!ELSE
454# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
455 powershell -nologo -noprofile -Command \
456 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
457 1>nul New-Item -Force -Path . -ItemType file -Name $@
458!ENDIF
459
460vim-tr.UTF-8.1 : vim-tr.1
461!IF DEFINED (ICONV)
462 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
463!ELSE
464# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
465 powershell -nologo -noprofile -Command \
466 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
467 1>nul New-Item -Force -Path . -ItemType file -Name $@
468!ENDIF
469
470vimdiff-tr.UTF-8.1 : vimdiff-tr.1
471!IF DEFINED (ICONV)
472 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
473!ELSE
474# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
475 powershell -nologo -noprofile -Command \
476 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
477 1>nul New-Item -Force -Path . -ItemType file -Name $@
478!ENDIF
479
480vimtutor-tr.UTF-8.1 : vimtutor-tr.1
481!IF DEFINED (ICONV)
482 $(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
483!ELSE
484# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
485 powershell -nologo -noprofile -Command \
486 [IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
487 1>nul New-Item -Force -Path . -ItemType file -Name $@
488!ENDIF
489
Restorer424da592023-11-11 18:26:00 +0000490# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: