CC = cc

#use the following DEFINES line for non-BSD systems
#DEFINES = -Drindex=strchr
DEFINES = -DBSD42

#use the following CFLAGS line for debugging
#CFLAGS = -g $(DEFINES)
CFLAGS = -O $(DEFINES)

SOURCES = texchk.c cmds.c texchars.c errors.c verbatim.c ctools.c
OBJECTS = texchk.o cmds.o texchars.o errors.o verbatim.o ctools.o
LIBS =
BIN = /usr/local
MS=1
MAN = /usr/man/man$(MS)

texchk: $(OBJECTS)
	$(CC) -o texchk $(CFLAGS) $(OBJECTS) $(LIBS)
install: texchk
	rm -f $(BIN)/texchk
	mv texchk $(BIN)/texchk
man: 
	cp texchk.1 $(MAN)/texchk.$(MS)
	man texchk
clean:
	rm -f texchk *.o *~
