2014-07-10 21:05:51 -07:00
|
|
|
#
|
|
|
|
# Makefile for the Vim documentation on Unix
|
|
|
|
#
|
|
|
|
# If you get "don't know how to make scratch", first run make in the source
|
|
|
|
# directory. Or remove the include below.
|
|
|
|
|
|
|
|
AWK = awk
|
|
|
|
|
|
|
|
# Set to $(VIMTARGET) when executed from src/Makefile.
|
|
|
|
VIMEXE = vim
|
|
|
|
|
2015-04-10 19:05:30 -07:00
|
|
|
DOCS = $(wildcard *.txt)
|
|
|
|
HTMLS = $(DOCS:.txt=.html)
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2014-07-31 05:21:11 -07:00
|
|
|
MANPAGES = \
|
|
|
|
manpages/vim.man \
|
|
|
|
manpages/vimtutor.man \
|
|
|
|
manpages/xxd.man \
|
|
|
|
manpages/de/vim-de.man \
|
|
|
|
manpages/fr/vim-fr.man \
|
|
|
|
manpages/fr/vimtutor-fr.man \
|
|
|
|
manpages/fr/xxd-fr.man \
|
|
|
|
manpages/pl/vim-pl.man \
|
|
|
|
manpages/pl/vimtutor-pl.man \
|
|
|
|
manpages/pl/xxd-pl.man \
|
|
|
|
manpages/it/vim-it.man \
|
|
|
|
manpages/it/vimtutor-it.man \
|
|
|
|
manpages/it/xxd-it.man \
|
|
|
|
manpages/ru/vim-ru.man \
|
|
|
|
manpages/ru/vimtutor-ru.man \
|
|
|
|
manpages/ru/xxd-ru.man \
|
|
|
|
manpages/ja/vim-ja.man \
|
|
|
|
manpages/ja/vimtutor-ja.man \
|
|
|
|
manpages/ja/xxd-ja.man
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
.SUFFIXES:
|
2014-07-31 05:21:11 -07:00
|
|
|
.SUFFIXES: .c .o .txt .html .1 .man
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2014-07-31 05:52:03 -07:00
|
|
|
all: tags manpages html
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
# Use Vim to generate the tags file. Can only be used when Vim has been
|
|
|
|
# compiled and installed. Supports multiple languages.
|
|
|
|
vimtags: $(DOCS)
|
|
|
|
$(VIMEXE) -u NONE -esX -c "helptags ++t ." -c quit
|
|
|
|
|
|
|
|
# Use "doctags" to generate the tags file. Only works for English!
|
|
|
|
tags: doctags $(DOCS)
|
|
|
|
./doctags $(DOCS) | LANG=C LC_ALL=C sort >tags
|
|
|
|
uniq -d -2 tags
|
|
|
|
|
|
|
|
doctags: doctags.c
|
|
|
|
$(CC) doctags.c -o doctags
|
|
|
|
|
2014-07-31 05:21:11 -07:00
|
|
|
manpages: $(MANPAGES)
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2014-10-05 11:01:25 -07:00
|
|
|
# OSX groff doesn't support utf-8 as input encoding, so this won't work there.
|
2014-07-31 05:21:11 -07:00
|
|
|
.1.man:
|
|
|
|
groff -k -mandoc -Tutf8 $< | sed -e s/.^H//g > $@
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
# Awk version of .txt to .html conversion.
|
|
|
|
html: noerrors tags $(HTMLS)
|
2014-09-20 05:24:16 -07:00
|
|
|
@if test -f errors.log; then cat errors.log; fi
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
noerrors:
|
|
|
|
-rm -f errors.log
|
|
|
|
|
|
|
|
$(HTMLS): tags.ref
|
|
|
|
|
|
|
|
.txt.html:
|
|
|
|
$(AWK) -f makehtml.awk $< >$@
|
|
|
|
|
|
|
|
# index.html is the starting point for HTML, but for the help files it is
|
|
|
|
# help.txt. Therefore use vimindex.html for index.txt.
|
|
|
|
index.html: help.txt
|
|
|
|
$(AWK) -f makehtml.awk help.txt >index.html
|
|
|
|
|
|
|
|
vimindex.html: index.txt
|
|
|
|
$(AWK) -f makehtml.awk index.txt >vimindex.html
|
|
|
|
|
|
|
|
tags.ref tags.html: tags
|
|
|
|
$(AWK) -f maketags.awk tags >tags.html
|
|
|
|
|
|
|
|
clean:
|
2014-07-31 05:52:03 -07:00
|
|
|
-rm -f doctags *.html tags.ref $(MANPAGES) $(HTMLS) errors.log
|
2014-07-10 21:05:51 -07:00
|
|
|
|