summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2019-10-23 06:15:09 +0300
committerRasmus Andersson <rasmus@notion.se>2019-10-23 06:15:09 +0300
commit55d38ccee8f08f367c4a491a2b5cb5fe6fba0c4d (patch)
treecdb60923d03f37d38446ae149d2c203d5eefa770 /Makefile
parente6b25408d95536c1d26c2c65ac664e72033fe200 (diff)
downloadinter-55d38ccee8f08f367c4a491a2b5cb5fe6fba0c4d.tar.xz
makefile: UFO files move to build/ufo
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile93
1 files changed, 48 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index 0477ad50a..07dca74ad 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
# all_var_hinted Build all variable font files with hints into
# FONTDIR/var-hinted
#
-# designspace Build src/Inter.designspace from src/Inter.glyphs
+# designspace Build build/ufo/Inter.designspace from src/Inter.glyphs
#
# Style-specific targets:
# STYLE_otf Build OTF file for STYLE into FONTDIR/const
@@ -42,6 +42,7 @@ FONTDIR = build/fonts
all: all_const all_const_hinted all_var
web: all_web
+.PHONY: all web
all_const: all_otf all_ttf all_web
all_const_hinted: all_ttf_hinted all_web_hinted
@@ -58,13 +59,6 @@ all_var: \
$(FONTDIR)/var/Inter-italic.var.otf \
$(FONTDIR)/var/Inter-italic.var.woff2
-all_ufo_masters = $(Thin_ufo_d) \
- $(ThinItalic_ufo_d) \
- $(Regular_ufo_d) \
- $(Italic_ufo_d) \
- $(Black_ufo_d) \
- $(BlackItalic_ufo_d)
-
# Hinted variable font disabled. See https://github.com/rsms/inter/issues/75
# all_var_hinted: $(FONTDIR)/var-hinted/Inter.var.otf $(FONTDIR)/var-hinted/Inter.var.woff2
# .PHONY: all_var_hinted
@@ -78,62 +72,63 @@ export PATH := $(PWD)/build/venv/bin:$(PATH)
include build/etc/generated.make
-# TTF -> WOFF2
+# WOFF2 from OTF
build/%.var.woff2: build/%.var.otf
woff2_compress "$<"
+
+# WOFF2 from TTF
build/%.woff2: build/%.ttf
woff2_compress "$<"
-# TTF -> WOFF
+# WOFF from TTF
build/%.woff: build/%.ttf
ttf2woff -O -t woff "$<" "$@"
-# make sure intermediate TTFs are not gc'd by make
-.PRECIOUS: build/%.ttf build/%.var.otf
-
-# Master UFOs -> variable TTF
-$(FONTDIR)/var/Inter.var.otf: src/Inter.designspace $(all_ufo_masters) version.txt
- misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) $<
+# VF OTF from UFO
+$(FONTDIR)/var/Inter.var.otf: $(all_ufo_masters) version.txt
+ misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) build/ufo/Inter.designspace
$(FONTDIR)/var/Inter-V.var.otf: $(FONTDIR)/var/Inter.var.otf
misc/fontbuild rename --family "Inter V" -o $@ $<
-$(FONTDIR)/var/Inter-%.var.otf: src/Inter-%.designspace $(all_ufo_masters) version.txt
+$(FONTDIR)/var/Inter-%.var.otf: build/ufo/Inter-%.designspace $(all_ufo_masters) version.txt
misc/fontbuild compile-var -o $@ $(FONTBUILD_FLAGS) $<
misc/tools/fix-vf-meta.py $@
-# Instance UFO -> OTF, TTF (note: masters' rules in generated.make)
+# OTF/TTF from UFO
$(FONTDIR)/const/Inter-%.otf: build/ufo/Inter-%.ufo version.txt
- misc/fontbuild compile -o $@ $(FONTBUILD_FLAGS) $<
+ misc/fontbuild compile -o $@ $(FONTBUILD_FLAGS) build/ufo/Inter-$*.ufo
$(FONTDIR)/const/Inter-%.ttf: build/ufo/Inter-%.ufo version.txt
- misc/fontbuild compile -o $@ $(FONTBUILD_FLAGS) $<
-
+ misc/fontbuild compile -o $@ $(FONTBUILD_FLAGS) build/ufo/Inter-$*.ufo
-# designspace <- glyphs file
-src/Inter-roman.designspace: src/Inter.designspace
-src/Inter-italic.designspace: src/Inter.designspace
-src/Inter.designspace: src/Inter.glyphs
- misc/fontbuild glyphsync $<
-# make sure intermediate files are not gc'd by make
-.PRECIOUS: src/Inter-*.designspace
+# DESIGNSPACE from GLYPHS
+build/ufo/Inter-roman.designspace: build/ufo/Inter.designspace
+build/ufo/Inter-italic.designspace: build/ufo/Inter.designspace
+build/ufo/Inter.designspace: src/Inter.glyphs
+ misc/fontbuild glyphsync -o build/ufo src/Inter.glyphs
-designspace: src/Inter.designspace
-.PHONY: designspace
# short-circuit Make for performance
src/Inter.glyphs:
@true
-# instance UFOs <- master UFOs
-build/ufo/Inter-%.ufo: build/ufo/features src/Inter.designspace $(all_ufo_masters)
- misc/fontbuild instancegen src/Inter.designspace $*
+# make sure intermediate files are not gc'd by make
+.PRECIOUS: build/ufo/Inter-*.designspace
+
+designspace: build/ufo/Inter.designspace
+.PHONY: designspace
+
-build/ufo/features:
+# features
+src/features: $(wildcard src/features/*)
+ touch "$@"
+ @true
+build/ufo/features: src/features
mkdir -p build/ufo
ln -s ../../src/features build/ufo/features
@@ -156,7 +151,10 @@ $(FONTDIR)/const-hinted/%.ttf: $(FONTDIR)/const/%.ttf
# ttfautohint --fallback-stem-width=256 --no-info "$<" "$@"
# make sure intermediate TTFs are not gc'd by make
-.PRECIOUS: $(FONTDIR)/const/%.ttf $(FONTDIR)/const-hinted/%.ttf $(FONTDIR)/var/%.var.otf
+.PRECIOUS: $(FONTDIR)/const/%.ttf
+.PRECIOUS: $(FONTDIR)/const/%.otf
+.PRECIOUS: $(FONTDIR)/const-hinted/%.ttf
+.PRECIOUS: $(FONTDIR)/var/%.var.otf
@@ -321,17 +319,18 @@ docs_fonts:
docs/_data/fontinfo.json: docs/font-files/Inter-Regular.otf misc/tools/fontinfo.py
misc/tools/fontinfo.py -pretty $< > docs/_data/fontinfo.json
-docs/lab/glyphinfo.json: build/UnicodeData.txt misc/tools/gen-glyphinfo.py $(Regular_ufo_d)
- misc/tools/gen-glyphinfo.py -ucd $< src/Inter-Regular.ufo > $@
+docs/lab/glyphinfo.json: misc/tools/gen-glyphinfo.py build/ufo/Inter-Regular.ufo
+ misc/tools/gen-glyphinfo.py -ucd misc/UnicodeData.txt build/ufo/Inter-Regular.ufo > $@
-docs/glyphs/metrics.json: $(Regular_ufo_d) misc/tools/gen-metrics-and-svgs.py
- misc/tools/gen-metrics-and-svgs.py src/Inter-Regular.ufo
+docs/glyphs/metrics.json: misc/tools/gen-metrics-and-svgs.py build/ufo/Inter-Regular.ufo
+ misc/tools/gen-metrics-and-svgs.py build/ufo/Inter-Regular.ufo
-# Download latest Unicode data
-build/UnicodeData.txt:
- @echo fetch http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
- @curl '-#' -o "$@" http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
+# Helper target to download latest Unicode data. Nothing depends on this.
+ucd_version := 12.1.0
+update_UnicodeData:
+ @echo "# Unicode $(ucd_version)" > misc/UnicodeData.txt
+ curl '-#' "https://www.unicode.org/Public/$(ucd_version)/ucd/UnicodeData.txt" >> misc/UnicodeData.txt
# Google fonts
@@ -370,8 +369,12 @@ install_otf: all_otf
install: install_otf
+.PHONY: install install_otf install_ttf
+
+
+
# clean removes generated and built fonts in the build directory
clean:
- rm -rvf build/tmp build/fonts
+ rm -rvf build/tmp build/fonts build/ufo build/googlefonts
-.PHONY: all web clean install install_otf install_ttf
+.PHONY: clean