#$Header:Makefile 12.0$
#$ACIS:Makefile 12.0$
#$Source: /ibm/acis/usr/src/usr.lib/font/dev3812/typographic/Afont/RCS/Makefile,v $
# This makefile is for converting the additonal fonts needed to complete the
# ditroff characters.
# These fonts are for use with the IBM 3812 Pageprinter.
#
# The makefile will convert the fonts and then generate the width tables.
# Once the fonts have been converted, this makefile can be used just to 
# re-make the width tables.
# The makefile can be called in one of the following ways:
#
# make - to convert and build the widths.
# make clean - to clean directory before restarting the build again.
# make width - to just make the widths, once the convert has completed.
# make afont - to just re-make the widths for the additional characters.
# make cleanAfont - to just clean the widths for the additional characters.

DESTDIR=
LIBDIR=		${DESTDIR}/usr/lib/font
DEVDIR=		${LIBDIR}/dev3812
FONTDIR=	${DEVDIR}/fonts
DEPDIRS=	${LIBDIR} ${DEVDIR} ${FONTDIR}

CVT3812=	/usr/ibm/cvt20to12
WIDTH3812=	/usr/ibm/width3812
INSTALL=	/usr/bin/install -c

# Widths tables
WDTABLES=  	A

# This will install all the A font which contains characters that were 
# missing from the IBM Sonoran fonts. They are designed to work with the
# Sonoran Serif Pi font.
# The 3820 format of these fonts are in :          
#	acis0060.pds size 6
#	acis0080.pds size 8
#	acis0000.pds size 10
#	acis00b0.pds size 12
#

all:	dat_and_ndx width 

# Using ibm3820 font files, create .dat and .ndx files.
# .dat contains font bit patterns and .ndx contains index by ibm char names.
dat_and_ndx: fontnameTBL
	for i in *.pds; do ${CVT3812} $$i; done

# Using .dat, .ndx and code page files, create width and offset files.
# This offset file is an index into .dat by troff char names.
width: afont

#This will build the additional font that contains missing characters.
afont:  addcp 
	${WIDTH3812} -c addcp -S -s 6 8 10 12 0 -n A add

# copy fontnameTBL and addcp from  ../font/dev3812/fonts
fontnameTBL addcp:
	cp ../../$@ .

${DEPDIRS}:
	mkdir $@

# Move all width info for ditroff and the codepages 
install:	${DEPDIRS}
	for i in ${WDTABLES}; do ${INSTALL} $$i ${DEVDIR}/$$i; done
	for i in *.dat *.addcp; do ${INSTALL} $$i ${FONTDIR}/$$i; done 

clean: cleanAfont
	rm -f *.dat *.ndx
	rm -f addcp fontnameTBL

cleanAfont:
	rm -f *.addcp
	rm -f ${WDTABLES}
	
