# -*- Mode: Makefile; tab-width: 4 -*-

!include <win32.mak>

cflags = $(cflags) -Id:/stl -GX -MLd
OBJECTS = asyncore.obj asynchat.obj

.SUFFIXES:	.cpp .obj

.cpp.obj:
	$(cc) $(cflags) $(cdebug) $<

all: async.lib servtest.exe

async.lib: $(OBJECTS)
	del $@
	lib $(ldebug) -out:$@ $(OBJECTS)

asyncore.obj: asyncore.cpp asyncore.h
asynchat.obj: asynchat.cpp asynchat.h
servtest.obj: servtest.cpp

servtest.exe: servtest.obj async.lib
	link -out:servtest.exe servtest.obj $(ldebug) $(conflags) async.lib wsock32.lib libcd.lib libcid.lib libcpd.lib kernel32.lib

echo_server.exe: echo_server.obj async.lib
	link -out:echo_server.exe echo_server.obj $(ldebug) $(conflags) async.lib wsock32.lib libcd.lib libcid.lib libcpd.lib kernel32.lib

clean:
	del async.lib
	del *.obj
	del servtest.exe