summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/disser/Makefile
blob: 92bab2d9434d18f68f4b912b44fe980bbfc5b358 (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
#
# Makefile for disser package
# Author: Stanislav Kruchinin <stanislav.kruchinin@gmail.com>
#

TARGET := disser
DTXFILES := $(TARGET) gost732
MANUAL := manual

CLSFILES := *.cls *.rtx
DOCFILES := $(addsuffix .pdf, $(DTXFILES) $(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)
SRCDIR ?= $(DESTDIR)/source/latex/$(TARGET)

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

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

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

.PHONY: all package doc dvi pdf clean install uninstall reinstall help

all: package doc

package: $(TARGET).cls

doc: pdf

dvi: $(addsuffix .dvi, $(DTXFILES) $(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 $(DOCFILES)  $(DOCDIR) ;\
	cp $(TEXTFILES) $(DOCDIR) ;\
	cp $(SRCFILES)  $(SRCDIR)

uninstall:
	-rm $(addprefix $(CLSDIR)/, $(CLSFILES))
	-rm $(addprefix $(DOCDIR)/, $(DOCFILES))
	-rm $(addprefix $(DOCDIR)/, $(notdir $(TEXTFILES)))
	-rm $(addprefix $(SRCDIR)/, $(SRCFILES))
	-rmdir $(CLSDIR)
	-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) $<

%.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"