-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (54 loc) · 1.59 KB
/
Makefile
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
SHELL := /bin/sh
INSTALL := install
INSTALL_PROGRAM := $(INSTALL)
INSTALL_DATA := $(INSTALL) -m 644
MKTEXLSR := mktexlsr
TEX := tex
LATEX := pdflatex
MAKEINDEX := makeindex
name := modernmath
bundle := phst
texmf := $(shell kpsewhich --var-value=TEXMFHOME)
branch := latex/$(bundle)
destdir := $(texmf)/tex/$(branch)
docdir := $(texmf)/doc/$(branch)
auctexdir := ~/.emacs.d/auctex/style
LATEXFLAGS := --file-line-error --interaction=scrollmode
LATEXFLAGS_DRAFT := $(LATEXFLAGS) --draftmode
LATEXFLAGS_FINAL := $(LATEXFLAGS) --synctex=1
source := $(name).dtx
driver := $(name).ins
destination := $(name).sty
manual := $(name).pdf
auctex_style := $(name).el
index_src := $(name).idx
index_dest := $(name).ind
index_log := $(name).ilg
index_sty := gind.ist
changes_src := $(name).glo
changes_dest := $(name).gls
changes_log := $(name).glg
changes_sty := gglo.ist
all: $(destination) $(auctex_style)
pdf: $(manual)
complete: all pdf
install: all
$(INSTALL) -d $(destdir)
$(INSTALL_DATA) $(destination) $(destdir)
$(INSTALL) -d $(auctexdir)
$(INSTALL_DATA) $(auctex_style) $(auctexdir)
$(MKTEXLSR)
install-pdf: pdf
$(INSTALL) -d $(docdir)
$(INSTALL_DATA) $(manual) $(docdir)
$(MKTEXLSR)
install-complete: install install-pdf
$(destination): $(source) $(driver)
$(TEX) $(driver)
$(manual): $(source) $(destination)
$(LATEX) $(LATEXFLAGS_DRAFT) $(source)
$(MAKEINDEX) -s $(index_sty) -o $(index_dest) -t $(index_log) $(index_src)
$(MAKEINDEX) -s $(changes_sty) -o $(changes_dest) -t $(changes_log) $(changes_src)
$(LATEX) $(LATEXFLAGS_DRAFT) $(source)
$(LATEX) $(LATEXFLAGS_FINAL) $(source)
.SUFFIXES: