# Makefile for mozilla-fonts

DESTDIR	= /usr/local/lib/X11/fonts/Mozilla

INSTALL = install

# -------- No user-serviceable parts below --------

VERSION = 1.0

BDFFILES = \
	cour1.bdf \
	cour2.bdf \
	cour3.bdf \
	cour4.bdf \
	cour5.bdf \
	cour6.bdf \
	cour7.bdf \
	courb1.bdf \
	courb2.bdf \
	courb3.bdf \
	courb4.bdf \
	courb5.bdf \
	courb6.bdf \
	courb7.bdf \
	courbi1.bdf \
	courbi2.bdf \
	courbi3.bdf \
	courbi4.bdf \
	courbi5.bdf \
	courbi6.bdf \
	courbi7.bdf \
	couri1.bdf \
	couri2.bdf \
	couri3.bdf \
	couri4.bdf \
	couri5.bdf \
	couri6.bdf \
	couri7.bdf \
	helv0.bdf \
	helv1.bdf \
	helv2.bdf \
	helv3.bdf \
	helv4.bdf \
	helv5.bdf \
	helv6.bdf \
	helv7.bdf \
	helvb1.bdf \
	helvb2.bdf \
	helvb3.bdf \
	helvb4.bdf \
	helvb5.bdf \
	helvb6.bdf \
	helvb7.bdf \
	helvbi1.bdf \
	helvbi2.bdf \
	helvbi3.bdf \
	helvbi4.bdf \
	helvbi5.bdf \
	helvbi6.bdf \
	helvbi7.bdf \
	helvi1.bdf \
	helvi2.bdf \
	helvi3.bdf \
	helvi4.bdf \
	helvi5.bdf \
	helvi6.bdf \
	helvi7.bdf \
	times1.bdf \
	times2.bdf \
	times3.bdf \
	times4.bdf \
	times5.bdf \
	times6.bdf \
	times7.bdf \
	timesb1.bdf \
	timesb2.bdf \
	timesb3.bdf \
	timesb4.bdf \
	timesb5.bdf \
	timesb6.bdf \
	timesb7.bdf \
	timesbi1.bdf \
	timesbi2.bdf \
	timesbi3.bdf \
	timesbi4.bdf \
	timesbi5.bdf \
	timesbi6.bdf \
	timesbi7.bdf \
	timesi1.bdf \
	timesi2.bdf \
	timesi3.bdf \
	timesi4.bdf \
	timesi5.bdf \
	timesi6.bdf \
	timesi7.bdf

PCFFILES = $(BDFFILES:bdf=pcf)

DIST = mozilla-fonts-$(VERSION)

DISTFILES = Makefile README fonts.alias $(BDFFILES)

# -------- Rules --------

all: $(PCFFILES)

.SUFFIXES: .bdf .pcf

.bdf.pcf:
	bdftopcf $< -o $@

install: $(PCFFILES)
	mkdir -p $(DESTDIR)
	@for font in $(PCFFILES) ; do \
		echo " $(INSTALL) -m 644 $$font $(DESTDIR)/$$font" ; \
		$(INSTALL) -m 644 $$font $(DESTDIR)/$$font || exit 1 ; \
	done
	$(INSTALL) -m 644 fonts.alias $(DESTDIR)/fonts.alias
	cd $(DESTDIR) && mkfontdir

clean:
	rm -f *.pcf

dist:
	rm -rf $(DIST) $(DIST).tar.gz
	mkdir $(DIST)
	cp $(DISTFILES) $(DIST)
	tar cf $(DIST).tar $(DIST)
	rm -r $(DIST)
	gzip --best $(DIST).tar

# end Makefile
