Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / gnu / usr.bin / groff / Makefile.inc
1 # $FreeBSD: src/gnu/usr.bin/groff/Makefile.inc,v 2.3.6.2 2003/02/14 15:22:12 ru Exp $
2 # $DragonFly: src/gnu/usr.bin/groff/Makefile.inc,v 1.2 2003/06/17 04:25:45 dillon Exp $
3
4 BINDIR?=        /usr/bin
5 SHELL=          /bin/sh
6
7 # Define `page' to be letter if your PostScript printer uses 8.5x11
8 # paper (USA) and define it to be A4, if it uses A4 paper (rest of the
9 # world).
10 PAGE=letter
11
12 # Normally the Postscript driver, grops, produces output that conforms
13 # to version 3.0 of the Adobe Document Structuring Conventions.
14 # Unfortunately some spoolers and previewers can't handle such output.
15 # The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to
16 # make its output acceptable to such programs.  This variable controls
17 # only the default behaviour of grops; the behaviour can be changed at
18 # runtime by the grops -b option (and so by groff -P-b).
19 # Use a value of 0 if your spoolers and previewers are able to handle
20 # conforming PostScript correctly.
21 # Add 1 if no %%{Begin,End}DocumentSetup comments should be generated;
22 # this is needed for early versions of TranScript that get confused by
23 # anything between the %%EndProlog line and the first %%Page: comment.
24 # Add 2 if lines in included files beginning with %! should be
25 # stripped out; this is needed for the OpenWindows 2.0 pageview previewer.
26 # Add 4 if %%Page, %%Trailer and %%EndProlog comments should be
27 # stripped out of included files; this is needed for spoolers that
28 # don't understand the %%{Begin,End}Document comments. I suspect this
29 # includes early versions of TranScript.
30 # Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0
31 # rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint
32 # with a printer that requires page reversal.
33 BROKEN_SPOOLER_FLAGS=7
34
35 # DEVICE is the default device.
36 DEVICE=ps
37
38 # PSPRINT is the command to use for printing a PostScript file,
39 # for example `lpr'.
40 PSPRINT=lpr
41
42 # DVIPRINT is the command to use for printing a TeX dvi file,
43 # for example `lpr -d'.
44 DVIPRINT=lpr -d
45 ########################################################################
46 # Don't touch...
47
48 g=
49 tmac_s_prefix=
50 tmac_m_prefix=
51 tmac_an_prefix=
52 fontdir=/usr/share/groff_font
53 localfontdir=$(fontdir)
54 legacyfontdir=$(fontdir)
55 tmacdir=/usr/share/tmac
56 systemtmacdir=/usr/share/tmac
57 localtmacdir=/usr/share/tmac
58 docdir=/usr/src/contrib/groff/doc
59 exampledir=XXX
60 htmldocdir=XXX
61 indexext=.i
62 common_words_file=/usr/share/dict/eign
63 indexdir=/usr/share/dict/papers
64 indexname=Ind
65
66 ########################################################################
67 # Libraries
68
69 # Bad assumption, if one exists they all exist
70 .if exists(${.OBJDIR}/${TOPREL}/src/libs/libgroff)
71 LIBGROFF=       ${.OBJDIR}/${TOPREL}/src/libs/libgroff/libgroff.a
72 LIBDRIVER=      ${.OBJDIR}/${TOPREL}/src/libs/libdriver/libdriver.a
73 LIBBIB=         ${.OBJDIR}/${TOPREL}/src/libs/libbib/libbib.a
74 .else
75 LIBGROFF=       ${.CURDIR}/${TOPREL}/src/libs/libgroff/libgroff.a
76 LIBDRIVER=      ${.CURDIR}/${TOPREL}/src/libs/libdriver/libdriver.a
77 LIBBIB=         ${.CURDIR}/${TOPREL}/src/libs/libbib/libbib.a
78 .endif
79
80 CFLAGS+=        -DHAVE_CONFIG_H
81 CFLAGS+=        -I${GROFF_DIST}/src/include -I${.CURDIR}/${TOPREL}/src/include
82 CXXFLAGS+=      -fno-rtti -fno-exceptions
83
84 .y.o:
85         $(YACC) $(YFLAGS) $(.IMPSRC)
86         mv -f y.tab.c $(.PREFIX).cc
87         mv -f y.tab.h $(.PREFIX)_tab.h
88         ${CXX} ${CXXFLAGS} -c $(.PREFIX).cc -o ${.TARGET}
89
90 .y.cc:
91         $(YACC) $(YFLAGS) $(.IMPSRC)
92         mv -f y.tab.c $(.PREFIX).cc
93         mv -f y.tab.h $(.PREFIX)_tab.h
94
95 .SUFFIXES: .man .1 .2 .3 .4 .5 .6 .7 .8
96
97 version=`cat $(GROFF_DIST)/VERSION`
98 revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(GROFF_DIST)/REVISION`
99
100 .man.8 .man.7 .man.6 .man.5 .man.4 .man.3 .man.2 .man.1:
101         @${ECHO} Making $@ from $<
102         @-rm -f $@
103         @sed -e "s;@BINDIR@;${BINDIR};g" \
104         -e "s;@FONTDIR@;$(fontdir);g" \
105         -e "s;@LOCALFONTDIR@;$(localfontdir);g" \
106         -e "s;@LEGACYFONTDIR@;$(legacyfontdir);g" \
107         -e "s;@MACRODIR@;$(tmacdir);g" \
108         -e "s;@SYSTEMMACRODIR@;$(systemtmacdir);g" \
109         -e "s;@LOCALMACRODIR@;$(localtmacdir);g" \
110         -e "s;@DOCDIR@;$(docdir);g" \
111         -e "s;@EXAMPLEDIR@;$(exampledir);g" \
112         -e "s;@HTMLDOCDIR@;$(htmldocdir);g" \
113         -e "s;@DEVICE@;$(DEVICE);g" \
114         -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \
115         -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \
116         -e "s;@INDEX_SUFFIX@;$(indexext);g" \
117         -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \
118         -e "s;@MAN1EXT@;1;g" \
119         -e "s;@MAN5EXT@;5;g" \
120         -e "s;@MAN7EXT@;7;g" \
121         -e "s;@TMAC_S_PREFIX@;$(tmac_s_prefix);g" \
122         -e "s;@TMAC_M_PREFIX@;$(tmac_m_prefix);g" \
123         -e "s;@TMAC_AN_PREFIX@;$(tmac_an_prefix);g" \
124         -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \
125         -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
126         -e "s;@VERSION@;$(version)$(revision);g" \
127         -e "s;@MDATE@;`$(SHELL) ${GROFF_DIST}/mdate.sh $<`;g" \
128         -e "s;@g@;$(g);g" \
129         -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \
130         $< >$@
131
132 .SUFFIXES: .sh .pl
133
134 .sh .pl:
135         @${ECHO} Making ${.TARGET} from ${.IMPSRC}
136         @sed -e "s|@BINDIR@|${BINDIR}|g" \
137              -e "s|@VERSION@|$(version)$(revision)|" \
138              -e "s|@g@|$(g)|g" \
139              ${.IMPSRC} >${.TARGET}
140
141 TOPREL?=        ..
142 GROFF_DIST=     ${.CURDIR}/${TOPREL}/../../../contrib/groff
143 DIST_SUBDIR?=   ${.CURDIR:T}
144 DIST_DIR=       ${GROFF_DIST}/${DIST_SUBDIR}
145 .PATH: ${DIST_DIR}