forked from tudadesign/tudadesign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (69 loc) · 2.81 KB
/
Makefile
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
#!/usr/bin/make -f
# Makefile for the Latex-Classes for the corporate design of TU Darmstadt.
# Copyright (C) 2014 Benjamin Brockhaus
# You can modify and/or redistribute this under the terms of GPL v2 or later
#Where to install the files:
DEST = $(DESTDIR)/usr/local/share
#List of documentation-files
DOC = texmf/doc/latex/tuddesign/TUD_doc.pdf
#List of example-files
EXAMPLES = texmf/doc/latex/tuddesign/examples/tudposter/TUDposter.pdf\
texmf/doc/latex/tuddesign/examples/tudreport/TUDarticle.pdf\
texmf/doc/latex/tuddesign/examples/tudreport/TUDreport.pdf\
texmf/doc/latex/tuddesign/examples/tudletter/TUDletter.pdf\
texmf/doc/latex/tuddesign/examples/tudexercise/TUDexercise.pdf\
texmf/doc/latex/tuddesign/examples/tudbeamer/TUDbeamer.pdf
#Keep GNU make from automatically deleting files with these endings:
.PRECIOUS: %.ps %.dvi
all: doc
#build all documentation
doc: $(DOC) $(EXAMPLES)
#Clean up all the intermediate files
clean: $(DOC:.pdf=.clean) $(EXAMPLES:.pdf=.clean)
#Remove the output files too
clean-all: clean $(DOC:.pdf=.realclean) $(EXAMPLES:.pdf=.realclean)
install: doc
#create target directories and if necessary parent-directories
mkdir -p $(DEST)/texmf/doc/latex/tuddesign
mkdir -p $(DEST)/texmf/tex/latex/tuddesign
#copy files to target destination
cp -rf texmf/doc/latex/tuddesign/*** $(DEST)/texmf/doc/latex/tuddesign
cp -rf texmf/tex/latex/tuddesign/*** $(DEST)/texmf/tex/latex/tuddesign
#set permissions of copied files and folders
find $(DEST)/texmf/doc/latex/tuddesign/ -type d -exec chmod 755 {} +
find $(DEST)/texmf/doc/latex/tuddesign/ -type f -exec chmod 644 {} +
find $(DEST)/texmf/tex/latex/tuddesign/ -type d -exec chmod 755 {} +
find $(DEST)/texmf/tex/latex/tuddesign/ -type f -exec chmod 644 {} +
#link documentation
mkdir -p $(DEST)/doc/tuddesign
ln -s $(DEST)/texmf/doc/latex/tuddesign $(DEST)/doc/tuddesign/doc
uninstall:
rm -rf $(DEST)/texmf/doc/latex/tuddesign
rm -rf $(DEST)/texmf/tex/latex/tuddesign
rm -rf $(DEST)/doc/tuddesign
# --------------------------------------------------------------------------------
.PHONY: doc clean clean-all %.clean %.realclean install uninstall
%.clean:
cd $(dir $@); rm -f $(basename $(notdir $@)).aux \
$(basename $(notdir $@)).log \
$(basename $(notdir $@)).toc \
$(basename $(notdir $@)).out \
$(basename $(notdir $@)).lof \
$(basename $(notdir $@)).len \
$(basename $(notdir $@)).nav \
$(basename $(notdir $@)).snm
%.realclean:
cd $(dir $@); \
rm -f $(basename $(notdir $@)).dvi \
$(basename $(notdir $@)).ps \
$(basename $(notdir $@)).pdf
%.pdf: %.ps
cd $(dir $@); \
ps2pdf $(notdir $<);
%.ps: %.dvi
cd $(dir $@); \
dvips $(notdir $<);
%.dvi:
cd $(dir $@); \
TEXINPUTS="$(CURDIR)/texmf/tex/latex/tuddesign//:" latex $(basename $(notdir $@)).tex; \
TEXINPUTS="$(CURDIR)/texmf/tex/latex/tuddesign//:" latex $(basename $(notdir $@)).tex;