forked from aliftype/amiri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (69 loc) · 3.07 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
.PHONY: all clean ttf web pack check
NAME=Amiri
LATIN=AmiriLatin
TAG=$(shell git describe --tags --abbrev=0)
VERSION=$(TAG:v%=%)
SRC=sources
BUILDDIR=build
SCRIPTSDIR=scripts
FONTSDIR=fonts
DOC=documentation
FONTS=$(NAME)-Regular $(NAME)-Bold $(NAME)-Italic $(NAME)-BoldItalic $(NAME)Quran $(NAME)QuranColored
DIST=$(NAME)-$(VERSION)
LICENSE=OFL.txt
BUILD=${SCRIPTSDIR}/build.py
MAKEQURAN=${SCRIPTSDIR}/mkquran.py
PY ?= python
TTF=$(FONTS:%=${FONTSDIR}/%.ttf)
HTML=$(DOC)/Documentation-Arabic.html
FEA=$(wildcard $(SRC)/*.fea)
export SOURCE_DATE_EPOCH ?= 0
all: ttf
ttf: $(TTF)
doc: $(HTML)
$(BUILDDIR)/$(NAME).designspace: $(SRC)/$(NAME).glyphspackage
@echo " UFO $@"
@glyphs2ufo --minimal --generate-GDEF --output-dir=$(BUILDDIR) $<
$(BUILDDIR)/%.ufo: $(BUILDDIR)/$(NAME).designspace
@echo " UFO $@"
${FONTSDIR}/$(NAME)QuranColored.ttf: $(BUILDDIR)/$(NAME)-Regular.ufo $(SRC)/$(LATIN)-Regular.ufo $(SRC)/$(NAME).fea $(FEA) $(LICENSE) $(BUILD)
@echo " GEN $@"
@$(PY) $(BUILD) --input $< --output $@ --features=$(SRC)/$(NAME).fea --version $(VERSION) --license $(LICENSE) --quran
${FONTSDIR}/$(NAME)Quran.ttf: ${FONTSDIR}/$(NAME)QuranColored.ttf $(MAKEQURAN)
@echo " GEN $@"
@$(PY) $(MAKEQURAN) $< $@
${FONTSDIR}/$(NAME)-Regular.ttf: $(BUILDDIR)/$(NAME)-Regular.ufo $(SRC)/$(LATIN)-Regular.ufo $(SRC)/$(NAME).fea $(FEA) $(LICENSE) $(BUILD)
@echo " GEN $@"
@$(PY) $(BUILD) --input $< --output $@ --features=$(SRC)/$(NAME).fea --version $(VERSION) --license $(LICENSE)
${FONTSDIR}/$(NAME)-Italic.ttf: $(BUILDDIR)/$(NAME)-Regular.ufo $(SRC)/$(LATIN)-Italic.ufo $(SRC)/$(NAME).fea $(FEA) $(LICENSE) $(BUILD)
@echo " GEN $@"
@$(PY) $(BUILD) --input $< --output $@ --features=$(SRC)/$(NAME).fea --version $(VERSION) --license $(LICENSE) --slant=10
${FONTSDIR}/$(NAME)-Bold.ttf: $(BUILDDIR)/$(NAME)-Bold.ufo $(SRC)/$(LATIN)-Bold.ufo $(SRC)/$(NAME).fea $(FEA) $(LICENSE) $(BUILD)
@echo " GEN $@"
@$(PY) $(BUILD) --input $< --output $@ --features=$(SRC)/$(NAME).fea --version $(VERSION) --license $(LICENSE)
${FONTSDIR}/$(NAME)-BoldItalic.ttf: $(BUILDDIR)/$(NAME)-Bold.ufo $(SRC)/$(LATIN)-BoldItalic.ufo $(SRC)/$(NAME).fea $(FEA) $(LICENSE) $(BUILD)
@echo " GEN $@"
@$(PY) $(BUILD) --input $< --output $@ --features=$(SRC)/$(NAME).fea --version $(VERSION) --license $(LICENSE) --slant=10
$(DOC)/Documentation-Arabic.html: $(DOC)/Documentation-Arabic.md
@echo " GEN $@"
@pandoc $< -o $@ -f markdown-smart -t html -s -c Documentation-Arabic.css
check: $(TTF)
@$(foreach font,$+,echo " OTS $(font)" && python -m ots --quiet $(font) &&) true
clean:
rm -rfv $(TTF) $(HTML)
distclean: clean
rm -rf $(DIST){,.zip}
dist: ttf check pack doc
@echo " DIST $(DIST)"
@rm -rf $(DIST){,.zip}
@install -Dm644 -t $(DIST) $(LICENSE)
@install -Dm644 -t $(DIST) $(TTF)
@install -Dm644 -t $(DIST) README.md
@install -Dm644 -t $(DIST) README-Arabic.md
@install -Dm644 -t $(DIST) NEWS.md
@install -Dm644 -t $(DIST) NEWS-Arabic.md
@install -Dm644 -t $(DIST) $(HTML)
@echo " DROP GLYPH NAMES"
@$(PY) ${SCRIPTSDIR}/no-glyphnames.py $(DIST)/*.ttf
@echo " ZIP $(DIST)"
@zip -rq $(DIST).zip $(DIST)