forked from nathangrigg/vimhelppdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (54 loc) · 1.59 KB
/
Makefile
File metadata and controls
69 lines (54 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
define TASKS
letter make letter-sized version
a4 make a4-sized version
ipad make ipad-sized version
all make all versions
update update vim help and vim-faq from repository
clean delete intermediate files
clobber delete all files
distclean same as clobber
endef
export TASKS
SHELL=/bin/bash
ifeq ($(OS),Windows_NT) # Windows, MinGW, Cygwin, etc...
OS := Windows
subst_text := \\setmainfont{Arial}\n\\setmonofont{Courier New}
else
OS := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(OS),Darwin) # Mac OS X
OS := Darwin
subst_text := \\setromanfont{Avenir Next}\n\\setmonofont{Source Code Pro}
else # Linux, GNU Hurd, *BSD, Haiku, Android, etc...
OS := Linux
subst_text := \\setmainfont{Liberation Sans}\n\\setmonofont{Liberation Mono}
endif
endif
docdir = doc
helpfiles = $(wildcard $(docdir)/*.txt)
letter: vimhelp.pdf
a4: vimhelp-a4.pdf
ipad: vimhelp-ipad.pdf
all: letter a4 ipad
update:
./update.sh
$(docdir):
./update.sh
vimhelp.tex vimhelp-a4.tex vimhelp-ipad.tex: preamble.tex
preamble.tex: FORCE
sed -i -e '/^\\usepackage{fontspec}/ {n;N;s/.*/$(subst_text)/}' preamble.tex
%.pdf: %.tex body.tex FORCE
xelatex $<
ifndef SECOND_TIME_RUN
$(MAKE) $(MAKECMDGOALS) SECOND_TIME_RUN=true
endif
body.tex: $(helpfiles) $(docdir) contents.txt
python h2h.py
clean:
-rm -f body.tex *.log *.aux *.toc *.out *.pyc
-rm -f -r $(docdir)
clobber: clean
-rm -f vimhelp{,-ipad,-a4}.pdf
distclean: clobber
help:
@echo "$$TASKS"
.PHONY: letter a4 ipad all update help clean clobber distclean FORCE