#
# Makefile for the creation of misc fonts
#
# make pcf  : creates the pcf set (fonts are created in the FDIR dir!)
# make pcfz : as above but also compresses fonts (XFree can do compressed fonts)
#
# Make sure that you B2POPTS acoordingly for your machine (see below)
#
# For how to use the fonts with your X server see the README file
#
# (c) 1995 A. Haritsis <ah@doc.ic.ac.uk>
# DISTRIBUTE FREELY BUT KEEP THIS NOTICE INTACT. NO WARRANTIES.
#

# directory to put the created pcf files
TOPDIR=../inst
FDIR = $(TOPDIR)/75dpi

SHELL=/bin/sh
# --------------------- Compile bdf into pcf ---------------------------

BDF2PCF = bdftopcf

# CHANGE THIS TO REFLECT YOUR ARCHITECTURE. pcf files produced with the
# wrong values will STILL work but wil be slightly slower.
# byte order : -L (little endian) -M (big endian)
# bit order  : -l (LSBit first)   -m (MSBit first)
# You can use .bdf files directly with X servers. But pcf will be
# FASTER.
B2POPTS = -t -L -m	# Intel x86 (-m ?)

ALLBDF= htbx.100.bdf htbxsl.100.bdf htr.100.bdf	htsl.100.bdf httt.100.bdf \
	htbx.120.bdf htbxsl.120.bdf htr.120.bdf htsl.120.bdf httt.120.bdf \
	htbx.130.bdf htbxsl.130.bdf htr.130.bdf htsl.130.bdf httt.130.bdf \
	htbx.140.bdf htbxsl.140.bdf htr.140.bdf htsl.140.bdf httt.140.bdf \
	htbx.180.bdf htbxsl.180.bdf htr.180.bdf htsl.180.bdf httt.180.bdf \
	htbx.200.bdf htbxsl.200.bdf htr.200.bdf htsl.200.bdf httt.200.bdf \
	htbx.259.bdf htbxsl.259.bdf htr.259.bdf htsl.259.bdf httt.259.bdf \
	htbx.360.bdf htbxsl.360.bdf htr.360.bdf htsl.360.bdf httt.360.bdf \
	htbx.72.bdf htbxsl.72.bdf htr.72.bdf htsl.72.bdf httt.72.bdf \
	htbx.80.bdf htbxsl.80.bdf htr.80.bdf htsl.80.bdf httt.80.bdf

pcf:
	@echo "Building PCF fonts ..."
	@-mkdir -p $(FDIR)
	@for i in $(ALLBDF) ; do \
		( echo -n "$$i " && $(BDF2PCF) $(B2POPTS) $$i -o $(FDIR)/`basename $$i .bdf`.pcf ) \
	done 
	@echo
	@echo "Building font directory..."
	-cp xinst_fonts fonts.alias README* $(FDIR)/
	mkfontdir $(FDIR)
	@echo To install just do: $(FDIR)/xinst_fonts

pcfz:
	@echo "Building PCF fonts ..."
	@-mkdir -p $(FDIR)
	@for i in $(ALLBDF) ; do \
		( echo -n "$$i " && $(BDF2PCF) $(B2POPTS) $$i -o $(FDIR)/`basename $$i .bdf`.pcf ) \
	done 
	@echo
	@echo "Compressing them..."
	@for i in $(FDIR)/*.pcf ; do \
		( compress -c < $$i > $$i.Z && rm -f $$i ) \
	done 
	-cp xinst_fonts fonts.alias README* $(FDIR)/
	mkfontdir $(FDIR)
	@echo To make your X server use them just do: $(FDIR)/xinst_fonts
