Makefile 3.81 KB
Newer Older
1
2
3
#*=============================================================================
# Makefile for ecsdocs LaTeX Style
# Date: 11/05/2002
4
5
6
7
8
9
10
11
# Author: Steve Gunn and Edward Longman
# 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.
# make
#	     all - creates all the necessart files to install the class
#      install - moves all of the created files into the
#*======================BUILD AND INSTALL NAMES================================
12

13
TEXMF      = C:\Users\<username>\texmf
14
15
STYLE      = ecsdocs

16
#*====================DEFINE EXPECTED OUTPUT FILES=============================
17
18
19
20
21
22
23
24

CLSFILES   = ecsthesis.cls \
             ecsminithesis.cls \
             ecsprogress.cls \
             ecsproject.cls \
             ecsreport.cls \
             ecsarticle.cls \
             ecsgdp.cls \
25
26
             ecsgdpsummary.cls \
             ecsUoSLogo.png
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

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

DOCFILES   = ecsdocs.pdf

BSTFILES   = ecs.bst

BIBFILES   = ECS.bib

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

SRCFILES   = $(STYLE).dtx \
             $(STYLE).ins \
	     Makefile

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

CLSDIR     = "$(TEXMF)/tex/latex/$(STYLE)"
TPLDIR     = "$(TEXMF)/templates/latex/$(STYLE)"
DOCDIR     = "$(TEXMF)/doc/latex/$(STYLE)"
BSTDIR     = "$(TEXMF)/bibtex/bst/$(STYLE)"
BIBDIR     = "$(TEXMF)/bibtex/bib/$(STYLE)"

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

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

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

all: $(GENFILES) $(DOCFILES)

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

87
88
89
90
91
92
#* .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
93
94
95
96
97
98
99
100
101
102
103
	$(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

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


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

111
#*============================= CLEAN TYPES =================================
112
113
114
115
116
117
118
119
120
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

121
#*======================= INSTALL INTO TEXMF DIRECTORY ======================
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

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 $(BSTDIR)
	install $(BSTFILES) $(BSTDIR)
	install -d $(BIBDIR)
	install $(BIBFILES) $(BIBDIR)

	$(MAKE) clean

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