-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (86 loc) · 2.55 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
###################
##
## Makefile for ubuntu-latex-fonts
##
## THIS PROJECT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Distributed files
#
FONTBASE = ubuntu
RES = resources
TFM := $(shell ls $(RES)/$(FONTBASE)*.tfm)
AFM = $(TFM:%.tfm=%.afm)
PFB = $(TFM:%.tfm=%.pfb)
MAP = $(RES)/$(FONTBASE).map
STY = $(RES)/$(FONTBASE).sty
FD := $(shell ls $(RES)/t1$(FONTBASE)*.fd)
## Installation targets
#
# PREFIX = /usr/share/texmf-texlive
# automatically get directory path
PREFIX = $(shell kpsewhich -var-value TEXMFDIST)
TFMDIR = fonts/tfm/$(FONTBASE)
AFMDIR = fonts/afm/$(FONTBASE)
PFBDIR = fonts/type1/public/$(FONTBASE)
MAPDIR = fonts/map
STYDIR = tex/latex/$(FONTBASE)
FDDIR = tex/latex/$(FONTBASE)
# These are the directories only owned by the ubuntu fonts,
# we'll have to create them
TARGETDIRS = $(TFMDIR) $(AFMDIR) $(PFBDIR) $(STYDIR) $(FDDIR)
## commands
#
CP = cp
MKDIR = mkdir -p
TEXHASH = texhash
#I'd liked very much to have updmap-sys working
UPDMAP = updmap
RMDIR = rm -rf
all:
makedirs:
for d in $(TARGETDIRS); do \
$(MKDIR) $(PREFIX)/$$d; \
done
# just precaution, this is very unlikely to be needed
$(MKDIR) $(PREFIX)/$(MAPDIR)
copy:
$(CP) $(TFM) $(PREFIX)/$(TFMDIR)/
$(CP) $(AFM) $(PREFIX)/$(AFMDIR)/
$(CP) $(PFB) $(PREFIX)/$(PFBDIR)/
$(CP) $(MAP) $(PREFIX)/$(MAPDIR)/
$(CP) $(STY) $(PREFIX)/$(STYDIR)/
$(CP) $(FD) $(PREFIX)/$(FDDIR)/
reindex:
$(TEXHASH) $(PREFIX)
enablemap:
$(UPDMAP) --enable Map=$(MAP)
updatemap: enablemap
install: makedirs copy reindex
delfiles:
for d in $(TARGETDIRS); do \
$(RMDIR) $(PREFIX)/$$d; \
done
$(RM) $(PREFIX)/$(MAPDIR)/$(MAP)
disablemap:
$(UPDMAP) --disable $(MAP)
cleanmap: disablemap
uninstall: delfiles reindex
help:
@echo "Make file for ubuntu-latex-fonts"
@echo "For installation of the Ubuntu Font Family type:\n"
@echo "\tsudo make install"
#@echo "\tmake updatemap"
@echo
@echo "For uninstallation type:\n"
@echo "\tsudo make uninstall"
#@echo "\tmake cleanmap"
@echo
@echo "Hint: By default the fonts are installed to $(PREFIX). \
You can change that behavior by passing PREFIX, e.g.:\n"
@echo "\tmake PREFIX=~/texmf install"
.PHONY: install uninstall help