-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (65 loc) · 3.33 KB
/
Makefile
File metadata and controls
84 lines (65 loc) · 3.33 KB
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
SOURCES=$(shell python3 scripts/read-config.py --sources )
FAMILY=$(shell python3 scripts/read-config.py --family )
help:
@echo "###"
@echo "# Build targets for $(FAMILY)"
@echo "###"
@echo
@echo " make dev: Produce only the variable font for testing during development."
@echo " make build: Produce static and variable fonts in all font file formats (.otf, .ttf, .woff, .woff2)."
@echo " make test: Run [FontBakery](https://github.com/googlefonts/fontbakery)’s quality assurance tests."
@echo " make proof: Generate HTML proof files."
@echo
build: build.stamp
venv: venv/touchfile
venv-test: venv-test/touchfile
customize: venv
. venv/bin/activate; python3.10 scripts/customize.py
dev: venv sources/config.yaml $(SOURCES)
rm -rf fonts
rm -rf ./sources/build; \
. venv/bin/activate; python3.10 scripts/build/glyphsToUFO.py; \
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done);
build.stamp: venv sources/config.yaml $(SOURCES)
rm -rf fonts
rm -rf ./sources/build
. venv/bin/activate; \
python3.10 scripts/build/glyphsToUFO.py; \
gftools builder sources/config.yaml && touch build.stamp
build-variableCFF: venv sources/config.yaml $(SOURCES)
rm -rf fonts
rm -rf ./sources/build; \
. venv/bin/activate; python3.10 scripts/build/glyphsToUFO.py; \
gftools builder sources/config-variableCFF.yaml && touch build.stamp
tv: venv build.stamp
python3.10 scripts/build/makeFonts.py
venv/touchfile: requirements.txt
test -d venv || python3.10 -m venv venv
. venv/bin/activate; pip install -Ur requirements.txt
touch venv/touchfile
venv-test/touchfile: requirements-test.txt
test -d venv-test || python3.10 -m venv venv-test
. venv-test/bin/activate; pip install -Ur requirements-test.txt
touch venv-test/touchfile
test: venv-test build.stamp
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv-test/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $$TOCHECK || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'
proof: venv build.stamp
TOCHECK=$$(find fonts/variable -type f 2>/dev/null); if [ -z "$$TOCHECK" ]; then TOCHECK=$$(find fonts/ttf -type f 2>/dev/null); fi ; . venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $$TOCHECK -o out/proof
%.png: %.py build.stamp
. venv/bin/activate; python3 $< --output $@
clean:
rm -rf venv
find . -name "*.pyc" -delete
update-project-template:
npx update-template https://github.com/googlefonts/googlefonts-project-template/
update: venv venv-test
venv/bin/pip install --upgrade pip-tools
# See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for
# the `--resolver` flag below.
venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in
venv/bin/pip-sync requirements.txt
venv-test/bin/pip install --upgrade pip-tools
venv-test/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements-test.in
venv-test/bin/pip-sync requirements-test.txt
git commit -m "Update requirements" requirements.txt requirements-test.txt
git push