#$Header:Makefile 12.0$
#$ACIS:Makefile 12.0$
#$Source: /ibm/acis/usr/src/usr.lib/font/dev3812/typographic/sans/RCS/Makefile,v $
# This makefile is for converting the IBM Sonoran Sans Serif Fonts for use with
# the IBM 3812 Pageprinter.
# The fonts must be loaded from diskette into this directory usind dosread(1).
#
# 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 width - to just make the widths, once the convert has completed.
# make sans - to just make the sans widths.
# make sanslatin - to just make the latin sans widths.
# make clean - to clean directory before restarting the build again.
# make cleanwidth - to just clean the width tables for rebuild.
# make install - to install everything

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

# Width Tables
WDTABLES=  H HI HB HY K KI KB KY

# This will install all the IBM Sonoran Sans Serif fonts after
# they have been loaded from diskette into this directory.
# The IBM3820 fonts for Sonoran Sans Serif are named:
#  c0a055?0.pds - Sans Serif Medium
#  c0a075?0.pds - Sans Serif Bold
#  c0a155?0.pds - Sans Serif Italic Medium
#  c0a175?0.pds - Sans Serif Italic Bold

all: 	dat_and_ndx width

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

# Using .dat, .ndx and code page files, create width and offset files.
# The offset file is an index (by troff char name) into the .dat file.
width:	sans sanslatin

sans:	stdcp
	${WIDTH3812} -c stdcp -n H ss
	${WIDTH3812} -c stdcp -n HI ss.I
	${WIDTH3812} -c stdcp -n HB ss.B
	${WIDTH3812} -c stdcp -n HY ss.BI

sanslatin:	stdcp
	${WIDTH3812} -c stdcp -S -n K ss
	${WIDTH3812} -c stdcp -S -n KI ss.I
	${WIDTH3812} -c stdcp -S -n KB ss.B
	${WIDTH3812} -c stdcp -S -n KY ss.BI

# copy the fontnameTBL and the cope pages from the directory: 
#       .../font/dev3812
fontnameTBL stdcp:
	cp ../../$@ .

${DEPDIRS}:
	mkdir $@

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

clean:	cleanwidth
	rm -f *.ndx *.dat ${WDTABLES}
	rm -f fontnameTBL stdcp 

cleanwidth:
	rm -f *.stdcp
	
