# Copyright (C) 2005, Free Software Foundation, Inc.
# Written by Keith Marshall (keith.d.marshall@ntlworld.com)
#
# This file is part of groff.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with groff; see the file COPYING. If not, write to the Free Software
# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
MAN1=\
pdfroff.n
CMDFILES=\
pdfroff
TMACFILES=\
pdfmark.tmac \
spdf.tmac
PDFDOCFILES=\
pdfmark.pdf
CLEANADD=\
gnu.eps \
$(PDFDOCFILES) \
$(CMDFILES)
# Some `makes' don't predefine RM...
RM=rm -f
GROFF_BIN_DIR=$(top_builddir)/src/roff/groff
GROFF_OTHER_BIN_DIRS=\
$(top_builddir)/src/roff/troff \
$(top_builddir)/src/devices/grops
GROFF_BIN_DIRS=$(GROFF_BIN_DIR) $(GROFF_OTHER_BIN_DIRS)
GROFF_BIN_PATH=`echo $(GROFF_BIN_DIRS) | sed -e 's| *|$(SH_SEP)|g'`
FFLAG=-F$(top_builddir)/font -F$(top_srcdir)/font
MFLAG=-M$(srcdir) -M$(top_builddir)/tmac -M$(top_srcdir)/tmac
PFLAG=-dpaper=$(PAGE) -P-p$(PAGE)
PDFROFF=\
export GROFF_COMMAND_PREFIX; GROFF_COMMAND_PREFIX=''; \
export GROFF_BIN_DIR; GROFF_BIN_DIR=$(GROFF_BIN_DIR); \
export GROFF_BIN_PATH; GROFF_BIN_PATH=$(GROFF_BIN_PATH); \
./pdfroff $(FFLAG) $(MFLAG) $(PFLAG)
.SUFFIXES: .ms .pdf
.ms.pdf:
$(RM) $@
$(PDFROFF) -mspdf --stylesheet=$(srcdir)/cover.ms $< >$@
all: pdfroff $(make_pdfdoc)
$(PDFDOCFILES): pdfroff
pdfdoc: gnu.eps $(PDFDOCFILES)
gnu.eps:
if test -f $(top_srcdir)/doc/gnu.eps; then \
cp $(top_srcdir)/doc/gnu.eps . ; \
elif test -f $(top_builddir)/doc/gnu.eps; then \
cp $(top_builddir)/doc/gnu.eps . ; \
else \
xpmtoppm $(top_srcdir)/doc/gnu.xpm | pnmdepth 15 | \
$(pnmtops_nosetpage) -noturn -rle >$@ ; \
fi
pdfroff: pdfroff.sh $(SH_DEPS_SED_SCRIPT)
$(RM) $@
sed -f $(SH_DEPS_SED_SCRIPT) \
-e "s|@VERSION@|$(version)$(revision)|" \
-e "s|@GROFF_AWK_INTERPRETERS@|$(ALT_AWK_PROGS)|" \
-e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(ALT_GHOSTSCRIPT_PROGS)|" \
-e "s|@GROFF_BIN_DIR@|$(bindir)|" $(srcdir)/pdfroff.sh >$@
chmod +x $@
install_data: $(make_install_pdfdoc)
-test -d $(bindir) || $(mkinstalldirs) $(bindir)
for f in $(CMDFILES); do \
$(RM) $(bindir)/$$f; \
$(INSTALL_SCRIPT) $$f $(bindir)/$$f; \
done
-test -d $(tmacdir) || $(mkinstalldirs) $(tmacdir)
for f in $(TMACFILES); do \
$(RM) $(tmacdir)/$$f; \
$(INSTALL_DATA) $(srcdir)/$$f $(tmacdir)/$$f; \
done
install_pdfdoc:
-test -d $(pdfdocdir) || $(mkinstalldirs) $(pdfdocdir)
for f in $(PDFDOCFILES); do \
$(RM) $(pdfdocdir)/$$f; \
$(INSTALL_DATA) $$f $(pdfdocdir)/$$f; \
done
uninstall_sub:
for f in $(CMDFILES); do \
$(RM) $(bindir)/$$f; \
done
for f in $(TMACFILES); do \
$(RM) $(tmacdir)/$$f; \
done
for f in $(PDFDOCFILES); do \
$(RM) $(pdfdocdir)/$$f; \
done