forked from alerque/libertinus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
85 lines (69 loc) · 1.75 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
NAME=libertinus
VERSION=6.3
DIST=$(NAME)-$(VERSION)
SRC=sources
FEA=$(SRC)/features
DOC=documentation
TOOLS=tools
PY=python2.7
BUILD=$(TOOLS)/build.py
FINDMISSING=$(TOOLS)/find-missing-glyphs.py
FINDDUPS=$(TOOLS)/find-duplicate-glyphs.py
SFNTTOOL=sfnttool
SAMPLE=fntsample
OUTLINE=pdfoutline
NULL=
FONTS=math-regular \
sans-regular \
sans-bold \
sans-italic \
serif-regular \
serif-semibold \
serif-bold \
serif-italic \
serif-semibolditalic \
serif-bolditalic \
serifdisplay-regular \
serifinitials-regular \
mono-regular \
keyboard-regular \
$(NULL)
SFD=$(FONTS:%=$(SRC)/$(NAME)%.sfd)
OTF=$(FONTS:%=$(NAME)%.otf)
PDF=$(FONTS:%=$(DOC)/$(NAME)%-table.pdf)
all: otf
otf: $(OTF)
doc: $(PDF)
%.fea:
@if test ! -f $@; then touch $@; fi
%.otf: $(SRC)/%.sfd $(FEA)/%.fea Makefile $(BUILD)
@echo "Building $@"
@$(PY) $(BUILD) -o $@ -v $(VERSION) -i $< -f $(FEA)/$(@:%.otf=%.fea)
$(DOC)/%-table.pdf: %.otf
@echo "Generating $@"
@mkdir -p $(DOC)
@$(SAMPLE) --font-file $< --output-file [email protected] --print-outline > [email protected]
@$(OUTLINE) [email protected] [email protected] $@
check-missing: $(SFD)
@$(foreach sfd, $(SFD), \
echo " MIS "`basename $(sfd)`; \
$(PY) $(FINDMISSING) $(sfd) || exit; \
)
check-duplicates: $(SFD)
@$(foreach sfd, $(SFD), \
echo " DUP "`basename $(sfd)`; \
$(PY) $(FINDDUPS) $(sfd) || exit; \
)
check: check-missing check-duplicates
dist: check $(OTF) $(PDF)
@echo "Making dist tarball"
@mkdir -p $(DIST)/$(DOC)
@cp $(OTF) $(DIST)
@cp $(PDF) $(DIST)/$(DOC)
@cp $(DOC)/$(NAME)-testmath.pdf $(DIST)/$(DOC)
@cp OFL.txt FONTLOG.txt $(DIST)
@cp README.md $(DIST)/README.txt
@zip -r $(DIST).zip $(DIST)
clean:
@rm -rf $(DIST) $(DIST).zip