# $Id: makefile 1.12 1996/09/04 08:42:05 hardy Exp $

CFLAGS = -DOS2 -DOS2EMX_PLAIN_CHAR -Wall -Zmtd -O99 -DNDEBUG
# -DTRACE -DDEBUG -g
# -DDEBUG_ALL -DTRACE_ALL -DTRACE -DDEBUG -g
# -O99 -DNDEBUG

CC = gcc

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

O = .o

OBJECTS = areas$(O) kill$(O) main$(O) mts$(O) news$(O) newsrc$(O) nntpcl$(O) pop3$(O) \
                reply$(O) smtp$(O) socket$(O) util$(O)
LIBS = -lregexp -lsocket -lstdcpp
PROGRAM = vsoup.exe
VERSION = vsoup11

$(PROGRAM): $(OBJECTS)
	$(CC) $(CFLAGS) -o $(PROGRAM) $(OBJECTS) $(LIBS)
#	copy $(PROGRAM) f:\yarn\bin

areas$(O):    areas.hh mts.hh

kill$(O):     kill.hh mts.hh

main$(O):     areas.hh global.hh mts.hh news.hh pop3.hh reply.hh

mts$(O):      mts.hh sema.hh

news$(O):     areas.hh global.hh kill.hh mts.hh news.hh newsrc.hh nntp.hh nntpcl.hh \
              socket.hh

newsrc$(O):   mts.hh newsrc.hh util.hh

nntpcl$(O):   mts.hh nntp.hh nntpcl.hh socket.hh

pop3$(O):     areas.hh global.hh mts.hh pop3.hh socket.hh

reply$(O):    global.hh mts.hh nntpcl.hh reply.hh smtp.hh socket.hh util.hh

smtp$(O):     global.hh mts.hh smtp.hh socket.hh util.hh

socket$(O):   mts.hh socket.hh sema.hh

util$(O):     mts.hh util.hh sema.hh

test$(O):     global.hh socket.hh sema.hh util.hh

ci:
	ci -u $(CI) *.cc *.hh makefile README

zip:
	emxbind -s $(PROGRAM)
	-del $(VERSION).zip > nul 2>&1
	zip -9 $(VERSION) *.cc *.hh makefile readme yarnio.cmd $(PROGRAM)
	uuencode $(VERSION).zip $(VERSION).uue

clean:
	-del *.o         > nul 2>&1
	-del *.exe       > nul 2>&1
	-del $yarnio.cmd > nul 2>&1
