CC = cc
CPLUSPLUS = g++
CPLUSPLUSLIBDIR = -L/depot/gnu/arch/lib
CPLUSPLUSLIB = -lg++

CFLAGS = -g -I..
LIBEXPECT = ../libexpect.a

cleanup:
	rm -f expect devtty exho dumb test.raw test.results test.tmp

all: chesslib chesslib2 chesslib++

# this can be compiled with either cc or gcc
chesslib: chesslib.o $(LIBEXPECT)
	$(CC) -g -o chesslib chesslib.o $(LIBEXPECT)

# this can be compiled with either cc or gcc
chesslib2: chesslib2.o $(LIBEXPECT)
	$(CC) -g -o chesslib2 chesslib2.o $(LIBEXPECT)

# this is compiled with c++
chesslib++: chesslib++.o $(LIBEXPECT)
	$(CPLUSPLUS) -g -o chesslib++ chesslib++.o $(LIBEXPECT) \
		$(CPLUSPLUSLIBDIR) $(CPLUSPLUSLIB)

chesslib++.o: chesslib++.c
	$(CPLUSPLUS) -c $(CFLAGS) chesslib++.c
