Provide `pdfroff' shell script, and manpage to document it;
[s-roff.git] / contrib / pdfmark / Makefile.sub
blob62f9cfe8b368c6740c0cc1391d6faf57b99b07a9
1 # Copyright (C) 2005, Free Software Foundation, Inc.
2 #      Written by Keith Marshall (keith.d.marshall@ntlworld.com)
3
4 # This file is part of groff.
5
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 2, or (at your option) any later
9 # version.
10
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
14 # for more details.
15
16 # You should have received a copy of the GNU General Public License along
17 # with groff; see the file COPYING.  If not, write to the Free Software
18 # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 MAN1=\
21   pdfroff.n
23 CMDFILES=\
24   pdfroff
26 TMACFILES=\
27   pdfmark.tmac \
28   spdf.tmac
30 PDFDOCFILES=\
31   pdfmark.pdf
33 CLEANADD=\
34   gnu.eps \
35   $(PDFDOCFILES) \
36   $(CMDFILES)
38 GROFF_BIN_DIR=$(top_builddir)/src/roff/groff
39 GROFF_OTHER_BIN_DIRS=\
40   $(top_builddir)/src/roff/troff \
41   $(top_builddir)/src/devices/grops
42 GROFF_BIN_DIRS=$(GROFF_BIN_DIR) $(GROFF_OTHER_BIN_DIRS)
43 GROFF_BIN_PATH=`echo $(GROFF_BIN_DIRS) | sed -e 's|  *|$(SH_SEP)|g'`
45 FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
46 MFLAG=-M$(srcdir) -M$(top_builddir)/tmac -M$(top_srcdir)/tmac
47 PFLAG=-dpaper=$(PAGE) -P-p$(PAGE)
49 PDFROFF=\
50   export GROFF_COMMAND_PREFIX; GROFF_COMMAND_PREFIX=''; \
51   export GROFF_BIN_DIR; GROFF_BIN_DIR=$(GROFF_BIN_DIR); \
52   export GROFF_BIN_PATH; GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
53   ./pdfroff $(FFLAG) $(MFLAG) $(PFLAG)
55 .SUFFIXES: .ms .pdf
56 .ms.pdf:
57         $(RM) $@
58         $(PDFROFF) -mspdf --style=$(srcdir)/cover.ms $< >$@
60 all: pdfroff $(make_pdfdoc)
62 pdfdoc: gnu.eps $(PDFDOCFILES)
64 gnu.eps:
65         if test -f $(top_srcdir)/doc/gnu.eps; then \
66           cp $(top_srcdir)/doc/gnu.eps . ; \
67         elif test -f $(top_builddir)/doc/gnu.eps; then \
68           cp $(top_builddir)/doc/gnu.eps . ; \
69         else \
70           xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 | \
71             $(pnmtops_nosetpage) -noturn -rle >$@ ; \
72         fi
74 pdfroff: pdfroff.sh
75         $(RM) $@
76         sed -e "s|@VERSION@|$(version)$(revision)|" \
77             -e "s|@GROFF_AWK_INTERPRETERS@|$(ALT_AWK_PROGS)|" \
78             -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(ALT_GHOSTSCRIPT_PROGS)|" \
79             -e "s|@GROFF_BIN_DIR@|$(bindir)|" $^ >$@
80         chmod +x $@
82 install_data: $(make_install_pdfdoc)
83         -test -d $(bindir) || $(mkinstalldirs) $(bindir)
84         for f in $(CMDFILES); do \
85           $(RM) $(bindir)/$$f; \
86           $(INSTALL_DATA) $$f $(bindir)/$$f; \
87         done
88         -test -d $(tmacdir) || $(mkinstalldirs) $(tmacdir)
89         for f in $(TMACFILES); do \
90           $(RM) $(tmacdir)/$$f; \
91           $(INSTALL_DATA) $(srcdir)/$$f $(tmacdir)/$$f; \
92         done
94 install_pdfdoc:
95         -test -d $(pdfdocdir) || $(mkinstalldirs) $(pdfdocdir)
96         for f in $(PDFDOCFILES); do \
97           $(RM) $(pdfdocdir)/$$f; \
98           $(INSTALL_DATA) $$f $(pdfdocdir)/$$f; \
99         done
101 uninstall_sub:
102         for f in $(CMDFILES); do \
103           $(RM) $(bindir)/$$f; \
104         done
105         for f in $(TMACFILES); do \
106           $(RM) $(tmacdir)/$$f; \
107         done
108         for f in $(PDFDOCFILES); do \
109           $(RM) $(pdfdocdir)/$$f; \
110         done