Makefile 3.86 KB
Newer Older
1
#*=============================================================================
2
# Makefile for uosdocs LaTeX Style
3
# Date: 11/05/2002
4
# Author: Steve Gunn
5
6
7
# Use for rebuilding class files when the original dtx source has been changed
# Change TEXMF to represent the installation directory of texlive (or MiKTeX)
# The style is the name of the style for these templates.
8
9
10
# Date: 30/01/2019
# Author: Edward Longman
# Rebuild and change name to uosdocs
11
12
13
14
# make
#	     all - creates all the necessart files to install the class
#      install - moves all of the created files into the
#*======================BUILD AND INSTALL NAMES================================
15

16
TEXMF      = C:\Users\<username>\texmf
17
STYLE      = uosdocs
18

19
#*====================DEFINE EXPECTED OUTPUT FILES=============================
20

21
22
23
24
25
26
27
28
29
CLSFILES   = uosthesis.cls \
             uosminithesis.cls \
             uosprogress.cls \
             uosproject.cls \
             uosreport.cls \
             uosarticle.cls \
             uosgdp.cls \
             uosgdpsummary.cls \
             UoSLogo.png
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

TPLFILES   = AppendixA.tex \
             Article.tex \
             Conclusions.tex \
             Definitions.tex \
             GDP.tex \
             GDPSummary.tex \
             Introduction.tex \
             MiniThesis.tex \
             Progress.tex \
             Project.tex \
             Report.tex \
             Thesis.tex

EPSFILES   = figure.eps

46
DOCFILES   = uosdocs.pdf
47

48
BIBFILES   = UOS.bib
49
50
51
52
53
54
55
56
57
58
59
60

TESTFILES  = Article.pdf \
             GDP.pdf \
             GDPSummary.pdf \
             MiniThesis.pdf \
             Progress.pdf \
             Project.pdf \
             Report.pdf \
             Thesis.pdf

SRCFILES   = $(STYLE).dtx \
             $(STYLE).ins \
61
             UoSLogo.png \
62
	     			 Makefile
63
64
65
66
67
68
69
70
71
72

GENFILES   = $(CLSFILES) \
             $(TPLFILES) \
             $(EPSFILES) \
             $(BIBFILES)

CLSDIR     = "$(TEXMF)/tex/latex/$(STYLE)"
TPLDIR     = "$(TEXMF)/templates/latex/$(STYLE)"
DOCDIR     = "$(TEXMF)/doc/latex/$(STYLE)"
BIBDIR     = "$(TEXMF)/bibtex/bib/$(STYLE)"
73
SRCDIR     = "$(TEXMF)/source/latex/$(STYLE)"
74

75
#*====================== LATEX INSTALLATION CONFIG ==========================
76
77
78
79
80

LATEX      = pdflatex
PDFTEXIFY  = texify --pdf
MAKEINDEX  = makeindex

81
#*==================== DIFFERENT MAKE CONFIGURATIONS ========================
82
83
84
85
86
87

all: $(GENFILES) $(DOCFILES)

dist: $(STYLE).zip
test: $(GENFILES) $(TESTFILES)

88
89
90
91
92
93
#* .SECONDARY used to stop it building repeatedly
#* https://stackoverflow.com/questions/2973445/
#* gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file
$(GENFILES): $(STYLE).intermediate;
.SECONDARY: $(STYLE).intermediate
$(STYLE).intermediate: $(STYLE).dtx $(STYLE).ins Makefile
94
95
96
97
98
99
100
101
102
103
104
	$(LATEX) $(STYLE).ins

$(DOCFILES): $(STYLE).dtx
	$(LATEX) $(STYLE).dtx
	$(MAKEINDEX) -s gind.ist -o $(STYLE).ind $(STYLE).idx
	$(MAKEINDEX) -s gglo.ist -o $(STYLE).gls $(STYLE).glo
	$(LATEX) $(STYLE).dtx

%.pdf: %.tex
	$(PDFTEXIFY) $*.tex

105
#*========================== ZIP REQUIREMENTS ===============================
106
107
108
109
110
111


$(STYLE).zip: $(GENFILES) $(DOCFILES)
	$(MAKE) clean
	zip $@ $(SRCFILES) $(GENFILES) $(DOCFILES)

112
#*============================= CLEAN TYPES =================================
113
114
115
116
117
118
119
120
121
clean:
	-$(RM) *.aux *.log *.ind *.idx *.glo *.gls *.ilg *.toc *.bak *.lol *.lot *.out *.lof *.bbl *.blg

veryclean: clean
	-$(RM) *.pdf

distclean: veryclean
	-$(RM) *.cls *.tex *.eps *.bib *.bst *.zip

122
#*======================= INSTALL INTO TEXMF DIRECTORY ======================
123
124
125
126
127
128
129
130
131
132
133

install: $(GENFILES) $(DOCFILES)
	install -d $(CLSDIR)
	install $(CLSFILES) $(CLSDIR)
	install -d $(TPLDIR)
	install $(TPLFILES) $(TPLDIR)
	install $(EPSFILES) $(TPLDIR)
	install -d $(DOCDIR)
	install $(DOCFILES) $(DOCDIR)
	install -d $(BIBDIR)
	install $(BIBFILES) $(BIBDIR)
134
135
	install -d $(SRCDIR)
	install $(SRCFILES) $(SRCDIR)
136
137
138
	$(MAKE) clean

#*===========================================================================