summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/lualatex-math/Makefile
blob: 9415d2a148ebb33d017954825786a533223b0a2d (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Makefile
# Copyright 2011 Philipp Stephani
#
# This work may be distributed and/or modified under the
# conditions of the LaTeX Project Public License, either version 1.3c
# of this license or (at your option) any later version.
# The latest version of this license is in
#   http://www.latex-project.org/lppl.txt
# and version 1.3c or later is part of all distributions of LaTeX
# version 2009/09/24 or later.
#
# This work has the LPPL maintenance status `maintained'.
# The Current Maintainer of this work is Philipp Stephani.
# This work consists of all files listed in MANIFEST.

SHELL := /bin/sh
INSTALL := install
INSTALL_PROGRAM := $(INSTALL) -c -m 755
INSTALL_DATA := $(INSTALL) -c -m 644

ZIP := zip -v
MKTEXLSR := mktexlsr
TEX := tex
LATEX := lualatex
MAKEINDEX := makeindex

name := lualatex-math

texmf := $(shell kpsewhich --var-value=TEXMFHOME)
branch := lualatex/$(name)
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
dest_sty := $(name).sty
dest_lua := $(name).lua
destination := $(dest_sty) $(dest_lua)
tests := test-kernel test-amsmath test-unicode
tests_src := $(addsuffix .tex, $(tests))
tests_dest := $(addsuffix .pdf, $(tests))
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
ctan_arch := $(name).zip
ctan_files := README MANIFEST Makefile $(source) $(driver) $(destination) $(test_src) $(manual) $(auctex_style)


all: $(destination) $(auctex_style)

check: $(tests_dest)

pdf: $(manual)

complete: all check pdf

ctan: $(ctan_arch)

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) $(tests_src): $(driver) $(source)
	$(TEX) $<

$(tests_dest): %.pdf: %.tex $(destination)
	$(LATEX) $(LATEXFLAGS_FINAL) $<

$(manual): $(source) $(destination)
	$(LATEX) $(LATEXFLAGS_DRAFT) $<
	$(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) $<
	$(LATEX) $(LATEXFLAGS_FINAL) $<

$(ctan_arch): $(ctan_files)
	$(ZIP) $@ $^

.PHONY: all check pdf complete ctan install install-pdf install-complete
.SUFFIXES: