Makefile 3.95 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

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 \
60
61
             ecsUoSLogo.png \
	     			 Makefile
62
63
64
65
66
67
68
69
70
71
72
73

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
SRCDIR     = "$(TEXMF)/source/docstrip/$(STYLE)"
75

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

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

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

all: $(GENFILES) $(DOCFILES)

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

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

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


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

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

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

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)
137
138
	install -d $(SRCDIR)
	install $(SRCFILES) $(SRCDIR)
139
140
141
	$(MAKE) clean

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