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