runtime(doc): improve doc makefiles, add clean rule (#13855)
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/Make_mvc.mak b/runtime/doc/Make_mvc.mak
index 656cf75..850d86b 100644
--- a/runtime/doc/Make_mvc.mak
+++ b/runtime/doc/Make_mvc.mak
@@ -39,6 +39,9 @@
!ENDIF
RM = del /q
+PS = PowerShell.exe
+
+PSFLAGS = -NoLogo -NoProfile -Command
.SUFFIXES :
.SUFFIXES : .c .o .txt .html
@@ -49,9 +52,9 @@
# 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
@@ -64,12 +67,10 @@
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
@@ -105,7 +106,7 @@
# 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
@@ -203,7 +204,7 @@
<<
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
@@ -212,7 +213,7 @@
$(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
@@ -222,7 +223,7 @@
$(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
@@ -232,7 +233,7 @@
$(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
@@ -242,7 +243,7 @@
$(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
@@ -252,7 +253,7 @@
$(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
@@ -262,7 +263,7 @@
$(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
@@ -272,7 +273,7 @@
$(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
@@ -282,7 +283,7 @@
$(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
@@ -292,7 +293,7 @@
$(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
@@ -302,7 +303,7 @@
$(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
@@ -312,7 +313,7 @@
$(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
@@ -322,7 +323,7 @@
$(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
@@ -332,7 +333,7 @@
$(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
@@ -342,7 +343,7 @@
$(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
@@ -352,7 +353,7 @@
$(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
@@ -362,7 +363,7 @@
$(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
@@ -372,7 +373,7 @@
$(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
@@ -382,7 +383,7 @@
$(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
@@ -392,7 +393,7 @@
$(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
@@ -402,7 +403,7 @@
$(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
@@ -412,7 +413,7 @@
$(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
@@ -422,7 +423,7 @@
$(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
@@ -432,7 +433,7 @@
$(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
@@ -442,7 +443,7 @@
$(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
@@ -452,7 +453,7 @@
$(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
@@ -462,7 +463,7 @@
$(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
@@ -472,7 +473,7 @@
$(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
@@ -482,7 +483,7 @@
$(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