#Author: Anthony Bloesch
#Title: generate.c
#
#Copyright (C) Anthony Bloesch 1993
#
#Version: 1.0
#
#Usage:
#  make
#
#  also
#
#  make lint
#  make clean
#  make shar
#  make test

#Debugging
#DEBUG=-g
#OPTIMIZATION=

#Production
DEBUG=
OPTIMIZATION=-fast

CC=/usr/lang/acc
LATEX=/usr/local/tex/latex
LINT=/usr/lang/alint
SHAR=/usr/local/shar/shar

COMPILE=${CC} ${DEBUG} -c -vc -Xc ${OPTIMIZATION}
LINK=${CC} ${DEBUG}

SOURCE1=Makefile layout.c layout.h treetex.c
SOURCE2=README treetex.1 test1.tex test2.tex treetex.sty
SOURCE=${SOURCE1} ${SOURCE2}

all: treetex

treetex: Makefile treetex.o layout.o
	${LINK} -o treetex treetex.o layout.o

treetex.o: Makefile treetex.c layout.h
	${COMPILE} -o treetex.o treetex.c

layout.o: Makefile layout.c layout.h
	${COMPILE} -o layout.o layout.c

#                                 Utilities

clean:
	rm -f *.o *.tli *.tlo *.dvi *.aux *.log *.plg *.shar? *~ treetex

lint:
	${LINT} treetex.c layout.c

shar:
	${SHAR} -n1 -e2 ${SOURCE1} >treetex.shar1
	${SHAR} -n2 -e2 ${SOURCE2} >treetex.shar2

test: treetex
	${LATEX} test1.tex
	./treetex testtreea
	./treetex testtreeb
	./treetex testtreec
	${LATEX} test1.tex
	${LATEX} test2.tex
	./treetex testtreed
	./treetex testtreee
	${LATEX} test2.tex