# Makefile for FreeBSD tools directory
# Greg Lehey, LEMIS
#
# $Id: Makefile,v 1.21 2006/05/19 05:41:56 grog Exp $
#

# HEIGHT is the real height of the paper
# Due to a race condition in make, we need to define this in makebookmakefile
# HEIGHT = 8.5i
# WIDTH should be 1.7" less than the real width of the paper
# WIDTH  = 5.05i
# Point size for Dx command
EXAMPLE-SIZE = 7.5

SHELL = /bin/bash

.SUFFIXES: .mm .ps .psl .PS

# get site-specific paths
# ? include paths.make

FILES = Makefile make-index make-table make-toc make-xref mkindex.c roman.c stripcond.c \
	cleanup.c striphead.c ${TMAC} mergeps mergeps.el makesection elimdup setoffset.el \
	massageps.el massagetex.el xlate.el cropmarks.el pageframe.el pageframe-tex.el \
	pageframe pf eqnchar finddup xchar.c setfont.c mkids getchapternumbers

TMAC 	=	tmac.M tmac.an tmac.andoc tmac.doc tmac.doc-common tmac.doc-ditroff tmac.doc-syms \
		tmac.doc-nroff tmac.andoc-book tmac.Mn

PROGS = mkindex stripcond cleanup striphead xchar setfont translate xlate4pdf

CFLAGS += -g -O -Wall

# All files to be maintained by RCS
RCS-FILES = ${FILES}

.SUFFIXES: .mm .ps .psl .PS

all:	${FILES} ${PROGS}

${FILES}:
	co $@

mkindex:	mkindex.o roman.o
	${CC} -o $@ mkindex.o roman.o

# Check in with current date.
ci:
	-ci -d  ${RCS-FILES}
	co Makefile

# Yes, make checks out automatically, but it doesn't use the -M option, so 
# it will remake even if it's not needed.
co:
	-co -l -M -q ${RCS-FILES}

clean:
	rm -rf *~ ${PROGS} core.* Make.log *.o
	rm -f ${FILES}