Skip to content

Commit

Permalink
Merge branch 'small-improvements' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorenchik committed Jul 10, 2017
2 parents ffd1377 + d0af450 commit f409c76
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
47 changes: 36 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
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
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)

Expand All @@ -25,20 +40,30 @@ update:
$(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 body.tex *.log *.aux *.toc *.out
-rm -r $(docdir)
-rm -f body.tex *.log *.aux *.toc *.out *.pyc
-rm -f -r $(docdir)

clobber: clean
-rm vimhelp{,-ipad,-a4}.pdf
-rm -f vimhelp{,-ipad,-a4}.pdf

distclean: clobber

help:
@echo "$$TASKS"

.PHONY: letter a4 ipad all update help clean clobber FORCE
.PHONY: letter a4 ipad all update help clean clobber distclean FORCE
1 change: 1 addition & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Download updated vim documentation and faq
#TODO: checkout only doc subdir from vim repo
set -e

echo Getting vim
Expand Down

0 comments on commit f409c76

Please sign in to comment.