-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
83 lines (66 loc) · 2.3 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
# Copyright (c) 2020-2024 Khaled Hosny
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
NAME = Raqq
SHELL = bash
MAKEFLAGS := -srj
PYTHON := venv/bin/python3
SOURCEDIR = sources
SCRIPTDIR = scripts
FONTDIR = fonts
TESTDIR = tests
BUILDDIR = build
NAMES = ${NAME} ${NAME}Sura
FONTS = ${NAMES:%=${FONTDIR}/%.ttf}
WOFF2 = ${NAMES:%=${FONTDIR}/%.woff2}
JSON = ${TESTDIR}/shaping.json
FEA = ${NAMES:%=${SOURCEDIR}/%-overhang.fea}
HTML = ${NAMES:%=${TESTDIR}/%-shaping.html}
GLYPHDATA = ${SOURCEDIR}/GlyphData.xml
TAG = $(shell git describe --tags --abbrev=0)
VERSION = ${TAG:v%=%}
DIST = ${NAME}-${VERSION}
.SECONDARY:
.ONESHELL:
.PHONY: all dist test ttf web
all: ttf web
ttf: ${FONTS}
test: ${HTML}
expectation: ${JSON}
web: ${WOFF2}
update-fea: ${FONTS}
fonts=(${FONTS})
fea=(${FEA})
for i in $${!fonts[@]}; do
echo " GEN $${fea[$$i]}"
${PYTHON} ${SCRIPTDIR}/update-overhang-fea.py $${fonts[$$i]} $${fea[$$i]}
done
${FONTDIR}/%.ttf: ${SOURCEDIR}/%.glyphspackage ${GLYPHDATA} ${SOURCEDIR}/%-overhang.fea
$(info BUILD ${@F})
${PYTHON} ${SCRIPTDIR}/build.py $< ${VERSION} $@ --data=${GLYPHDATA}
${FONTDIR}/%.woff2: ${FONTDIR}/%.ttf
$(info WOFF2 ${@F})
${PYTHON} ${SCRIPTDIR}/buildwoff2.py $< $@
${TESTDIR}/%-shaping.html: ${FONTDIR}/%.ttf ${TESTDIR}/shaping-config.yml
$(info SHAPE ${<F})
${PYTHON} -m alifTools.shaping.check $< ${TESTDIR}/shaping-config.yml $@
${TESTDIR}/shaping.json: ${TESTDIR}/shaping.yaml ${FONTS}
$(info GEN ${@F})
${PYTHON} -m alifTools.shaping.update $< $@ ${FONTS}
dist: ${FONTS}
$(info DIST ${DIST}.zip)
install -Dm644 -t ${DIST} ${FONTS}
install -Dm644 -t ${DIST} {README,README-Arabic}.txt
install -Dm644 -t ${DIST} LICENSE
zip -rq ${DIST}.zip ${DIST}