blob: fc042872cf4e97c216e2134e396b6d5588d349c6 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001#
2# Makefile for the Vim documentation on Unix
3#
4# If you get "don't know how to make scratch", first run make in the source
5# directory. Or remove the include below.
6
7AWK = awk
8
9# Set to $(VIMTARGET) when executed from src/Makefile.
10VIMEXE = vim
11
12# include the config.mk from the source directory. It's only needed to set
13# AWK, used for "make html". Comment this out if the include gives problems.
14include ../../src/auto/config.mk
15
Restorerb23c1fc2023-11-04 08:57:09 +000016# Common components
Restorer424da592023-11-11 18:26:00 +000017include Make_all.mak
Bram Moolenaar4317d9b2005-03-18 20:25:31 +000018
Bram Moolenaar071d4272004-06-13 20:20:40 +000019.SUFFIXES:
20.SUFFIXES: .c .o .txt .html
21
Bram Moolenaare37d50a2008-08-06 17:06:04 +000022all: tags vim.man evim.man vimdiff.man vimtutor.man xxd.man $(CONVERTED)
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
24# Use Vim to generate the tags file. Can only be used when Vim has been
25# compiled and installed. Supports multiple languages.
26vimtags: $(DOCS)
Bram Moolenaar23877732020-01-21 22:13:42 +010027 @$(VIMEXE) --clean -esX -V1 -u doctags.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000028
29# Use "doctags" to generate the tags file. Only works for English!
30tags: doctags $(DOCS)
31 ./doctags $(DOCS) | LANG=C LC_ALL=C sort >tags
32 uniq -d -2 tags
33
34doctags: doctags.c
35 $(CC) doctags.c -o doctags
36
37vim.man: vim.1
38 nroff -man vim.1 | sed -e s/.//g > vim.man
39
Bram Moolenaare37d50a2008-08-06 17:06:04 +000040evim.man: evim.1
41 nroff -man evim.1 | sed -e s/.//g > evim.man
42
Bram Moolenaar071d4272004-06-13 20:20:40 +000043vimdiff.man: vimdiff.1
44 nroff -man vimdiff.1 | sed -e s/.//g > vimdiff.man
45
46vimtutor.man: vimtutor.1
47 nroff -man vimtutor.1 | sed -e s/.//g > vimtutor.man
48
49xxd.man: xxd.1
50 nroff -man xxd.1 | sed -e s/.//g > xxd.man
51
52uganda.nsis.txt: uganda.txt
Bram Moolenaar7cb769a2017-11-16 17:36:02 +010053 sed -e 's/[ ]*\*[-a-zA-Z0-9.]*\*//g' -e 's/vim:tw=78:.*//' \
Bram Moolenaar071d4272004-06-13 20:20:40 +000054 uganda.txt | uniq >uganda.nsis.txt
55
56# Awk version of .txt to .html conversion.
Bram Moolenaarcdda8fe2010-07-21 20:40:27 +020057html: noerrors tags $(HTMLS)
Bram Moolenaar071d4272004-06-13 20:20:40 +000058 @if test -f errors.log; then more errors.log; fi
59
60noerrors:
61 -rm -f errors.log
62
Bram Moolenaarcdda8fe2010-07-21 20:40:27 +020063$(HTMLS): tags.ref
64
Bram Moolenaar071d4272004-06-13 20:20:40 +000065.txt.html:
66 $(AWK) -f makehtml.awk $< >$@
67
Bram Moolenaar371d5402006-03-20 21:47:49 +000068# index.html is the starting point for HTML, but for the help files it is
69# help.txt. Therefore use vimindex.html for index.txt.
70index.html: help.txt
71 $(AWK) -f makehtml.awk help.txt >index.html
72
73vimindex.html: index.txt
74 $(AWK) -f makehtml.awk index.txt >vimindex.html
75
Bram Moolenaar071d4272004-06-13 20:20:40 +000076tags.ref tags.html: tags
77 $(AWK) -f maketags.awk tags >tags.html
78
79# Perl version of .txt to .html conversion.
80# There can't be two rules to produce a .html from a .txt file.
81# Just run over all .txt files each time one changes. It's fast anyway.
82perlhtml: tags $(DOCS)
83 ./vim2html.pl tags $(DOCS)
84
Bram Moolenaar2f058492017-11-30 20:27:52 +010085# Check URLs in the help with "curl".
86test_urls:
87 vim -S test_urls.vim
88
Bram Moolenaar071d4272004-06-13 20:20:40 +000089clean:
Bram Moolenaar08fc4842020-07-10 20:40:23 +020090 -rm -f doctags *.html tags.ref
Bram Moolenaar071d4272004-06-13 20:20:40 +000091
92# These files are in the extra archive, skip if not present
93
94arabic.txt:
95 touch arabic.txt
96
97farsi.txt:
98 touch farsi.txt
99
100hebrew.txt:
101 touch hebrew.txt
102
103russian.txt:
104 touch russian.txt
105
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106gui_w32.txt:
107 touch gui_w32.txt
108
109if_ole.txt:
110 touch if_ole.txt
111
112os_390.txt:
113 touch os_390.txt
114
115os_amiga.txt:
116 touch os_amiga.txt
117
118os_beos.txt:
119 touch os_beos.txt
120
121os_dos.txt:
122 touch os_dos.txt
123
Bram Moolenaarb3f74062020-02-26 16:16:53 +0100124os_haiku.txt:
125 touch os_haiku.txt
126
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127os_mac.txt:
128 touch os_mac.txt
129
130os_mint.txt:
131 touch os_mint.txt
132
133os_msdos.txt:
134 touch os_msdos.txt
135
136os_os2.txt:
137 touch os_os2.txt
138
139os_qnx.txt:
140 touch os_qnx.txt
141
142os_risc.txt:
143 touch os_risc.txt
144
145os_win32.txt:
146 touch os_win32.txt
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000147
Bram Moolenaarb475fb92006-03-02 22:40:52 +0000148# Note that $< works with GNU make while $> works for BSD make.
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000149# Is there a solution that works for both??
Restorer424da592023-11-11 18:26:00 +0000150vim-da.UTF-8.1: vim-da.1
Restorerb23c1fc2023-11-04 08:57:09 +0000151 iconv -f latin1 -t utf-8 $< >$@
152
Restorer424da592023-11-11 18:26:00 +0000153vimdiff-da.UTF-8.1: vimdiff-da.1
Restorerb23c1fc2023-11-04 08:57:09 +0000154 iconv -f latin1 -t utf-8 $< >$@
155
Restorer424da592023-11-11 18:26:00 +0000156vimtutor-da.UTF-8.1: vimtutor-da.1
Restorerb23c1fc2023-11-04 08:57:09 +0000157 iconv -f latin1 -t utf-8 $< >$@
158
Restorer424da592023-11-11 18:26:00 +0000159vim-de.UTF-8.1: vim-de.1
Restorerb23c1fc2023-11-04 08:57:09 +0000160 iconv -f latin1 -t utf-8 $< >$@
161
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000162vim-fr.UTF-8.1: vim-fr.1
163 iconv -f latin1 -t utf-8 $< >$@
164
165evim-fr.UTF-8.1: evim-fr.1
166 iconv -f latin1 -t utf-8 $< >$@
167
168vimdiff-fr.UTF-8.1: vimdiff-fr.1
169 iconv -f latin1 -t utf-8 $< >$@
170
171vimtutor-fr.UTF-8.1: vimtutor-fr.1
172 iconv -f latin1 -t utf-8 $< >$@
173
174xxd-fr.UTF-8.1: xxd-fr.1
175 iconv -f latin1 -t utf-8 $< >$@
176
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000177vim-it.UTF-8.1: vim-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000178 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000179
180evim-it.UTF-8.1: evim-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000181 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000182
183vimdiff-it.UTF-8.1: vimdiff-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000184 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000185
186vimtutor-it.UTF-8.1: vimtutor-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000187 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000188
189xxd-it.UTF-8.1: xxd-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000190 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000191
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000192vim-pl.UTF-8.1: vim-pl.1
193 iconv -f latin2 -t utf-8 $< >$@
194
195evim-pl.UTF-8.1: evim-pl.1
196 iconv -f latin2 -t utf-8 $< >$@
197
198vimdiff-pl.UTF-8.1: vimdiff-pl.1
199 iconv -f latin2 -t utf-8 $< >$@
200
201vimtutor-pl.UTF-8.1: vimtutor-pl.1
202 iconv -f latin2 -t utf-8 $< >$@
203
204xxd-pl.UTF-8.1: xxd-pl.1
205 iconv -f latin2 -t utf-8 $< >$@
206
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000207vim-ru.UTF-8.1: vim-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000208 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000209
210evim-ru.UTF-8.1: evim-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000211 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000212
213vimdiff-ru.UTF-8.1: vimdiff-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000214 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000215
216vimtutor-ru.UTF-8.1: vimtutor-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000217 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000218
219xxd-ru.UTF-8.1: xxd-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000220 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaarf09715b2020-05-31 14:25:22 +0200221
222vim-tr.UTF-8.1: vim-tr.1
223 iconv -f latin5 -t utf-8 $< >$@
224
225evim-tr.UTF-8.1: evim-tr.1
226 iconv -f latin5 -t utf-8 $< >$@
227
228vimdiff-tr.UTF-8.1: vimdiff-tr.1
229 iconv -f latin5 -t utf-8 $< >$@
230
231vimtutor-tr.UTF-8.1: vimtutor-tr.1
232 iconv -f latin5 -t utf-8 $< >$@