Skip to content

Commit

Permalink
runtime(doc): improve doc makefiles, add clean rule (vim#13855)
Browse files Browse the repository at this point in the history
Signed-off-by: RestorerZ <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
  • Loading branch information
RestorerZ authored Jan 22, 2024
1 parent e8ff5e6 commit 459867b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 65 deletions.
77 changes: 39 additions & 38 deletions runtime/doc/Make_mvc.mak
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ ICONV = "$(ICONV_PATH)\iconv.exe"
!ENDIF

RM = del /q
PS = PowerShell.exe

PSFLAGS = -NoLogo -NoProfile -Command

.SUFFIXES :
.SUFFIXES : .c .o .txt .html
Expand All @@ -49,9 +52,9 @@ all : tags perlhtml $(CONVERTED)
# Use "doctags" to generate the tags file. Only works for English!
tags : doctags $(DOCS)
doctags.exe $(DOCS) | sort /L C /O tags
powershell -nologo -noprofile -Command \
"(Get-Content -Raw tags | Get-Unique | % {$$_ -replace \"`r\", \"\"}) \
| New-Item -Force -Path . -ItemType file -Name tags"
$(PS) $(PSFLAGS) \
(Get-Content -Raw tags ^| Get-Unique ^| %%{$$_ -replace \"`r\", \"\"})\
^| New-Item -Force -Path . -ItemType file -Name tags

doctags : doctags.c
$(CC) doctags.c
Expand All @@ -64,12 +67,10 @@ vimtags : $(DOCS)


uganda.nsis.txt : uganda.???
!@powershell -nologo -noprofile -Command \
$$ext=(Get-Item $?).Extension; (Get-Content $? ^| \
% {$$_ -replace '\s*\*[-a-zA-Z0-9.]*\*', '' -replace 'vim:tw=78:.*', ''}) \
!@$(PS) $(PSFLAGS) $$ext=(Get-Item $?).Extension; (Get-Content $? ^| \
%%{$$_ -replace '\s*\*[-a-zA-Z0-9.]*\*', '' -replace 'vim:tw=78:.*', ''})\
^| Set-Content $*$$ext
!@powershell -nologo -noprofile -Command \
$$ext=(Get-Item $?).Extension; \
!@$(PS) $(PSFLAGS) $$ext=(Get-Item $?).Extension; \
(Get-Content -Raw $(@B)$$ext).Trim() -replace '(\r\n){3,}', '$$1$$1' \
^| Set-Content $(@B)$$ext

Expand Down Expand Up @@ -105,7 +106,7 @@ perlhtml : tags $(DOCS)

# Check URLs in the help with "curl" or "powershell".
test_urls :
"$(VIMEXE)" -S test_urls.vim
"$(VIMEXE)" --clean -S test_urls.vim

clean :
$(RM) doctags.exe doctags.obj
Expand Down Expand Up @@ -203,7 +204,7 @@ os_win32.txt :
<<

convert-all : $(CONVERTED)
!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2
!IF [$(PS) $(PSFLAGS) "exit $$psversiontable.psversion.major"] == 2
!ERROR The program "PowerShell" version 3.0 or higher is required to work
!ENDIF

Expand All @@ -212,7 +213,7 @@ vim-da.UTF-8.1 : vim-da.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -222,7 +223,7 @@ vimdiff-da.UTF-8.1 : vimdiff-da.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -232,7 +233,7 @@ vimtutor-da.UTF-8.1 : vimtutor-da.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -242,7 +243,7 @@ vim-de.UTF-8.1 : vim-de.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -252,7 +253,7 @@ evim-fr.UTF-8.1 : evim-fr.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -262,7 +263,7 @@ vim-fr.UTF-8.1 : vim-fr.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -272,7 +273,7 @@ vimdiff-fr.UTF-8.1 : vimdiff-fr.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -282,7 +283,7 @@ vimtutor-fr.UTF-8.1 : vimtutor-fr.1
$(ICONV) -f ISO-8859-1 -t utf-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -292,7 +293,7 @@ xxd-fr.UTF-8.1 : xxd-fr.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -302,7 +303,7 @@ evim-it.UTF-8.1 : evim-it.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -312,7 +313,7 @@ vim-it.UTF-8.1 : vim-it.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -322,7 +323,7 @@ vimdiff-it.UTF-8.1 : vimdiff-it.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -332,7 +333,7 @@ vimtutor-it.UTF-8.1 : vimtutor-it.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -342,7 +343,7 @@ xxd-it.UTF-8.1 : xxd-it.1
$(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28591)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -352,7 +353,7 @@ evim-pl.UTF-8.1 : evim-pl.1
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -362,7 +363,7 @@ vim-pl.UTF-8.1 : vim-pl.1
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -372,7 +373,7 @@ vimdiff-pl.UTF-8.1 : vimdiff-pl.1
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -382,7 +383,7 @@ vimtutor-pl.UTF-8.1 : vimtutor-pl.1
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -392,7 +393,7 @@ xxd-pl.UTF-8.1 : xxd-pl.1
$(ICONV) -f ISO-8859-2 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28592)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -402,7 +403,7 @@ evim-ru.UTF-8.1 : evim-ru.1
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -412,7 +413,7 @@ vim-ru.UTF-8.1 : vim-ru.1
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -422,7 +423,7 @@ vimdiff-ru.UTF-8.1 : vimdiff-ru.1
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -432,7 +433,7 @@ vimtutor-ru.UTF-8.1 : vimtutor-ru.1
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -442,7 +443,7 @@ xxd-ru.UTF-8.1 : xxd-ru.1
$(ICONV) -f KOI8-R -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(20866)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -452,7 +453,7 @@ evim-tr.UTF-8.1 : evim-tr.1
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -462,7 +463,7 @@ vim-tr.UTF-8.1 : vim-tr.1
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -472,7 +473,7 @@ vimdiff-tr.UTF-8.1 : vimdiff-tr.1
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand All @@ -482,7 +483,7 @@ vimtutor-tr.UTF-8.1 : vimtutor-tr.1
$(ICONV) -f ISO-8859-9 -t UTF-8 $? >$@
!ELSE
# Conversion to UTF-8 encoding without BOM and with UNIX-like line ending
powershell -nologo -noprofile -Command \
$(PS) $(PSFLAGS) \
[IO.File]::ReadAllText(\"$?\", [Text.Encoding]::GetEncoding(28599)) ^| \
1>nul New-Item -Force -Path . -ItemType file -Name $@
!ENDIF
Expand Down
Loading

0 comments on commit 459867b

Please sign in to comment.