|
1 |
| -SOURCES=$(shell python3 scripts/read-config.py --sources ) |
2 |
| -FAMILY=$(shell python3 scripts/read-config.py --family ) |
3 |
| -DRAWBOT_SCRIPTS=$(shell ls documentation/*.py) |
4 |
| -DRAWBOT_OUTPUT=$(shell ls documentation/*.py | sed 's/\.py/.png/g') |
| 1 | +ARCHIVE = sudo.zip |
| 2 | +DISTDIR = dist |
| 3 | +FONTDIR = sudo |
| 4 | +prefix = /usr/local |
5 | 5 |
|
6 |
| -help: |
7 |
| - @echo "###" |
8 |
| - @echo "# Build targets for $(FAMILY)" |
9 |
| - @echo "###" |
10 |
| - @echo |
11 |
| - @echo " make build: Builds the fonts and places them in the fonts/ directory" |
12 |
| - @echo " make test: Tests the fonts with fontbakery" |
13 |
| - @echo " make proof: Creates HTML proof documents in the proof/ directory" |
14 |
| - @echo " make images: Creates PNG specimen images in the documentation/ directory" |
15 |
| - @echo |
| 6 | +.PHONY: all |
| 7 | +all: build |
16 | 8 |
|
17 |
| -build: build.stamp |
18 | 9 |
|
19 |
| -venv: venv/touchfile |
| 10 | +.PHONY: build |
| 11 | +build: $(FONTDIR) |
20 | 12 |
|
21 |
| -venv-test: venv-test/touchfile |
22 | 13 |
|
23 |
| -customize: venv |
24 |
| - . venv/bin/activate; python3 scripts/customize.py |
25 |
| - |
26 |
| -build.stamp: venv sources/config.yaml $(SOURCES) |
27 |
| - rm -rf fonts |
28 |
| - (for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp |
29 |
| - |
30 |
| -venv/touchfile: requirements.txt |
31 |
| - test -d venv || python3 -m venv venv |
32 |
| - . venv/bin/activate; pip install -Ur requirements.txt |
33 |
| - touch venv/touchfile |
| 14 | +.PHONY: clean |
| 15 | +clean: |
| 16 | + $(MAKE) -C $(FONTDIR) clean |
34 | 17 |
|
35 |
| -venv-test/touchfile: requirements-test.txt |
36 |
| - test -d venv-test || python3 -m venv venv-test |
37 |
| - . venv-test/bin/activate; pip install -Ur requirements-test.txt |
38 |
| - touch venv-test/touchfile |
39 | 18 |
|
40 |
| -test: venv-test build.stamp |
41 |
| - 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.' |
| 19 | +.PHONY: dist |
| 20 | +dist: webfonts $(DISTDIR)/$(ARCHIVE) |
42 | 21 |
|
43 |
| -proof: venv build.stamp |
44 |
| - 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 |
45 | 22 |
|
46 |
| -images: venv $(DRAWBOT_OUTPUT) |
| 23 | +.PHONY: $(FONTDIR) |
| 24 | +$(FONTDIR): |
| 25 | + $(MAKE) -C $@ |
47 | 26 |
|
48 |
| -%.png: %.py build.stamp |
49 |
| - . venv/bin/activate; python3 $< --output $@ |
50 | 27 |
|
51 |
| -clean: |
52 |
| - rm -rf venv |
53 |
| - find . -name "*.pyc" -delete |
| 28 | +$(DISTDIR)/$(ARCHIVE): $(FONTDIR) |
| 29 | + if test -e $(DISTDIR); then \ |
| 30 | + rm -f $(DISTDIR)/$(ARCHIVE); \ |
| 31 | + else \ |
| 32 | + mkdir $(DISTDIR); \ |
| 33 | + fi |
| 34 | + zip -r $(DISTDIR)/$(ARCHIVE) $(FONTDIR)/ --exclude "*.DS_Store" "*Makefile" |
54 | 35 |
|
55 |
| -update-project-template: |
56 |
| - npx update-template https://github.com/googlefonts/googlefonts-project-template/ |
57 | 36 |
|
58 |
| -update: venv venv-test |
59 |
| - venv/bin/pip install --upgrade pip-tools |
60 |
| - # See https://pip-tools.readthedocs.io/en/latest/#a-note-on-resolvers for |
61 |
| - # the `--resolver` flag below. |
62 |
| - venv/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements.in |
63 |
| - venv/bin/pip-sync requirements.txt |
| 37 | +.PHONY: install-debian |
| 38 | +install-debian: |
| 39 | + $(MAKE) -C $(FONTDIR) install-debian |
64 | 40 |
|
65 |
| - venv-test/bin/pip install --upgrade pip-tools |
66 |
| - venv-test/bin/pip-compile --upgrade --verbose --resolver=backtracking requirements-test.in |
67 |
| - venv-test/bin/pip-sync requirements-test.txt |
68 | 41 |
|
69 |
| - git commit -m "Update requirements" requirements.txt requirements-test.txt |
70 |
| - git push |
| 42 | +.PHONY: webfonts |
| 43 | +webfonts: |
| 44 | + $(MAKE) -C $(FONTDIR) webfonts |
0 commit comments