font = GentooNewage

PN = gentoo-newage
PV = $(shell sed -n 's/^Version:[ \t]*//;T;p;q' GentooNewage.sfd)
P = $(PN)-$(PV)

DISTFILES = README LICENSE Makefile \
	GentooNewage.sfd GentooNewage.pfb GentooNewage.afm \
	GentooNewage.tfm GentooNewage.enc \
	gentoonewage.map ugentoonewage.fd gentoonewage.sty

all: $(font).pfb $(font).afm $(font).tfm $(font).enc

%.pfb %.afm %.tfm %.enc: %.sfd
	fontforge -c 'open("$<").generate("$*.pfb", flags = ("afm", "tfm"))'

dist: $(DISTFILES)
	tar -cJf $(P).tar.xz --transform='s%^%$(P)/%' $^

clean:
	rm -f $(font).pfb $(font).afm $(font).tfm $(font).enc
