.PHONY: all clean ttf web pack check VERSION=0.100 TOOLS=tools SRC=sources WEB=web DOC=documentation TESTS=test-suite FONTS=amiri-regular amiri-slanted DOCS=README README-Arabic NEWS NEWS-Arabic BUILD=$(TOOLS)/build.py RUNTEST=$(TOOLS)/runtest.py FF=python $(BUILD) MKEOT=ttf2eot MKWOFF=sfnt2woff SFDS=$(FONTS:%=$(SRC)/%.sfd) DTTF=$(FONTS:%=%.ttf) WTTF=$(FONTS:%=$(WEB)/%.ttf) WOFF=$(FONTS:%=$(WEB)/%.woff) EOTS=$(FONTS:%=$(WEB)/%.eot) PDFS=$(DOC)/amiri-table.pdf CSSS=$(WEB)/amiri.css FEAT=$(wildcard $(SRC)/*.fea) TEST=$(wildcard $(TESTS)/*.test) DOCFILES=$(DOCS:%=$(DOC)/%.txt) license=OFL.txt OFL-FAQ.txt all: ttf web ttf: $(DTTF) web: $(WTTF) $(WOFF) $(EOTS) $(CSSS) doc: $(PDFS) $(WEB)/%.ttf: %.ttf $(BUILD) @echo " FF\t$@" @mkdir -p $(WEB) @$(FF) --input $< --output $@ --web %.ttf: $(SRC)/%.sfd $(SRC)/%.fea $(FEAT) $(BUILD) @echo " FF\t$@" @$(FF) --input $< --output $@ --desktop --feature-file $(<:%.sfd=%.fea) --version $(VERSION) --no-localised-name %-slanted.ttf: $(SRC)/%-regular.sfd $(SRC)/%-regular.fea $(FEAT) $(BUILD) @echo " FF\t$@" @$(FF) --input $< --output $@ --desktop --feature-file $(<:%.sfd=%.fea) --version $(VERSION) --no-localised-name --slant=7 $(WEB)/%.woff: $(WEB)/%.ttf @echo " FF\t$@" @mkdir -p $(WEB) @$(MKWOFF) $< $(WEB)/%.eot: $(WEB)/%.ttf @echo " FF\t$@" @mkdir -p $(WEB) @$(MKEOT) $< > $@ $(WEB)/%.css: $(WTTF) $(BUILD) @echo " GEN\t$@" @mkdir -p $(WEB) @$(FF) --css --input "$(WTTF)" --output $@ --version $(VERSION) $(DOC)/amiri-table.pdf: amiri-regular.ttf @echo " GEN\t$@" @mkdir -p $(DOC) @fntsample --font-file $< --output-file $@.tmp --print-outline > $@.txt @pdfoutline $@.tmp $@.txt $@ @rm -f $@.tmp $@.txt check: $(TEST) $(DTTF) ifeq ($(shell which hb-shape),) @echo "hb-shape not found, skipping tests" else @echo "running tests" @$(RUNTEST) $(TEST) endif clean: rm -rfv $(DTTF) $(WTTF) $(WOFF) $(EOTS) $(CSSS) $(PDFS)