#=======================================================================
# Makefile for files in $HOME/public_html/fonts
#
# Current target list:
#	all			make fonts-to-vendors.html
#	clean			remove most things that make can rebuild
#	clobber			same as distclean
#	distclean		remove everything that make can rebuild
#	dw			doubled-word check
#	fonts-to-vendors.html	master index of all fonts
#	mostlyclean		remove most things that make can rebuild
#	spell			spelling check
#
# [22-Feb-1999] -- update fonts-to-vendors.html dependency list
# [09-Jul-1998] -- update "all" target
# [24-Oct-1995]
#=======================================================================

AWK		= gawk
DEHTML		= ../dehtml
DW		= dw
GREP		= grep
HTMLCHECK	= html-ncheck
ISPELL		= ispell
RM		= /bin/rm -f
SED		= sed
SHELL		= /bin/sh
SORT		= sort
SPELL		= spell
SPELLDICT	= ../spell.dict

all:	fonts-to-vendors.html

clean mostlyclean:
	-$(RM) *.i
	-$(RM) *.o
	-$(RM) *~
	-$(RM) \#*
	-$(RM) a.out
	-$(RM) core

clobber distclean:	clean

dw:
	@for f in *.html ; \
	do \
		echo Doubled word check in $$f ... ; \
		$(DEHTML) < $$f | $(DW) ; \
	done

fonts-to-vendors.html:	fonts-to-vendors.awk *-fontnames.html *-fonts-by-name.html
	$(AWK) -f fonts-to-vendors.awk *-fontnames.html *-fonts-by-name.html
	$(HTMLCHECK) fonts-to-vendors*.html

fonts-to-vendors.txt:	fonts-to-vendors.html Makefile
	$(GREP) -h '<TR><TH ALIGN="left">' fonts-to-vendors*.html | \
		$(SED)  -e 's#[ 	]*<TR><TH[ 	]*ALIGN="left">##' \
			-e 's#<A[ 	]*NAME="[^"]*">##' \
			-e 's#</A>##' \
			-e 's#</TH><TD[ 	]*ALIGN="left">#@#' \
			-e 's#</TD></TR>##' >$@
spell:
	@for f in *.html ; \
	do \
		echo Spelling check in $$f ... ; \
		$(DEHTML) < $$f | $(SPELL) +$(SPELLDICT) | $(SORT) -u; \
		$(DEHTML) < $$f | $(ISPELL) -l -p $(SPELLDICT) 2>/dev/null | $(SORT) -u; \
	done
