e367a344acda3c9deae4196f9277ab0dda015a58
[platform/upstream/groff.git] / font / devpdf / Makefile.sub
1 # Makefile.sub for `font devpdf'
2 #
3 # File position: <groff-source>/font/devpdf/Makefile.sub
4 #
5 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
6 #      Written by Deri James <deri@chuzzlewit.demon.co.uk>
7 #
8 # This file is part of groff.
9 #
10 # groff is free software; you can redistribute it and/or modify it under
11 # the terms of the GNU General Public License as published by the Free
12 # Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
14 #
15 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 # for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22
23 DEV=pdf
24 GROFF_FONT_FILES=`cd $(top_builddir)/font/devpdf \
25                   && find * -maxdepth 0 -type f ! -name 'Makefile.sub*' \
26                             -exec grep -l internalname {} \;`
27 ENC_FILES=`cd $(top_builddir)/font/devpdf; ls enc/*`
28 MAP_FILES=`cd $(top_builddir)/font/devpdf; ls map/*`
29
30 MOSTLYCLEANADD=\
31   download \
32   DESC \
33   Foundry \
34   util/BuildFoundries \
35   $(GROFF_FONT_FILES) \
36   $(ENC_FILES) \
37   $(MAP_FILES)
38
39 MOSTLYCLEANDIRADD=enc map
40
41 DEVFILES=\
42   Foundry
43
44 #DEVSCRIPTS=util/BuildFoundries
45
46 DISTFILES=\
47   $(DEVFILES) \
48   $(DEVSCRIPTS)
49
50 RM=rm -f
51
52 all: DESC
53
54 DESC: DESC.in
55         $(RM) DESC
56         cat $(srcdir)/DESC.in >$(top_builddir)/font/devpdf/DESC
57         if test "$(PAGE)" = A4; then \
58           echo "papersize a4" >>$(top_builddir)/font/devpdf/DESC; \
59         else \
60           echo "papersize letter" >>$(top_builddir)/font/devpdf/DESC; \
61         fi
62         $(RM) Foundry
63         cat $(srcdir)/Foundry.in >$(top_builddir)/font/devpdf/Foundry
64         -test -d $(top_builddir)/font/devpdf/enc \
65           || $(mkinstalldirs) $(top_builddir)/font/devpdf/enc
66         -test -d $(top_builddir)/font/devpdf/map \
67           || $(mkinstalldirs) $(top_builddir)/font/devpdf/map
68         cp -f $(top_srcdir)/font/devps/text.enc \
69           $(top_builddir)/font/devpdf/enc
70         cp -f $(top_srcdir)/font/devps/symbolmap \
71           $(top_builddir)/font/devpdf/map
72         cp -f $(top_srcdir)/font/devps/generate/dingbats.map \
73           $(top_builddir)/font/devpdf/map
74         cp -f $(top_srcdir)/font/devps/generate/textmap \
75           $(top_builddir)/font/devpdf/map
76         cp -f $(top_srcdir)/font/devps/generate/symbolchars \
77           $(top_builddir)/font/devpdf/map
78         -test -d util || $(mkinstalldirs) util
79         $(RM) util/BuildFoundries
80         if test -n "$(PERL)"; then \
81           sed -f $(SH_DEPS_SED_SCRIPT) \
82               -e "s|/usr/bin/perl|$(PERL)|" \
83               -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(GHOSTSCRIPT)|" \
84               -e "s|@VERSION@|$(version)$(revision)|" \
85               -e "s|@GROFF_FONT_DIR@|$(fontdir)|" \
86               $(srcdir)/util/BuildFoundries.pl \
87           >$(top_builddir)/font/devpdf/util/BuildFoundries ;\
88         else \
89           sed -f $(SH_DEPS_SED_SCRIPT) \
90               -e "s|@VERSION@|$(version)$(revision)|" \
91               -e "s|@GROFF_FONT_DIR@|$(fontdir)|" \
92               $(srcdir)/util/BuildFoundries.pl \
93           >$(top_builddir)/font/devpdf/util/BuildFoundries ;\
94         fi
95         chmod +x util/BuildFoundries
96         echo "# foundry ps name psfile" > $(top_builddir)/font/devpdf/download
97         PATH="$(top_builddir)/src/utils/afmtodit:$(GROFF_PATH_SEPARATOR)$(PATH)" \
98           util/BuildFoundries $(top_builddir)/font/devpdf \
99             '$(top_srcdir)/font/devps : $(top_builddir)/font/devps' \
100            >> $(top_builddir)/font/devpdf/download
101
102 install_data:
103         -test -d $(DESTDIR)$(fontsubdir) \
104           || $(mkinstalldirs) $(DESTDIR)$(fontsubdir)
105         -test -d $(DESTDIR)$(fontsubdir)/enc \
106           || $(mkinstalldirs) $(DESTDIR)$(fontsubdir)/enc
107         -test -d $(DESTDIR)$(fontsubdir)/map \
108           || $(mkinstalldirs) $(DESTDIR)$(fontsubdir)/map
109         -test -d $(DESTDIR)$(fontsubdir)/util \
110           || $(mkinstalldirs) $(DESTDIR)$(fontsubdir)/util
111         for f in $(MOSTLYCLEANADD); do \
112           $(RM) $(DESTDIR)$(fontsubdir)/$$f; \
113           if test -f $$f; then \
114             $(INSTALL_DATA) $$f $(DESTDIR)$(fontsubdir)/$$f; \
115           else \
116             $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(fontsubdir)/$$f; \
117           fi; \
118         done
119
120 uninstall_sub:
121         -for f in $(MOSTLYCLEANADD); do \
122           $(RM) $(DESTDIR)$(fontsubdir)/$$f; \
123         done
124         -d=$(DESTDIR)$(fontsubdir)/enc; \
125           if test -d $$d; then rmdir $$d; fi
126         -d=$(DESTDIR)$(fontsubdir)/map; \
127           if test -d $$d; then rmdir $$d; fi
128         -d=$(DESTDIR)$(fontsubdir)/util; \
129           if test -d $$d; then rmdir $$d; fi
130         -d=$(DESTDIR)$(fontsubdir); \
131           if test -d $$d; then rmdir $$d; fi
132
133 ########################################################################
134 # Emacs settings
135 ########################################################################
136 #
137 # Local Variables:
138 # mode: makefile
139 # End: