e2b2e1e6775005ce6ca3625dd82352b92750e1d5
[platform/upstream/groff.git] / font / devhtml / Makefile.sub
1 # Makefile.sub for `font devhtml'
2 #
3 # File position: <groff-source>/font/devhtml/Makefile.sub
4 #
5 # Copyright (C) 2014
6 #   Free Software Foundation, Inc.
7 #
8 # Last update: 2 Sep 2014
9 #
10 # This file is part of `font utf8' which is part of `groff'.
11 #
12 # `groff' is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # `groff' is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 # General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program. If not, see
24 # <http://www.gnu.org/licenses/gpl-2.0.html>.
25 #
26 ########################################################################
27
28 DEV=html
29 PROTOFONTS=R I B BI CR CI CB CBI
30 FONTS=$(PROTOFONTS) S
31 DEVFILES=$(FONTS) DESC
32 MOSTLYCLEANADD=$(FONTS) DESC
33
34 RES=240
35 CPI=10
36 LPI=6
37
38 RM=rm -f
39
40 $(FONTS): R.proto
41         @echo Making $@
42         @$(RM) $@
43         @charwidth=`expr $(RES) / $(CPI)` ; \
44          sed -e "s/^name [A-Z]*$$/name $@/" \
45              -e \
46               "s/^\\([^ ]*\\)   [0-9][0-9]*     /\\1    $$charwidth     /" \
47              -e "s/^spacewidth [0-9][0-9]*$$/spacewidth $$charwidth/" \
48              -e "s/^internalname .*$$/internalname $@/" \
49              -e "/^internalname/s/CR/4/" \
50              -e "/^internalname/s/BI/3/" \
51              -e "/^internalname/s/B/2/" \
52              -e "/^internalname/s/I/1/" \
53              -e "/^internalname .*[^ 0-9]/d" \
54              $(srcdir)/R.proto >$@
55
56 DESC: DESC.proto
57         @echo Making $@
58         @sed -e "s/^res .*$$/res $(RES)/" \
59              -e "s/^hor .*$$/hor `expr $(RES) / $(CPI)`/" \
60              -e "s/^vert .*$$/vert `expr $(RES) / $(LPI)`/" \
61              -e "s/^fonts .*$$/fonts `set $(FONTS); echo $$#` $(FONTS)/" \
62              $(srcdir)/DESC.proto >$@
63         @echo "image_generator $(GHOSTSCRIPT)" >> $@
64
65 ########################################################################
66 # Emacs settings
67 ########################################################################
68 #
69 # Local Variables:
70 # mode: makefile
71 # End: