# -*- Mode: Makefile -*-

CC = gcc
OPT = -g
CFLAGS = $(OPT) -I/usr/include/g++

OBJECTS = asyncore.o asynchat.o

.SUFFIXES:	.cpp .o

.cpp.o:
	$(CC) -c $(CFLAGS) $<

all: async.a

async.a: $(OBJECTS)
	$(RM) $@
	$(AR) cq $@ $(OBJECTS)
	-ranlib $@

asyncore.o: asyncore.cpp asyncore.h
asynchat.o: asynchat.cpp asynchat.h string_prefix.h

servtest: servtest.o async.a
	$(CC) servtest.o -o servtest async.a -lstdc++

echo_server: echo_server.o async.a
	$(CC) echo_server.o -o echo_server async.a -lstdc++

clean:
	$(RM) $(OBJECTS) async.a servtest.o servtest
