Created
September 20, 2019 18:34
-
-
Save chrissimpkins/c6e23e0586ef5320c4909c2039310167 to your computer and use it in GitHub Desktop.
Example Makefile for font projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define project name | |
PROJECT=replaceme-with-project-name | |
# define path to the font build directory for tests | |
FONT_DIR="/path/to/font/file/directory" | |
venv: | |
python3 -m venv ~/venv/$(PROJECT) | |
# can't activate and deactivate from Makefile | |
# because it runs new subshells for each | |
# command... | |
# venv-activate: | |
# . ~/venv/$(PROJECT)/bin/activate | |
# venv-deactivate: | |
# deactivate | |
install-dep: | |
# requirements.txt should define all project dependencies for | |
# builds and testing | |
pip3 install -r requirements.txt | |
build: | |
# add all build commands to this block | |
# NOTE: important to use TAB for spacing from | |
# left margin in Makefiles (not spaces) | |
# Static instance builds | |
fontmake -g [SOURCE PATH 1] --interpolate -o ttf | |
# Variable font builds | |
fontmake -g [SOURCE PATH 1] -o variable | |
# TODO: could include move source to place the | |
# builds in the proper directory to follow the | |
# fontmake steps above | |
test-fontbakery: | |
fontbakery check-googlefonts $(FONT_DIR)/*.ttf | |
.PHONY: venv install-dep build test-fontbakery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a venv
Activate / deactivate the venv
Must be done manually instead of from the Makefile
Add project dependencies to your activated venv
add the dependencies to a
requirements.txt
file in the root of the repository, then run:Build font files
Test with fontbakery
Can add new make targets in the file with the same format and associated command line strings that you use for execution and then run it with
make
followed by the target name. Make sure to use TAB to space the commands from the left margin, not spaces.