/*****************************************************************************
 *                                                                           *
 * Document formatting rules (troff-based)                                   *
 *                                                                           *
 *****************************************************************************/

/*
 * TroffToRTF() is the base rule; the others call it with
 * appropriate arguments for the various macro packages.
 *
 * Arguments:
 *	dst		output file (this is also the main target)
 *	src		source file(s)
 *	formatter	formatting program and its options
 *	filters		preprocessors
 *	deps		dependencies
 *
 * There is always some processs in
 * front of troff (either soelim or cat) so that filters can be
 * inserted in between as appropriate.  filters can be empty, or
 * something like "|$(TROFFCVTTBL)" (without quotes).  (If non-empty,
 * filters MUST begin with a "|".)
 *
 * TroffMsToRTF()  - Format a document that uses the -ms macros
 * TroffMeToRTF()  - Format a document that uses the -me macros
 * TroffMmToRTF()  - Format a document that uses the -mm macros
 * TroffManToRTF() - Format a document that uses the -man macros
 *
 * TROFFOPTS is for command line use.  You can set it, e.g., to format
 * only certain pages.
 */

#ifndef TroffToRTF
#define TroffToRTF(dst,src,formatter,filters,deps)			@@\
dst:: src deps								@@\
	$(SOELIM) src filters | formatter > dst				@@\
StuffToClean(dst)
#endif /* TroffToRTF */

#ifndef TroffMsToRTF
#define TroffMsToRTF(dst,src,filters,deps)				@@\
TroffToRTF(dst,src,$(TROFF2RTF) $(MSMACROS) $(TROFFOPTS),filters,deps)
#endif /* TroffMsToRTF */

#ifndef TroffMeToRTF
#define TroffMeToRTF(dst,src,filters,deps)				@@\
TroffToRTF(dst,src,$(TROFF2RTF) $(MEMACROS) $(TROFFOPTS),filters,deps)
#endif /* TroffMeToRTF */

#ifndef TroffMmToRTF
#define TroffMmToRTF(dst,src,filters,deps)				@@\
TroffToRTF(dst,src,$(TROFF2RTF) $(MMMACROS) $(TROFFOPTS),filters,deps)
#endif /* TroffMmToRTF */

#ifndef TroffManToRTF
#define TroffManToRTF(dst,src,filters,deps)				@@\
TroffToRTF(dst,src,$(TROFF2RTF) $(MANMACROS) $(TROFFOPTS),filters,deps)
#endif /* TroffManToRTF */
