1# Copyright (C) 2004
2#   Free Software Foundation, Inc.
3#      Written by James Clark (jjc@jclark.com)
4#
5# This file is part of groff.
6#
7# groff is free software; you can redistribute it and/or modify it under
8# the terms of the GNU General Public License as published by the Free
9# Software Foundation; either version 2, or (at your option) any later
10# version.
11#
12# groff is distributed in the hope that it will be useful, but WITHOUT ANY
13# WARRANTY; without even the implied warranty of MERCHANTABILITY or
14# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15# for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with groff; see the file COPYING.  If not, write to the Free Software
19# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
20
21builddir=@abs_builddir@
22top_srcdir=@abs_top_srcdir@
23top_builddir=@abs_top_builddir@
24SHELL=@SHELL@
25
26devdir=$(top_builddir)/font
27driverdir=$(top_srcdir)/src/devices/xditview
28mkinstalldirs=$(SHELL) $(top_srcdir)/mkinstalldirs
29
30xtotroff=$(builddir)/xtotroff
31DPIS=75 100
32
33all:
34	@echo "Say \`make fonts' to generate fonts for gxditview."
35
36fonts: $(xtotroff) $(driverdir)/DESC.in $(driverdir)/FontMap
37	fonts=`sed -e 's/[	 ].*//' $(driverdir)/FontMap`; \
38	for dpi in $(DPIS); do \
39	  echo Making devX$$dpi; \
40	  test -d $(devdir)/devX$$dpi || \
41	    $(mkinstalldirs) $(devdir)/devX$$dpi; \
42	  rm -f $(devdir)/devX$$dpi/DESC; \
43	  sed -e "s/res 75/res $$dpi/" $(driverdir)/DESC.in \
44	    >$(devdir)/devX$$dpi/DESC; \
45	  (cd $(devdir)/devX$$dpi; \
46	   rm -f Makefile.sub; \
47	   echo DEV=X$$dpi >Makefile.sub; \
48	   echo DEVFILES=DESC $$fonts >>Makefile.sub; \
49	   $(xtotroff) -r $$dpi -s 10 $(driverdir)/FontMap); \
50	  echo Making devX$$dpi-12; \
51	  test -d $(devdir)/devX$$dpi-12 || \
52	    $(mkinstalldirs) $(devdir)/devX$$dpi-12; \
53	  rm -f $(devdir)/devX$$dpi-12/DESC; \
54	  sed -e "s/res 75/res $$dpi/" \
55	      -e 's/unitwidth 10/unitwidth 12/' $(driverdir)/DESC.in \
56	    >$(devdir)/devX$$dpi-12/DESC; \
57	  (cd $(devdir)/devX$$dpi-12; \
58	   rm -f Makefile.sub; \
59	   echo DEV=X$$dpi-12 >Makefile.sub; \
60	   echo DEVFILES=DESC $$fonts >>Makefile.sub; \
61	   $(xtotroff) -r $$dpi -s 12 $(driverdir)/FontMap); \
62	done
63