1 # Copyright (C) 2005-2014 Free Software Foundation, Inc.
2 # Written by Keith Marshall (keith.d.marshall@ntlworld.com)
4 # This file is part of groff.
6 # groff is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
41 GROFF_BIN_DIR=$(top_builddir)/src/roff/groff
42 GROFF_OTHER_BIN_DIRS=\
43 $(top_builddir)/src/roff/troff \
44 $(top_builddir)/src/devices/grops
45 GROFF_BIN_DIRS=$(GROFF_BIN_DIR) $(GROFF_OTHER_BIN_DIRS)
46 GROFF_BIN_PATH=`echo $(GROFF_BIN_DIRS) | sed -e 's| *|$(SH_SEP)|g'`
48 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
49 MFLAG=-M$(srcdir) -M$(top_builddir)/tmac -M$(top_srcdir)/tmac
50 PFLAG=-dpaper=$(PAGE) -P-p$(PAGE)
54 GROFF_COMMAND_PREFIX= \
55 GROFF_BIN_DIR="$(GROFF_BIN_DIR)" \
56 GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
57 ./pdfroff --keep-temporary-files $(FFLAG) $(MFLAG) $(PFLAG)
63 $(PDFROFF) -mspdf --stylesheet=$(srcdir)/cover.ms $< >$@
65 all: pdfroff $(make_pdfdoc)
67 # The pdf files use the local script to generate.
68 $(PDFDOCFILES): pdfroff
70 pdfdoc: gnu.eps $(PDFDOCFILES)
73 if test -f $(top_srcdir)/doc/gnu.eps; then \
74 cp $(top_srcdir)/doc/gnu.eps . ; \
75 elif test -f $(top_builddir)/doc/gnu.eps; then \
76 cp $(top_builddir)/doc/gnu.eps . ; \
78 xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 \
79 | $(pnmtops_nosetpage) -noturn -rle >$@ ; \
82 pdfroff: pdfroff.sh $(SH_DEPS_SED_SCRIPT)
83 sed -f $(SH_DEPS_SED_SCRIPT) \
84 -e "s|@VERSION@|$(version)$(revision)|" \
85 -e "s|@GROFF_AWK_INTERPRETERS@|$(ALT_AWK_PROGS)|" \
86 -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(ALT_GHOSTSCRIPT_PROGS)|" \
87 -e "s|@GROFF_BIN_DIR@|$(bindir)|" $(srcdir)/pdfroff.sh >$@
90 install_data: install_always $(make_install_pdfdoc)
93 -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
94 for f in $(CMDFILES); do \
95 $(RM) $(DESTDIR)$(bindir)/$$f; \
96 $(INSTALL_SCRIPT) $$f $(DESTDIR)$(bindir)/$$f; \
98 -test -d $(DESTDIR)$(tmacdir) || $(mkinstalldirs) $(DESTDIR)$(tmacdir)
99 for f in $(TMACFILES); do \
100 $(RM) $(DESTDIR)$(tmacdir)/$$f; \
101 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(tmacdir)/$$f; \
104 install_pdfdoc: install_always
105 -test -d $(DESTDIR)$(pdfdocdir) \
106 || $(mkinstalldirs) $(DESTDIR)$(pdfdocdir)
107 for f in $(PDFDOCFILES); do \
108 $(RM) $(DESTDIR)$(pdfdocdir)/$$f; \
109 $(INSTALL_DATA) $$f $(DESTDIR)$(pdfdocdir)/$$f; \
112 uninstall_sub: uninstall_always $(make_uninstall_pdfdoc)
115 -for f in $(CMDFILES); do $(RM) $(DESTDIR)$(bindir)/$$f; done
116 -for f in $(TMACFILES); do $(RM) $(DESTDIR)$(tmacdir)/$$f; done
118 uninstall_pdfdoc: uninstall_always
119 -for f in $(PDFDOCFILES); do $(RM) $(DESTDIR)$(pdfdocdir)/$$f; done
122 ########################################################################