patch 9.1.1675: MS-Windows: Makefiles can be refactored

Problem:  MS-Windows: Makefiles can be refactored
Solution: Refactor using a common tools.mak, make some style changes
          (RestorerZ).

closes: #18060

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
RestorerZ
2025-08-23 17:00:17 +02:00
committed by Christian Brabandt
parent d5a6310108
commit e34bdb844f
13 changed files with 1372 additions and 1278 deletions

View File

@ -1,16 +1,20 @@
#
# Makefile for the Vim documentation on Windows
#
# 20.03.24, Restorer, <restorer@mail2k.ru>
# 2024-03-20, Restorer, <restorer@mail2k.ru>
#
# included common tools
!INCLUDE ..\..\src\auto\nmake\tools.mak
# Common components
!INCLUDE Make_all.mak
!INCLUDE .\Make_all.mak
# TODO: to think about what to use instead of awk. PowerShell?
#AWK =
# Correct the following line for the where executable file vim is installed.
# Correct the following line for the where executable file Vim is installed.
# Please do not put the path in quotes.
VIMPROG = ..\..\src\vim.exe
@ -18,16 +22,6 @@ VIMPROG = ..\..\src\vim.exe
# Please do not put the path in quotes.
ICONV_PATH = D:\Programs\GetText\bin
# In case some package like GnuWin32, UnixUtils
# or something similar is installed on the system.
# If the "touch" program is installed on the system, but it is not registered
# in the %PATH% environment variable, then specify the full path to this file.
!IF EXIST ("touch.exe")
TOUCH = touch.exe %1
!ELSE
TOUCH = if exist %1 ( copy /b %1+,, ) else ( type nul >%1 )
!ENDIF
# In case some package like GnuWin32, UnixUtils, gettext
# or something similar is installed on the system.
# If the "iconv" program is installed on the system, but it is not registered
@ -38,11 +32,6 @@ ICONV = iconv.exe
ICONV = "$(ICONV_PATH)\iconv.exe"
!ENDIF
RM = del /q
PS = PowerShell.exe
PSFLAGS = -NoLogo -NoProfile -Command
.SUFFIXES :
.SUFFIXES : .c .o .txt .html
@ -53,7 +42,8 @@ all : tags perlhtml $(CONVERTED)
tags : doctags $(DOCS)
doctags.exe $(DOCS) | sort /L C /O tags
$(PS) $(PSFLAGS) \
(Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ -replace \"`r\", \"\"}) \
(Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ \
-replace \"`r\", \"\"}) \
^| New-Item -Path . -Name tags -ItemType file -Force
doctags : doctags.c
@ -63,7 +53,7 @@ doctags : doctags.c
# Use Vim to generate the tags file. Can only be used when Vim has been
# compiled and installed. Supports multiple languages.
vimtags : $(DOCS)
@"$(VIMPROG)" --clean -esX -V1 -u doctags.vim
@ "$(VIMPROG)" --clean -esX -V1 -u doctags.vim
# TODO:
#html: noerrors tags $(HTMLS)
@ -104,99 +94,96 @@ clean :
arabic.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
farsi.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
hebrew.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
russian.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
gui_w32.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
if_ole.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_390.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_amiga.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_beos.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_dos.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_haiku.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_mac.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_mint.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_msdos.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_os2.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_qnx.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_risc.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
os_win32.txt :
<<touch.bat $@
@ <<touch.bat $@
@$(TOUCH)
<<
convert-all : $(CONVERTED)
!IF [$(PS) $(PSFLAGS) "exit $$psversiontable.psversion.major"] == 2
!ERROR The program "PowerShell" version 3.0 or higher is required to work
!ENDIF
vim-da.UTF-8.1 : vim-da.1
!IF DEFINED (ICONV)
@ -204,8 +191,9 @@ vim-da.UTF-8.1 : vim-da.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimdiff-da.UTF-8.1 : vimdiff-da.1
@ -214,8 +202,9 @@ vimdiff-da.UTF-8.1 : vimdiff-da.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimtutor-da.UTF-8.1 : vimtutor-da.1
@ -224,8 +213,9 @@ vimtutor-da.UTF-8.1 : vimtutor-da.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vim-de.UTF-8.1 : vim-de.1
@ -234,8 +224,9 @@ vim-de.UTF-8.1 : vim-de.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
evim-fr.UTF-8.1 : evim-fr.1
@ -244,8 +235,9 @@ evim-fr.UTF-8.1 : evim-fr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vim-fr.UTF-8.1 : vim-fr.1
@ -254,8 +246,9 @@ vim-fr.UTF-8.1 : vim-fr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimdiff-fr.UTF-8.1 : vimdiff-fr.1
@ -264,8 +257,9 @@ vimdiff-fr.UTF-8.1 : vimdiff-fr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimtutor-fr.UTF-8.1 : vimtutor-fr.1
@ -274,8 +268,9 @@ vimtutor-fr.UTF-8.1 : vimtutor-fr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
xxd-fr.UTF-8.1 : xxd-fr.1
@ -284,8 +279,9 @@ xxd-fr.UTF-8.1 : xxd-fr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
evim-it.UTF-8.1 : evim-it.1
@ -294,8 +290,9 @@ evim-it.UTF-8.1 : evim-it.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vim-it.UTF-8.1 : vim-it.1
@ -304,8 +301,9 @@ vim-it.UTF-8.1 : vim-it.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimdiff-it.UTF-8.1 : vimdiff-it.1
@ -314,8 +312,9 @@ vimdiff-it.UTF-8.1 : vimdiff-it.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimtutor-it.UTF-8.1 : vimtutor-it.1
@ -324,8 +323,9 @@ vimtutor-it.UTF-8.1 : vimtutor-it.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
xxd-it.UTF-8.1 : xxd-it.1
@ -334,8 +334,9 @@ xxd-it.UTF-8.1 : xxd-it.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
evim-pl.UTF-8.1 : evim-pl.1
@ -344,8 +345,9 @@ evim-pl.UTF-8.1 : evim-pl.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vim-pl.UTF-8.1 : vim-pl.1
@ -354,8 +356,9 @@ vim-pl.UTF-8.1 : vim-pl.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimdiff-pl.UTF-8.1 : vimdiff-pl.1
@ -364,8 +367,9 @@ vimdiff-pl.UTF-8.1 : vimdiff-pl.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimtutor-pl.UTF-8.1 : vimtutor-pl.1
@ -374,8 +378,9 @@ vimtutor-pl.UTF-8.1 : vimtutor-pl.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
xxd-pl.UTF-8.1 : xxd-pl.1
@ -384,8 +389,9 @@ xxd-pl.UTF-8.1 : xxd-pl.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
evim-ru.UTF-8.1 : evim-ru.1
@ -394,8 +400,9 @@ evim-ru.UTF-8.1 : evim-ru.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vim-ru.UTF-8.1 : vim-ru.1
@ -404,8 +411,9 @@ vim-ru.UTF-8.1 : vim-ru.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimdiff-ru.UTF-8.1 : vimdiff-ru.1
@ -414,8 +422,9 @@ vimdiff-ru.UTF-8.1 : vimdiff-ru.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimtutor-ru.UTF-8.1 : vimtutor-ru.1
@ -424,8 +433,9 @@ vimtutor-ru.UTF-8.1 : vimtutor-ru.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
xxd-ru.UTF-8.1 : xxd-ru.1
@ -434,8 +444,9 @@ xxd-ru.UTF-8.1 : xxd-ru.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
evim-tr.UTF-8.1 : evim-tr.1
@ -444,8 +455,9 @@ evim-tr.UTF-8.1 : evim-tr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vim-tr.UTF-8.1 : vim-tr.1
@ -454,8 +466,9 @@ vim-tr.UTF-8.1 : vim-tr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimdiff-tr.UTF-8.1 : vimdiff-tr.1
@ -464,8 +477,9 @@ vimdiff-tr.UTF-8.1 : vimdiff-tr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
vimtutor-tr.UTF-8.1 : vimtutor-tr.1
@ -474,8 +488,9 @@ vimtutor-tr.UTF-8.1 : vimtutor-tr.1
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
[IO.File]::ReadAllText(\"$?\", \
[Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Path . -Name $@ -ItemType file -Force
!ENDIF
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make:
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=79 ft=make: