#$Header:Makefile 12.0$
#$ACIS:Makefile 12.0$
#$Source: /ibm/acis/usr/src/usr.lib/font/dev3812/typographic/serif/RCS/Makefile,v $
# This makefile is for converting the IBM Sonoran Serif Fonts for use with
# the IBM 3812 Pageprinter.
# The fonts must be loaded from diskette into this directory using 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 clean - to clean directory before restarting the build again.
# make width - to just make the widths, once the convert has completed.
# make serif - to just make the san serif widths.
# make seriflatin - to just make the san serif latin widths.
# 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=  R I B BI L LI LB LY

# This will install all the IBM Sonoran Serif fonts after
# they have been loaded from diskette into this directory.
# The IBM3820 fonts for Sonoran Serif are named:
#  c0t055?0.pds - Serif Medium
#  c0t075?0.pds - Serif Bold
#  c0t155?0.pds - Serif Italic Medium
#  c0t175?0.pds - 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 c0t*.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:	serif seriflatin

serif:	stdcp
	${WIDTH3812} -c stdcp -n R s
	${WIDTH3812} -c stdcp -n I s.I
	${WIDTH3812} -c stdcp -n B s.B
	${WIDTH3812} -c stdcp -n BI s.BI

seriflatin:	stdcp
	${WIDTH3812} -c stdcp -S -n L s
	${WIDTH3812} -c stdcp -S -n LI s.I
	${WIDTH3812} -c stdcp -S -n LB s.B
	${WIDTH3812} -c stdcp -S -n LY s.BI

# copy the fontnameTBL  and the stdcp code page tables from
# the directory  ../font/dev3812/fonts
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
	

