Skip to content

Commit df9f5bc

Browse files
committed
I want my Makefile
1 parent df1e340 commit df9f5bc

File tree

2 files changed

+30
-56
lines changed

2 files changed

+30
-56
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Build Debian Package
2020
run: scripts/prepare-deb.sh
2121
- name: Build
22-
run: make -f private-build/Makefile dist
22+
run: make dist
2323
- name: Release
2424
uses: softprops/[email protected]
2525
with:

Makefile

+29-55
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,44 @@
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
55

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
168

17-
build: build.stamp
189

19-
venv: venv/touchfile
10+
.PHONY: build
11+
build: $(FONTDIR)
2012

21-
venv-test: venv-test/touchfile
2213

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
3417

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
3918

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)
4221

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
4522

46-
images: venv $(DRAWBOT_OUTPUT)
23+
.PHONY: $(FONTDIR)
24+
$(FONTDIR):
25+
$(MAKE) -C $@
4726

48-
%.png: %.py build.stamp
49-
. venv/bin/activate; python3 $< --output $@
5027

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"
5435

55-
update-project-template:
56-
npx update-template https://github.com/googlefonts/googlefonts-project-template/
5736

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
6440

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
6841

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

Comments
 (0)