2001-03-30 13:40:51 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2001-04-17 12:37:18 +00:00
|
|
|
BINDIR?= /usr/bin
|
|
|
|
SHELL= /bin/sh
|
1996-09-08 01:21:19 +00:00
|
|
|
|
2001-04-17 12:37:18 +00:00
|
|
|
# Define `page' to be letter if your PostScript printer uses 8.5x11
|
|
|
|
# paper (USA) and define it to be A4, if it uses A4 paper (rest of the
|
|
|
|
# world).
|
|
|
|
PAGE=letter
|
|
|
|
|
|
|
|
# Normally the Postscript driver, grops, produces output that conforms
|
|
|
|
# to version 3.0 of the Adobe Document Structuring Conventions.
|
|
|
|
# Unfortunately some spoolers and previewers can't handle such output.
|
|
|
|
# The BROKEN_SPOOLER_FLAGS variable tells grops what it should do to
|
|
|
|
# make its output acceptable to such programs. This variable controls
|
|
|
|
# only the default behaviour of grops; the behaviour can be changed at
|
|
|
|
# runtime by the grops -b option (and so by groff -P-b).
|
|
|
|
# Use a value of 0 if your spoolers and previewers are able to handle
|
|
|
|
# conforming PostScript correctly.
|
|
|
|
# Add 1 if no %%{Begin,End}DocumentSetup comments should be generated;
|
|
|
|
# this is needed for early versions of TranScript that get confused by
|
|
|
|
# anything between the %%EndProlog line and the first %%Page: comment.
|
|
|
|
# Add 2 if lines in included files beginning with %! should be
|
|
|
|
# stripped out; this is needed for the OpenWindows 2.0 pageview previewer.
|
|
|
|
# Add 4 if %%Page, %%Trailer and %%EndProlog comments should be
|
|
|
|
# stripped out of included files; this is needed for spoolers that
|
|
|
|
# don't understand the %%{Begin,End}Document comments. I suspect this
|
|
|
|
# includes early versions of TranScript.
|
|
|
|
# Add 8 if the first line of the PostScript output should be %!PS-Adobe-2.0
|
|
|
|
# rather than %!PS-Adobe-3.0; this is needed when using Sun's Newsprint
|
|
|
|
# with a printer that requires page reversal.
|
|
|
|
BROKEN_SPOOLER_FLAGS=7
|
|
|
|
|
|
|
|
# DEVICE is the default device.
|
|
|
|
DEVICE=ps
|
|
|
|
|
|
|
|
# PSPRINT is the command to use for printing a PostScript file,
|
|
|
|
# for example `lpr'.
|
|
|
|
PSPRINT=lpr
|
|
|
|
|
|
|
|
# DVIPRINT is the command to use for printing a TeX dvi file,
|
|
|
|
# for example `lpr -d'.
|
|
|
|
DVIPRINT=lpr -d
|
|
|
|
########################################################################
|
|
|
|
# Don't touch...
|
|
|
|
|
|
|
|
g=
|
|
|
|
tmac_s_prefix=
|
|
|
|
tmac_m_prefix=
|
|
|
|
tmac_an_prefix=
|
|
|
|
fontdir=/usr/share/groff_font
|
2002-10-11 08:58:14 +00:00
|
|
|
localfontdir=$(fontdir)
|
|
|
|
legacyfontdir=$(fontdir)
|
2001-04-17 12:37:18 +00:00
|
|
|
tmacdir=/usr/share/tmac
|
|
|
|
systemtmacdir=/usr/share/tmac
|
|
|
|
localtmacdir=/usr/share/tmac
|
2002-10-11 08:58:14 +00:00
|
|
|
docdir=/usr/src/contrib/groff/doc
|
|
|
|
exampledir=XXX
|
|
|
|
htmldocdir=XXX
|
2005-10-20 10:57:53 +00:00
|
|
|
pdfdocdir=XXX
|
2001-04-17 12:37:18 +00:00
|
|
|
indexext=.i
|
|
|
|
common_words_file=/usr/share/dict/eign
|
|
|
|
indexdir=/usr/share/dict/papers
|
|
|
|
indexname=Ind
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# Libraries
|
|
|
|
|
|
|
|
LIBGROFF= ${.OBJDIR}/${TOPREL}/src/libs/libgroff/libgroff.a
|
|
|
|
LIBDRIVER= ${.OBJDIR}/${TOPREL}/src/libs/libdriver/libdriver.a
|
|
|
|
LIBBIB= ${.OBJDIR}/${TOPREL}/src/libs/libbib/libbib.a
|
|
|
|
|
2002-10-11 08:58:14 +00:00
|
|
|
CFLAGS+= -DHAVE_CONFIG_H
|
2001-04-17 12:37:18 +00:00
|
|
|
CFLAGS+= -I${GROFF_DIST}/src/include -I${.CURDIR}/${TOPREL}/src/include
|
|
|
|
CXXFLAGS+= -fno-rtti -fno-exceptions
|
|
|
|
|
|
|
|
.y.o:
|
|
|
|
$(YACC) $(YFLAGS) $(.IMPSRC)
|
2003-05-01 13:22:21 +00:00
|
|
|
mv -f y.tab.c $(.PREFIX).cpp
|
2001-04-17 12:37:18 +00:00
|
|
|
mv -f y.tab.h $(.PREFIX)_tab.h
|
2003-05-01 13:22:21 +00:00
|
|
|
${CXX} ${CXXFLAGS} -c $(.PREFIX).cpp -o ${.TARGET}
|
2001-04-17 12:37:18 +00:00
|
|
|
|
2003-05-01 13:22:21 +00:00
|
|
|
.y.cpp:
|
2001-04-17 12:37:18 +00:00
|
|
|
$(YACC) $(YFLAGS) $(.IMPSRC)
|
2003-05-01 13:22:21 +00:00
|
|
|
mv -f y.tab.c $(.PREFIX).cpp
|
2001-04-17 12:37:18 +00:00
|
|
|
mv -f y.tab.h $(.PREFIX)_tab.h
|
|
|
|
|
|
|
|
.SUFFIXES: .man .1 .2 .3 .4 .5 .6 .7 .8
|
|
|
|
|
|
|
|
version=`cat $(GROFF_DIST)/VERSION`
|
|
|
|
revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(GROFF_DIST)/REVISION`
|
|
|
|
|
|
|
|
.man.8 .man.7 .man.6 .man.5 .man.4 .man.3 .man.2 .man.1:
|
|
|
|
@${ECHO} Making $@ from $<
|
|
|
|
@-rm -f $@
|
|
|
|
@sed -e "s;@BINDIR@;${BINDIR};g" \
|
|
|
|
-e "s;@FONTDIR@;$(fontdir);g" \
|
2002-10-11 08:58:14 +00:00
|
|
|
-e "s;@LOCALFONTDIR@;$(localfontdir);g" \
|
|
|
|
-e "s;@LEGACYFONTDIR@;$(legacyfontdir);g" \
|
2001-04-17 12:37:18 +00:00
|
|
|
-e "s;@MACRODIR@;$(tmacdir);g" \
|
|
|
|
-e "s;@SYSTEMMACRODIR@;$(systemtmacdir);g" \
|
|
|
|
-e "s;@LOCALMACRODIR@;$(localtmacdir);g" \
|
2002-10-11 08:58:14 +00:00
|
|
|
-e "s;@DOCDIR@;$(docdir);g" \
|
|
|
|
-e "s;@EXAMPLEDIR@;$(exampledir);g" \
|
|
|
|
-e "s;@HTMLDOCDIR@;$(htmldocdir);g" \
|
2005-10-20 10:57:53 +00:00
|
|
|
-e "s;@PDFDOCDIR@;$(pdfdocdir);g" \
|
2001-04-17 12:37:18 +00:00
|
|
|
-e "s;@DEVICE@;$(DEVICE);g" \
|
|
|
|
-e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \
|
|
|
|
-e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \
|
|
|
|
-e "s;@INDEX_SUFFIX@;$(indexext);g" \
|
|
|
|
-e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \
|
|
|
|
-e "s;@MAN1EXT@;1;g" \
|
|
|
|
-e "s;@MAN5EXT@;5;g" \
|
|
|
|
-e "s;@MAN7EXT@;7;g" \
|
|
|
|
-e "s;@TMAC_S_PREFIX@;$(tmac_s_prefix);g" \
|
|
|
|
-e "s;@TMAC_M_PREFIX@;$(tmac_m_prefix);g" \
|
|
|
|
-e "s;@TMAC_AN_PREFIX@;$(tmac_an_prefix);g" \
|
|
|
|
-e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \
|
|
|
|
-e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
|
|
|
|
-e "s;@VERSION@;$(version)$(revision);g" \
|
|
|
|
-e "s;@MDATE@;`$(SHELL) ${GROFF_DIST}/mdate.sh $<`;g" \
|
|
|
|
-e "s;@g@;$(g);g" \
|
2003-08-04 21:31:53 +00:00
|
|
|
-e "s;@G@;`echo $(g) | LC_ALL=C tr a-z A-Z`;g" \
|
2001-04-17 12:37:18 +00:00
|
|
|
$< >$@
|
|
|
|
|
|
|
|
.SUFFIXES: .sh .pl
|
|
|
|
|
|
|
|
.sh .pl:
|
|
|
|
@${ECHO} Making ${.TARGET} from ${.IMPSRC}
|
|
|
|
@sed -e "s|@BINDIR@|${BINDIR}|g" \
|
2005-10-20 10:57:53 +00:00
|
|
|
-e 's|@GROFF_BIN_PATH_SETUP@|GROFF_RUNTIME="$${GROFF_BIN_PATH=${BINDIR}}:"|g' \
|
2003-05-01 13:22:21 +00:00
|
|
|
-e "s;@FONTDIR@;$(fontdir);g" \
|
|
|
|
-e "s|@SEP@|:|g" \
|
2001-04-17 12:37:18 +00:00
|
|
|
-e "s|@VERSION@|$(version)$(revision)|" \
|
|
|
|
-e "s|@g@|$(g)|g" \
|
|
|
|
${.IMPSRC} >${.TARGET}
|
|
|
|
|
|
|
|
TOPREL?= ..
|
|
|
|
GROFF_DIST= ${.CURDIR}/${TOPREL}/../../../contrib/groff
|
|
|
|
DIST_SUBDIR?= ${.CURDIR:T}
|
|
|
|
DIST_DIR= ${GROFF_DIST}/${DIST_SUBDIR}
|
1996-09-09 18:05:29 +00:00
|
|
|
.PATH: ${DIST_DIR}
|