Restorer | 64c6bfd | 2023-11-26 14:01:56 +0000 | [diff] [blame^] | 1 | # |
| 2 | # Makefile for converting the Vim tutorial on Windows. |
| 3 | # |
| 4 | # 21.11.23, Restorer, restorer@mail2k.ru |
| 5 | |
| 6 | |
| 7 | !IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2 |
| 8 | !ERROR The program "PowerShell" version 3.0 or higher is required to work |
| 9 | !ENDIF |
| 10 | |
| 11 | # Common components |
| 12 | !INCLUDE Make_all.mak |
| 13 | |
| 14 | # Correct the following line for the directory where iconv is installed. |
| 15 | # Please do not put the path in quotes. |
| 16 | ICONV_PATH = D:\Programs\GetText\bin |
| 17 | |
| 18 | # In case some package like GnuWin32, UnixUtils, gettext |
| 19 | # or something similar is installed on the system. |
| 20 | # If the "iconv" program is installed on the system, but it is not registered |
| 21 | # in the %PATH% environment variable, then specify the full path to this file. |
| 22 | !IF EXIST ("iconv.exe") |
| 23 | ICONV = "iconv.exe" |
| 24 | !ELSEIF EXIST ("$(ICONV_PATH)\iconv.exe") |
| 25 | ICONV = "$(ICONV_PATH)\iconv.exe" |
| 26 | !ENDIF |
| 27 | |
| 28 | RM = del /q |
| 29 | CP = copy /y |
| 30 | |
| 31 | all : $(CONVERTED) |
| 32 | |
| 33 | tutor.utf-8 : tutor |
| 34 | !IF DEFINED (ICONV) |
| 35 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 36 | !ELSE |
| 37 | powershell -nologo -noprofile -Command \ |
| 38 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 39 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 40 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 41 | !ENDIF |
| 42 | |
| 43 | tutor.bar : tutor.bar.utf-8 |
| 44 | !IF DEFINED (ICONV) |
| 45 | $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ |
| 46 | !ELSE |
| 47 | powershell -nologo -noprofile -Command \ |
| 48 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 49 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 50 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 51 | [System.Text.Encoding]::GetEncoding(28591)) |
| 52 | !ENDIF |
| 53 | |
| 54 | tutor.ca.utf-8 : tutor.ca |
| 55 | !IF DEFINED (ICONV) |
| 56 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 57 | !ELSE |
| 58 | powershell -nologo -noprofile -Command \ |
| 59 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 60 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 61 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 62 | !ENDIF |
| 63 | |
| 64 | tutor.de.utf-8 : tutor.de |
| 65 | !IF DEFINED (ICONV) |
| 66 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 67 | !ELSE |
| 68 | powershell -nologo -noprofile -Command \ |
| 69 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 70 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 71 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 72 | !ENDIF |
| 73 | |
| 74 | tutor.el : tutor.el.utf-8 |
| 75 | !IF DEFINED (ICONV) |
| 76 | $(ICONV) -f UTF-8 -t ISO-8859-7 $? >$@ |
| 77 | !ELSE |
| 78 | powershell -nologo -noprofile -Command \ |
| 79 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 80 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 81 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 82 | [System.Text.Encoding]::GetEncoding(28597)) |
| 83 | !ENDIF |
| 84 | |
| 85 | tutor.el.cp737 : tutor.el.utf-8 |
| 86 | !IF DEFINED (ICONV) |
| 87 | $(ICONV) -f UTF-8 -t CP737 $? >$@ |
| 88 | !ELSE |
| 89 | powershell -nologo -noprofile -Command \ |
| 90 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 91 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 92 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 93 | [System.Text.Encoding]::GetEncoding(737)) |
| 94 | !ENDIF |
| 95 | |
| 96 | tutor.eo : tutor.eo.utf-8 |
| 97 | !IF DEFINED (ICONV) |
| 98 | $(ICONV) -f UTF-8 -t ISO-8859-3 $? >$@ |
| 99 | !ELSE |
| 100 | powershell -nologo -noprofile -Command \ |
| 101 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 102 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 103 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 104 | [System.Text.Encoding]::GetEncoding(28593)) |
| 105 | !ENDIF |
| 106 | |
| 107 | tutor.es : tutor.es.utf-8 |
| 108 | !IF DEFINED (ICONV) |
| 109 | $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ |
| 110 | !ELSE |
| 111 | powershell -nologo -noprofile -Command \ |
| 112 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 113 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 114 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 115 | [System.Text.Encoding]::GetEncoding(28591)) |
| 116 | !ENDIF |
| 117 | |
| 118 | tutor.fr.utf-8 : tutor.fr |
| 119 | !IF DEFINED (ICONV) |
| 120 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 121 | !ELSE |
| 122 | powershell -nologo -noprofile -Command \ |
| 123 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 124 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 125 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 126 | !ENDIF |
| 127 | |
| 128 | tutor.hr : tutor.hr.utf-8 |
| 129 | !IF DEFINED (ICONV) |
| 130 | $(ICONV) -f UTF-8 -t ISO-8859-2 $? >$@ |
| 131 | !ELSE |
| 132 | powershell -nologo -noprofile -Command \ |
| 133 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 134 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 135 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 136 | [System.Text.Encoding]::GetEncoding(28592)) |
| 137 | !ENDIF |
| 138 | |
| 139 | tutor.hr.cp1250 : tutor.hr.utf-8 |
| 140 | !IF DEFINED (ICONV) |
| 141 | $(ICONV) -f UTF-8 -t CP1250 $? >$@ |
| 142 | !ELSE |
| 143 | powershell -nologo -noprofile -Command \ |
| 144 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 145 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 146 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 147 | [System.Text.Encoding]::GetEncoding(1250)) |
| 148 | !ENDIF |
| 149 | |
| 150 | tutor.hu : tutor.hu.utf-8 |
| 151 | !IF DEFINED (ICONV) |
| 152 | $(ICONV) -f UTF-8 -t ISO-8859-2 $? >$@ |
| 153 | !ELSE |
| 154 | powershell -nologo -noprofile -Command \ |
| 155 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 156 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 157 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 158 | [System.Text.Encoding]::GetEncoding(28592)) |
| 159 | !ENDIF |
| 160 | |
| 161 | tutor.hu.cp1250 : tutor.hu.utf-8 |
| 162 | !IF DEFINED (ICONV) |
| 163 | $(ICONV) -f UTF-8 -t CP1250 $? >$@ |
| 164 | !ELSE |
| 165 | powershell -nologo -noprofile -Command \ |
| 166 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 167 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 168 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 169 | [System.Text.Encoding]::GetEncoding(1250)) |
| 170 | !ENDIF |
| 171 | |
| 172 | tutor.it.utf-8 : tutor.it |
| 173 | !IF DEFINED (ICONV) |
| 174 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 175 | !ELSE |
| 176 | powershell -nologo -noprofile -Command \ |
| 177 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 178 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 179 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 180 | !ENDIF |
| 181 | |
| 182 | tutor.ja.sjis : tutor.ja.utf-8 |
| 183 | !IF DEFINED (ICONV) |
| 184 | $(ICONV) -f UTF-8 -t CP932 $? >$@ |
| 185 | !ELSE |
| 186 | powershell -nologo -noprofile -Command \ |
| 187 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 188 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 189 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 190 | [System.Text.Encoding]::GetEncoding(932)) |
| 191 | !ENDIF |
| 192 | |
| 193 | tutor.ja.euc : tutor.ja.utf-8 |
| 194 | !IF DEFINED (ICONV) |
| 195 | $(ICONV) -f UTF-8 -t EUC-JP $? >$@ |
| 196 | !ELSE |
| 197 | powershell -nologo -noprofile -Command \ |
| 198 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 199 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 200 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 201 | [System.Text.Encoding]::GetEncoding(51932)) |
| 202 | !ENDIF |
| 203 | |
| 204 | tutor.ko.euc : tutor.ko.utf-8 |
| 205 | !IF DEFINED (ICONV) |
| 206 | $(ICONV) -f UTF-8 -t EUC-KR $? >$@ |
| 207 | !ELSE |
| 208 | powershell -nologo -noprofile -Command \ |
| 209 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 210 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 211 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 212 | [System.Text.Encoding]::GetEncoding(51949)) |
| 213 | !ENDIF |
| 214 | |
| 215 | tutor.nl : tutor.nl.utf-8 |
| 216 | !IF DEFINED (ICONV) |
| 217 | $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ |
| 218 | !ELSE |
| 219 | powershell -nologo -noprofile -Command \ |
| 220 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 221 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 222 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 223 | [System.Text.Encoding]::GetEncoding(28591)) |
| 224 | !ENDIF |
| 225 | |
| 226 | tutor.no.utf-8 : tutor.no |
| 227 | !IF DEFINED (ICONV) |
| 228 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 229 | !ELSE |
| 230 | powershell -nologo -noprofile -Command \ |
| 231 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 232 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 233 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 234 | !ENDIF |
| 235 | |
| 236 | # nb is an alias for no |
| 237 | tutor.nb : tutor.no |
| 238 | $(CP) tutor.no tutor.nb |
| 239 | |
| 240 | tutor.nb.utf-8 : tutor.no.utf-8 |
| 241 | $(CP) tutor.no.utf-8 tutor.nb.utf-8 |
| 242 | |
| 243 | tutor.ru : tutor.ru.utf-8 |
| 244 | !IF DEFINED (ICONV) |
| 245 | $(ICONV) -f UTF-8 -t KOI8-R $? >$@ |
| 246 | !ELSE |
| 247 | powershell -nologo -noprofile -Command \ |
| 248 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 249 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 250 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 251 | [System.Text.Encoding]::GetEncoding(20866)) |
| 252 | !ENDIF |
| 253 | |
| 254 | tutor.ru.cp1251 : tutor.ru.utf-8 |
| 255 | !IF DEFINED (ICONV) |
| 256 | $(ICONV) -f UTF-8 -t CP1251 $? >$@ |
| 257 | !ELSE |
| 258 | powershell -nologo -noprofile -Command \ |
| 259 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 260 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 261 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 262 | [System.Text.Encoding]::GetEncoding(1251)) |
| 263 | !ENDIF |
| 264 | |
| 265 | tutor.sv.utf-8 : tutor.sv |
| 266 | !IF DEFINED (ICONV) |
| 267 | $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ |
| 268 | !ELSE |
| 269 | powershell -nologo -noprofile -Command \ |
| 270 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 271 | [System.Text.Encoding]::GetEncoding(28591)) ^| \ |
| 272 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 273 | !ENDIF |
| 274 | |
| 275 | tutor.tr.iso9 : tutor.tr.utf-8 |
| 276 | !IF DEFINED (ICONV) |
| 277 | $(ICONV) -f UTF-8 -t ISO-8859-9 $? >$@ |
| 278 | !ELSE |
| 279 | powershell -nologo -noprofile -Command \ |
| 280 | [System.IO.File]::WriteAllText(\"$@\", \ |
| 281 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 282 | [System.Text.Encoding]::GetEncoding(65001)), \ |
| 283 | [System.Text.Encoding]::GetEncoding(28599)) |
| 284 | !ENDIF |
| 285 | |
| 286 | tutor.zh.utf-8 : tutor.zh.big5 |
| 287 | powershell -nologo -noprofile -Command \ |
| 288 | [System.IO.File]::ReadAllText(\"$?\", \ |
| 289 | [System.Text.Encoding]::GetEncoding(950)) ^| \ |
| 290 | 1>nul New-Item -Force -ItemType file -Path . -Name $@ |
| 291 | |
| 292 | clean : $(CONVERTED) |
| 293 | !$(RM) $** |
| 294 | |
| 295 | # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: |