# Use this makefile if you have access to getpar(). You then
# need to link with the library that provides it (e.g. -lloc below).
# If you don't use the other makefile (./makefile.nopar).
# Modified 8/3/87 by Phil Farrell to include "install" target, specify
# correct library location for getpar, and specify correct bin directory.

CFLAGS = -O
LINTFLAGS = -abchnpux
CSUBS = Expand.c Match.c subs.c
OSUBS = Expand.o Match.o subs.o
BIN = /usr/local/bin

default: all

all: texexpand detex texeqn texmatch

texexpand: texexpand2.o $(OSUBS)
	cc $(CFLAGS) -o texexpand texexpand2.o $(OSUBS) -lloc

detex: detex2.o DeTeX.o $(OSUBS)
	cc $(CFLAGS) -o detex detex2.o DeTeX.o $(OSUBS) -lloc

texeqn: texeqn2.o Eqn.o $(OSUBS)
	cc $(CFLAGS) -o texeqn texeqn2.o Eqn.o $(OSUBS) -lloc

texmatch: texmatch2.o $(OSUBS)
	cc $(CFLAGS) -o texmatch texmatch2.o $(OSUBS) -lloc

lint:
	lint $(LINTFLAGS) texexpand2.c $(CSUBS) > texexpand.lnt
	lint $(LINTFLAGS) detex2.c DeTeX.c $(CSUBS) > detex.lnt
	lint $(LINTFLAGS) texeqn2.c Eqn.c $(CSUBS) > texeqn.lnt
	lint $(LINTFLAGS) texmatch2.c $(CSUBS) > texmatch.lnt
 
install:
	-install -o system texexpand $(BIN)
	-install -o system detex $(BIN)
	-install -o system texeqn $(BIN)
	-install -o system texmatch $(BIN)
	
clean:
	/bin/rm -f texexpand detex texeqn texmatch *.o core *junk* *lnt
