.SUFFIXES:  .4 .5 .8 .ps .txt

#######################################
### The following work with Solaris 2.5, 2.6, and 7.0
#######################################
# TROFF=troff
# TROFFOPTS=-man -Tpost
# POST=/usr/lib/lp/postscript/dpost
# NROFF=nroff
# NROFFOPTS=-man
# TBL=tbl
# COL=col
### To emulate man, leave COLOPTS empty.
COLOPTS=
### If you plan to print a hardcopy of nroff output, use this instead.
# COLOPTS=-bx

#######################################
### The following work with AIX 4.3
#######################################
TROFF=troff
TROFFOPTS=-man -Tpsc
POST=psc
NROFF=nroff
NROFFOPTS=-man
TBL=tbl
COL=col
### To emulate man, leave COLOPTS empty.
COLOPTS=
### If you plan to print a hardcopy of nroff output, use this instead.
# COLOPTS=-bx

#######################################
### The following works with RedHat Linux 5.2
### Also works with Irix 6.5 if groff is installed.
### The following *may* work with Tru64 Unix
#######################################
# TROFF=troff
# TROFFOPTS=-man -Tps
# POST=grops
# NROFF=nroff
# NROFFOPTS=-man
# TBL=tbl
# COL=col
### To emulate man, leave COLOPTS empty.
# COLOPTS=
### If you plan to print a hardcopy of nroff output, use this instead.
# COLOPTS=-bx

.4.ps:
	$(TBL) $< | $(TROFF) $(TROFFOPTS) | $(POST) > $*.ps
.5.ps:
	$(TBL) $< | $(TROFF) $(TROFFOPTS) | $(POST) > $*.ps
.8.ps:
	$(TBL) $< | $(TROFF) $(TROFFOPTS) | $(POST) > $*.ps

.4.txt:
	$(TBL) $< | $(NROFF) $(NROFFOPTS) | $(COL) $(COLOPTS) > $*.txt
.5.txt:
	$(TBL) $< | $(NROFF) $(NROFFOPTS) | $(COL) $(COLOPTS) > $*.txt
.8.txt:
	$(TBL) $< | $(NROFF) $(NROFFOPTS) | $(COL) $(COLOPTS) > $*.txt

help:
	# This makefile is used to format Tripwire man pages.
	# It assumes that all the man pages are in the same
	# directory with the Makefile.  For each man page,
	# two files are created.  The .txt file contains
	# the nroff output; the .ps file contains the
	# troff output.
	#
	# To make all the man pages: make all
	# To make all section 4 man pages: make man4
	#    ('man5' and 'man8' are also valid targets.)
	# To format a specific man page: make twconfig
	#    (That is, specify the name minus the extension.)
	# To produce a specific output file: make twconfig.txt
	# To clean up: make clean

all: man4 man5 man8

man4: twpolicy twconfig
man5: twfiles
man8: siggen tripwire twadmin twintro twprint

twpolicy: twpolicy.ps twpolicy.txt
twconfig: twconfig.ps twconfig.txt
twfiles: twfiles.ps twfiles.txt
siggen: siggen.ps siggen.txt
tripwire: tripwire.ps tripwire.txt
twadmin: twadmin.ps twadmin.txt
twintro: twintro.ps twintro.txt
twprint: twprint.ps twprint.txt

clean:
	- rm *.ps *.txt
