2018-12-07 04:49:28 +08:00
|
|
|
NAME=XITS
|
2019-11-16 21:16:45 +08:00
|
|
|
VERSION=1.302
|
2018-12-07 04:49:28 +08:00
|
|
|
|
|
|
|
SRC=sources
|
|
|
|
WEB=webfonts
|
|
|
|
TOOLS=tools
|
|
|
|
DIST=$(NAME)-$(VERSION)
|
|
|
|
DIST_CTAN=$(DIST)-CTAN
|
|
|
|
|
|
|
|
PY=python
|
|
|
|
MAKEFNT=$(TOOLS)/makefnt.py
|
|
|
|
MAKEWEB=$(TOOLS)/makeweb.py
|
2019-11-16 21:16:45 +08:00
|
|
|
NORMALIZE=$(TOOLS)/sfdnormalize.py
|
2018-12-07 04:49:28 +08:00
|
|
|
|
|
|
|
FONTS=$(NAME)Math-Regular $(NAME)Math-Bold \
|
|
|
|
$(NAME)-Regular $(NAME)-Bold $(NAME)-Italic $(NAME)-BoldItalic
|
|
|
|
|
|
|
|
SFD=$(FONTS:%=$(SRC)/%.sfd)
|
|
|
|
OTF=$(FONTS:%=%.otf)
|
|
|
|
WOF=$(FONTS:%=$(WEB)/%.woff)
|
2019-11-16 21:16:45 +08:00
|
|
|
NRM=$(FONTS:%=$(SRC)/%.nrm)
|
|
|
|
CHK=$(FONTS:%=$(SRC)/%.chk)
|
2018-12-07 04:49:28 +08:00
|
|
|
|
|
|
|
all: otf
|
|
|
|
|
|
|
|
otf: $(OTF)
|
|
|
|
web: $(WOF)
|
2019-11-16 21:16:45 +08:00
|
|
|
normalize: $(NRM)
|
|
|
|
check: $(CHK)
|
2018-12-07 04:49:28 +08:00
|
|
|
|
|
|
|
%.otf: $(SRC)/%.sfd $(SRC)/%.fea
|
|
|
|
@echo "Building $@"
|
|
|
|
@$(PY) $(MAKEFNT) $< $@ --version=$(VERSION) --features=$(word 2,$+)
|
|
|
|
|
2019-11-16 21:16:45 +08:00
|
|
|
%.nrm: %.sfd $(NORMALIZE)
|
|
|
|
@echo "Normalizing $(*F)"
|
|
|
|
@$(PY) $(NORMALIZE) $< $@
|
|
|
|
@if [ "`diff -u $< $@`" ]; then cp $@ $<; touch $@; fi
|
|
|
|
|
|
|
|
%.chk: %.sfd $(NORMALIZE)
|
|
|
|
@echo "Normalizing $(*F)"
|
|
|
|
@$(PY) $(NORMALIZE) $< $@
|
|
|
|
@diff -u $< $@ || (rm -rf $@ && false)
|
|
|
|
|
2018-12-07 04:49:28 +08:00
|
|
|
$(WEB)/%.woff: %.otf
|
|
|
|
@echo "Building $@"
|
|
|
|
@mkdir -p $(WEB)
|
|
|
|
@$(PY) $(MAKEWEB) $< $(WEB)
|
|
|
|
|
2019-11-16 21:16:45 +08:00
|
|
|
dist: check dist-ctan $(OTF) $(WOF)
|
2018-12-07 04:49:28 +08:00
|
|
|
@echo "Making dist tarball"
|
|
|
|
@mkdir -p $(DIST)/$(WEB)
|
|
|
|
@cp $(OTF) $(DIST)
|
|
|
|
@cp $(WOF) $(DIST)/$(WEB)
|
2019-11-16 21:16:45 +08:00
|
|
|
@cp -r OFL.txt FONTLOG.txt $(DIST)
|
2018-12-07 04:49:28 +08:00
|
|
|
@cp README.md $(DIST)/README.txt
|
|
|
|
@zip -r $(DIST).zip $(DIST)
|
|
|
|
|
2019-11-16 21:16:45 +08:00
|
|
|
dist-ctan: $(OTF)
|
2018-12-07 04:49:28 +08:00
|
|
|
@echo "Making CTAN dist tarball"
|
|
|
|
@mkdir -p $(DIST_CTAN)
|
|
|
|
@cp $(OTF) $(DIST_CTAN)
|
2019-11-16 21:16:45 +08:00
|
|
|
@cp -r OFL.txt FONTLOG.txt $(DIST_CTAN)
|
2018-12-07 04:49:28 +08:00
|
|
|
@cp README.md $(DIST_CTAN)/README.txt
|
|
|
|
@zip -r $(DIST_CTAN).zip $(DIST_CTAN)
|
|
|
|
|
|
|
|
clean:
|
2019-11-16 21:16:45 +08:00
|
|
|
@rm -rf $(OTF) $(DIST) $(DIST).zip $(DIST_CTAN) $(DIST_CTAN).zip $(NRM)\
|
|
|
|
$(CHK)
|