aboutsummaryrefslogtreecommitdiff
path: root/contrib/groff/contrib/pdfmark/Makefile.sub
blob: 39376007c997f33762f0306dbfc1942f9274bf22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# 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)

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