blob: 5f0786db82a503efba70c38f5da78fac3415dff4 [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.
RestorerZcd33faf2024-07-04 17:47:16 +020010VIMPROG = vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
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
Restorer459867b2024-01-22 22:42:44 +030021.PHONY: all vimtags noerrors perlhtml clean test_urls
Bram Moolenaar071d4272004-06-13 20:20:40 +000022
Bram Moolenaare37d50a2008-08-06 17:06:04 +000023all: tags vim.man evim.man vimdiff.man vimtutor.man xxd.man $(CONVERTED)
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
25# Use Vim to generate the tags file. Can only be used when Vim has been
26# compiled and installed. Supports multiple languages.
27vimtags: $(DOCS)
RestorerZcd33faf2024-07-04 17:47:16 +020028 @$(VIMPROG) --clean -esX -V1 -u doctags.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000029
30# Use "doctags" to generate the tags file. Only works for English!
31tags: doctags $(DOCS)
Restorer459867b2024-01-22 22:42:44 +030032 ./doctags $(DOCS) | LANG=C LC_ALL=C sort >$@
Bram Moolenaar071d4272004-06-13 20:20:40 +000033 uniq -d -2 tags
34
35doctags: doctags.c
36 $(CC) doctags.c -o doctags
37
38vim.man: vim.1
Restorer459867b2024-01-22 22:42:44 +030039 nroff -man $< | sed -e s/.//g > $@
Bram Moolenaar071d4272004-06-13 20:20:40 +000040
Bram Moolenaare37d50a2008-08-06 17:06:04 +000041evim.man: evim.1
Restorer459867b2024-01-22 22:42:44 +030042 nroff -man $< | sed -e s/.//g > $@
Bram Moolenaare37d50a2008-08-06 17:06:04 +000043
Bram Moolenaar071d4272004-06-13 20:20:40 +000044vimdiff.man: vimdiff.1
Restorer459867b2024-01-22 22:42:44 +030045 nroff -man $< | sed -e s/.//g > $@
Bram Moolenaar071d4272004-06-13 20:20:40 +000046
47vimtutor.man: vimtutor.1
Restorer459867b2024-01-22 22:42:44 +030048 nroff -man $< | sed -e s/.//g > $@
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50xxd.man: xxd.1
Restorer459867b2024-01-22 22:42:44 +030051 nroff -man $< | sed -e s/.//g > $@
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
Restorer74a23312024-03-28 09:19:44 +000053uganda.nsis.txt : uganda.???
54 for dpn in $?; do \
55 trg=$@; \
56 sed -e 's/[ ]*\*.*\*//g' -e 's/vim:tw=[[:digit:]][[:digit:]]:.*//' \
57 $${dpn} | uniq > $${trg%txt}$${dpn##*.}; \
58 done
59# This files needs to be in dos fileformat for NSIS.
RestorerZcd33faf2024-07-04 17:47:16 +020060 $(VIMPROG) -e -X -u NONE --cmd "set notitle noicon nocp noml viminfo=" \
Restorer74a23312024-03-28 09:19:44 +000061 -c "argdo write ++ff=dos" -c "qa" uganda.nsis.???
Bram Moolenaar071d4272004-06-13 20:20:40 +000062
63# Awk version of .txt to .html conversion.
Bram Moolenaarcdda8fe2010-07-21 20:40:27 +020064html: noerrors tags $(HTMLS)
Bram Moolenaar071d4272004-06-13 20:20:40 +000065 @if test -f errors.log; then more errors.log; fi
66
67noerrors:
68 -rm -f errors.log
69
Bram Moolenaarcdda8fe2010-07-21 20:40:27 +020070$(HTMLS): tags.ref
71
Bram Moolenaar071d4272004-06-13 20:20:40 +000072.txt.html:
73 $(AWK) -f makehtml.awk $< >$@
74
Bram Moolenaar371d5402006-03-20 21:47:49 +000075# index.html is the starting point for HTML, but for the help files it is
76# help.txt. Therefore use vimindex.html for index.txt.
77index.html: help.txt
Restorer459867b2024-01-22 22:42:44 +030078 $(AWK) -f makehtml.awk $< >$@
Bram Moolenaar371d5402006-03-20 21:47:49 +000079
80vimindex.html: index.txt
Restorer459867b2024-01-22 22:42:44 +030081 $(AWK) -f makehtml.awk $< >$@
Bram Moolenaar371d5402006-03-20 21:47:49 +000082
Bram Moolenaar071d4272004-06-13 20:20:40 +000083tags.ref tags.html: tags
84 $(AWK) -f maketags.awk tags >tags.html
85
86# Perl version of .txt to .html conversion.
87# There can't be two rules to produce a .html from a .txt file.
88# Just run over all .txt files each time one changes. It's fast anyway.
89perlhtml: tags $(DOCS)
90 ./vim2html.pl tags $(DOCS)
91
Bram Moolenaar2f058492017-11-30 20:27:52 +010092# Check URLs in the help with "curl".
93test_urls:
RestorerZcd33faf2024-07-04 17:47:16 +020094 $(VIMPROG) --clean -S test_urls.vim
Bram Moolenaar2f058492017-11-30 20:27:52 +010095
Bram Moolenaar071d4272004-06-13 20:20:40 +000096clean:
Bram Moolenaar08fc4842020-07-10 20:40:23 +020097 -rm -f doctags *.html tags.ref
Bram Moolenaar071d4272004-06-13 20:20:40 +000098
99# These files are in the extra archive, skip if not present
100
101arabic.txt:
Restorer459867b2024-01-22 22:42:44 +0300102 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103
104farsi.txt:
Restorer459867b2024-01-22 22:42:44 +0300105 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106
107hebrew.txt:
Restorer459867b2024-01-22 22:42:44 +0300108 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109
110russian.txt:
Restorer459867b2024-01-22 22:42:44 +0300111 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000112
Bram Moolenaar071d4272004-06-13 20:20:40 +0000113gui_w32.txt:
Restorer459867b2024-01-22 22:42:44 +0300114 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115
116if_ole.txt:
Restorer459867b2024-01-22 22:42:44 +0300117 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118
119os_390.txt:
Restorer459867b2024-01-22 22:42:44 +0300120 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000121
122os_amiga.txt:
Restorer459867b2024-01-22 22:42:44 +0300123 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000124
125os_beos.txt:
Restorer459867b2024-01-22 22:42:44 +0300126 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127
128os_dos.txt:
Restorer459867b2024-01-22 22:42:44 +0300129 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000130
Bram Moolenaarb3f74062020-02-26 16:16:53 +0100131os_haiku.txt:
Restorer459867b2024-01-22 22:42:44 +0300132 touch $@
Bram Moolenaarb3f74062020-02-26 16:16:53 +0100133
Bram Moolenaar071d4272004-06-13 20:20:40 +0000134os_mac.txt:
Restorer459867b2024-01-22 22:42:44 +0300135 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000136
137os_mint.txt:
Restorer459867b2024-01-22 22:42:44 +0300138 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000139
140os_msdos.txt:
Restorer459867b2024-01-22 22:42:44 +0300141 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000142
143os_os2.txt:
Restorer459867b2024-01-22 22:42:44 +0300144 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000145
146os_qnx.txt:
Restorer459867b2024-01-22 22:42:44 +0300147 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000148
149os_risc.txt:
Restorer459867b2024-01-22 22:42:44 +0300150 touch $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151
152os_win32.txt:
Restorer459867b2024-01-22 22:42:44 +0300153 touch $@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000154
Bram Moolenaarb475fb92006-03-02 22:40:52 +0000155# Note that $< works with GNU make while $> works for BSD make.
Bram Moolenaar3991dab2006-03-27 17:01:56 +0000156# Is there a solution that works for both??
Restorer424da592023-11-11 18:26:00 +0000157vim-da.UTF-8.1: vim-da.1
Restorerb23c1fc2023-11-04 08:57:09 +0000158 iconv -f latin1 -t utf-8 $< >$@
159
Restorer424da592023-11-11 18:26:00 +0000160vimdiff-da.UTF-8.1: vimdiff-da.1
Restorerb23c1fc2023-11-04 08:57:09 +0000161 iconv -f latin1 -t utf-8 $< >$@
162
Restorer424da592023-11-11 18:26:00 +0000163vimtutor-da.UTF-8.1: vimtutor-da.1
Restorerb23c1fc2023-11-04 08:57:09 +0000164 iconv -f latin1 -t utf-8 $< >$@
165
Restorer424da592023-11-11 18:26:00 +0000166vim-de.UTF-8.1: vim-de.1
Restorerb23c1fc2023-11-04 08:57:09 +0000167 iconv -f latin1 -t utf-8 $< >$@
168
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000169vim-fr.UTF-8.1: vim-fr.1
170 iconv -f latin1 -t utf-8 $< >$@
171
172evim-fr.UTF-8.1: evim-fr.1
173 iconv -f latin1 -t utf-8 $< >$@
174
175vimdiff-fr.UTF-8.1: vimdiff-fr.1
176 iconv -f latin1 -t utf-8 $< >$@
177
178vimtutor-fr.UTF-8.1: vimtutor-fr.1
179 iconv -f latin1 -t utf-8 $< >$@
180
181xxd-fr.UTF-8.1: xxd-fr.1
182 iconv -f latin1 -t utf-8 $< >$@
183
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000184vim-it.UTF-8.1: vim-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000185 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000186
187evim-it.UTF-8.1: evim-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000188 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000189
190vimdiff-it.UTF-8.1: vimdiff-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000191 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000192
193vimtutor-it.UTF-8.1: vimtutor-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000194 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000195
196xxd-it.UTF-8.1: xxd-it.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000197 iconv -f latin1 -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000198
Bram Moolenaare37d50a2008-08-06 17:06:04 +0000199vim-pl.UTF-8.1: vim-pl.1
200 iconv -f latin2 -t utf-8 $< >$@
201
202evim-pl.UTF-8.1: evim-pl.1
203 iconv -f latin2 -t utf-8 $< >$@
204
205vimdiff-pl.UTF-8.1: vimdiff-pl.1
206 iconv -f latin2 -t utf-8 $< >$@
207
208vimtutor-pl.UTF-8.1: vimtutor-pl.1
209 iconv -f latin2 -t utf-8 $< >$@
210
211xxd-pl.UTF-8.1: xxd-pl.1
212 iconv -f latin2 -t utf-8 $< >$@
213
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000214vim-ru.UTF-8.1: vim-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000215 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000216
217evim-ru.UTF-8.1: evim-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000218 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000219
220vimdiff-ru.UTF-8.1: vimdiff-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000221 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000222
223vimtutor-ru.UTF-8.1: vimtutor-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000224 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaar4317d9b2005-03-18 20:25:31 +0000225
226xxd-ru.UTF-8.1: xxd-ru.1
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000227 iconv -f KOI8-R -t utf-8 $< >$@
Bram Moolenaarf09715b2020-05-31 14:25:22 +0200228
229vim-tr.UTF-8.1: vim-tr.1
230 iconv -f latin5 -t utf-8 $< >$@
231
232evim-tr.UTF-8.1: evim-tr.1
233 iconv -f latin5 -t utf-8 $< >$@
234
235vimdiff-tr.UTF-8.1: vimdiff-tr.1
236 iconv -f latin5 -t utf-8 $< >$@
237
238vimtutor-tr.UTF-8.1: vimtutor-tr.1
239 iconv -f latin5 -t utf-8 $< >$@