#    Copyright (C) 2000,2001 Anton Kirilov Zinoviev

#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.

#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.

#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#    My e-mail is zinoviev@debian.org


SHELL = /bin/sh

all:	build

unpack:
	-mkdir afm pfb doc
	cd TopTeam && $(MAKE) -i afm
	cd TopTeam && $(MAKE) -i pfb
	cd TopTeam && $(MAKE) -i doc
	cd URW-Val && $(MAKE) -i afm
	cd URW-Val && $(MAKE) -i pfb
	cd URW-Val && $(MAKE) -i doc
	cd OldSlavic && $(MAKE) -i afm
	cd OldSlavic && $(MAKE) -i pfb
	cd OldSlavic && $(MAKE) -i doc

fonts.alias:	fonts-alias.m4
	m4 fonts-alias.m4 >fonts.alias

fonts.scale:	fonts-scale.m4
	m4 fonts-scale.m4 | wc -l | tr -d '[:blank:]' >fonts.scale
	m4 fonts-scale.m4 >>fonts.scale

build:	unpack fonts.alias fonts.scale
	cd fontinst && $(MAKE) -i all
	touch build

clean:
	-rm -f unpack makeafm1 makeafm2 makeafm makeraw1 makeraw2 makeraw3 makepfa makepfb build
	-rm -rf *~
	-cd BlackCat && $(MAKE) -i clean
	-cd TopTeam && $(MAKE) -i clean
	-cd URW-Val && $(MAKE) -i clean
	-cd OldSlavic && $(MAKE) -i clean
	-cd fontinst && $(MAKE) -i clean
	-rm -rf RAW Teams URW afm1 raw1 raw3 afm2 raw2 afm pfa pfb doc
	-rm fonts.alias fonts.scale Fontmap
	-cd BlackCat && $(MAKE) -i clean
	-cd TopTeam && $(MAKE) -i clean
	-cd URW-Val && $(MAKE) -i clean
	-cd OldSlavic && $(MAKE) -i clean
	-cd fontinst && $(MAKE) -i clean

checkroot:
	test root = "`whoami`"

.PHONY:	clean checkroot
