summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/unswcover/Makefile
blob: 15eec37cb9769ba8f6a4485709e518999ed72554 (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
TEXMFHOME=/usr/local/share/texmf
DESTDIR=$(TEXMFHOME)/tex/latex/unswcover

INSTALL=install
TEXHASH=texhash
INKSCAPE=inkscape
LATEX=pdflatex
BIBTEX=bibtex

STYLE=unswcover.sty
LOGOSBASE=logo_unsw_short.

LOGOSPS=$(LOGOSBASE:.=.ps)
LOGOSPDF=$(LOGOSBASE:.=.pdf)
LOGOS=$(LOGOSPS) $(LOGOSPDF)

PACKAGENAME=unswcover-$(shell date +%Y%m%d)

all: $(LOGOS) thesis.pdf

thesis.aux: thesis.tex
	$(LATEX) -draftmode -interaction nonstopmode $< > /dev/null
thesis.pdf: thesis.tex thesis.aux
	$(BIBTEX) $(<:.tex=.aux) 
	$(LATEX) -halt-on-error -interaction nonstopmode $< > /dev/null
	$(LATEX) -halt-on-error -interaction nonstopmode $< > /dev/null

install: $(STYLE) $(LOGOS)
	$(INSTALL) -m 0755 -d $(DESTDIR)
	$(INSTALL) -m 0644 $(STYLE) $(LOGOS) $(ARTWORK) $(DESTDIR)
	$(TEXHASH) $(TEXMFHOME)

package: $(PACKAGENAME).tar.bz2
$(PACKAGENAME).tar.bz2: $(STYLE) $(LOGOS) $(ARTWORK) README COPYING Makefile thesis.tex thesis.bib thesis.pdf
	test ! -d $(PACKAGENAME)
	for FILE in $^; do\
		DIR=$(PACKAGENAME)/`dirname $$FILE`; \
		mkdir -p $$DIR; \
		cp $$FILE $$DIR; \
	done
	tar cjvf $@ $(PACKAGENAME)
	rm -rf $(PACKAGENAME)

%.ps: %.svg
	$(INKSCAPE) -P $@ $<
%.pdf: %.svg
	$(INKSCAPE) -A $@ $<

clean:
	rm -f *.pdf *.ps
	rm -f *.log *.out *.nav *.snm *.toc *.bbl *.bcf *.blg *-blx.bib *.run.xml
	
real-clean: clean
	rm -rf unswcover-*
	rm -f *.aux

.PHONY: all install package clean real-clean