summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/disser/Makefile
blob: 8d642574bddc6ceb85a23928444f3c2aa2814420 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#
# Makefile for disser package
# Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com>
#

TARGET := disser
BST := gost705
MAINDTX := $(TARGET) $(BST) gost732
MANUAL := manual

CLSFILES := *.cls *.rtx
BSTFILES := gost705.bst gost705s.bst
CSFFILES := *.csf
DOCFILES := $(addsuffix .pdf, $(MAINDTX) $(MANUAL))
TEXTFILES := ../README ../README.ru ../ChangeLog
SRCFILES := *.dtx $(TARGET).ins dtx.ist $(MANUAL).tex Makefile \
  nomake.cmd

TEXMF ?= /usr/share/texmf
DESTDIR ?= $(TEXMF)
CLSDIR ?= $(DESTDIR)/tex/latex/$(TARGET)
DOCDIR ?= $(DESTDIR)/doc/latex/$(TARGET)
BSTDIR ?= $(DESTDIR)/bibtex/bst/$(TARGET)
CSFDIR ?= $(DESTDIR)/bibtex/csf/$(TARGET)
SRCDIR ?= $(DESTDIR)/source/latex/$(TARGET)

CLEXT ?= *.aux *.toc *.idx *.ind *.ilg *.log *.out *.lof *.lot *.lol \
  *.bbl *.blg *.bak *.dvi *.ps *.pdf
CLFILES ?= $(CLEXT) $(CLSFILES) $(BSTFILES)

LATEX ?= latex
PDFLATEX ?= pdflatex
MI ?= makeindex

LATEXFLAGS ?= --src-specials
PDFLATEXFLAGS ?= --shell-escape
MIFLAGS ?= -r -s dtx.ist


all: package doc

package: $(TARGET).cls

doc: pdf

dvi: $(addsuffix .dvi, $(MAINDTX) $(MANUAL))

pdf: $(DOCFILES)

clean:
	-rm -f $(CLFILES)

install: all
	mkdir -p $(CLSDIR) ;\
	mkdir -p $(BSTDIR) ;\
	mkdir -p $(CSFDIR) ;\
	mkdir -p $(DOCDIR) ;\
	mkdir -p $(SRCDIR) ;\
	cp $(CLSFILES)  $(CLSDIR) ;\
	cp $(BSTFILES)  $(BSTDIR) ;\
	cp $(CSFFILES)  $(CSFDIR) ;\
	cp $(DOCFILES)  $(DOCDIR) ;\
	cp $(TEXTFILES) $(DOCDIR) ;\
	cp $(SRCFILES)  $(SRCDIR)

uninstall:
	-rm $(addprefix $(CLSDIR)/, $(CLSFILES))
	-rm $(addprefix $(BSTDIR)/, $(BSTFILES))
	-rm $(addprefix $(CSFDIR)/, $(CSFFILES))
	-rm $(addprefix $(DOCDIR)/, $(DOCFILES))
	-rm $(addprefix $(DOCDIR)/, $(notdir $(TEXTFILES)))
	-rm $(addprefix $(SRCDIR)/, $(SRCFILES))
	-rmdir $(CLSDIR)
	-rmdir $(BSTDIR)
	-rmdir $(CSFDIR)
	-rmdir $(DOCDIR)
	-rmdir $(SRCDIR)

reinstall: uninstall install

$(TARGET).dvi: $(TARGET).dtx
	$(LATEX) $(LATEXFLAGS) $<
	$(MI) $(MIFLAGS) $(TARGET)
	$(LATEX) $(LATEXFLAGS) $<
	$(LATEX) $(LATEXFLAGS) $<

$(TARGET).pdf: $(TARGET).dtx
	$(PDFLATEX) $(PDFLATEXFLAGS) $<
	$(MI) $(MIFLAGS) $(TARGET)
	$(PDFLATEX) $(PDFLATEXFLAGS) $<
	$(PDFLATEX) $(PDFLATEXFLAGS) $<

$(BST).dvi: $(BST).dtx
	$(LATEX) $(LATEXFLAGS) $<
	$(MI) $(MIFLAGS) $(BST)
	$(LATEX) $(LATEXFLAGS) $<
	$(LATEX) $(LATEXFLAGS) $<

$(BST).pdf: $(BST).dtx
	$(PDFLATEX) $(PDFLATEXFLAGS) $<
	$(MI) $(MIFLAGS) $(BST)
	$(PDFLATEX) $(PDFLATEXFLAGS) $<
	$(PDFLATEX) $(PDFLATEXFLAGS) $<

%.cls: %.ins
	$(LATEX) $^

%.dvi: %.dtx
	$(LATEX) $(LATEXFLAGS) $<
	$(LATEX) $(LATEXFLAGS) $<

%.dvi: %.tex
	$(LATEX) $(LATEXFLAGS) $<
	$(LATEX) $(LATEXFLAGS) $<

%.pdf: %.dtx
	$(PDFLATEX) $(PDFLATEXFLAGS) $<
	$(PDFLATEX) $(PDFLATEXFLAGS) $<

%.pdf: %.tex
	$(PDFLATEX) $(PDFLATEXFLAGS) $<
	$(PDFLATEX) $(PDFLATEXFLAGS) $<

help:
	@echo "  all        (default) build package and documentation" ;\
	 echo "  clean      remove output files" ;\
	 echo "  doc        alias for pdf target" ;\
	 echo "  dvi        build documentation in DVI format" ;\
	 echo "  help       show description of targets" ;\
	 echo "  install    install package and documentation" ;\
	 echo "  package    build package" ;\
	 echo "  pdf        build documentation in PDF format" ;\
	 echo "  reinstall  reinstall package and documentation" ;\
	 echo "  uninstall  uninstall package and documentation"