# This makefile is for command-line Borland C++ 5.5 compiler (Win32).
# It builds winvnc.exe (and .\VNCHooks\VNCHooks.dll).

CC=bcc32
RC=brc32
LD=ilink32

CFLAGS= -v- -Od -3 -tWM -xd- -q -P -Iomnithread -I".." -I..\..\rfb\ -w-8057 -w-8004 -w-8066 -w-8027 -w-8012 -w-8022 -DXMD_H -DWIN32
LDFLAGS= /c /Tpe /aa /Gn /B:0x400000

OBJS=winvnc\d3des.obj \
     winvnc\vncLog.obj \
     winvnc\stdhdrs.obj \
     winvnc\translate.obj \
     winvnc\vncAbout.obj \
     winvnc\vncAcceptDialog.obj \
     winvnc\vncauth.obj \
     winvnc\vncBuffer.obj \
     winvnc\vncClient.obj \
     winvnc\vncConnDialog.obj \
     winvnc\vncDesktop.obj \
     winvnc\vncEncodeCoRRE.obj \
     winvnc\vncEncodeHexT.obj \
     winvnc\vncEncoder.obj \
     winvnc\vncEncodeRRE.obj \
     winvnc\vncEncodeTight.obj \
     winvnc\vncEncodeZlib.obj \
     winvnc\vncEncodeZlibHex.obj \
     winvnc\vncHTTPConnect.obj \
     winvnc\vncInstHandler.obj \
     winvnc\vncKeymap.obj \
     winvnc\vncMenu.obj \
     winvnc\vncProperties.obj \
#     winvnc\rfbRegion_win32.obj \
     winvnc\Region.obj \
     winvnc\rfbRegion_X11.obj \
     winvnc\vncServer.obj \
     winvnc\vncService.obj \
     winvnc\vncSockConnect.obj \
     winvnc\vncTimedMsgBox.obj \
     winvnc\VSocket.obj \
     winvnc\WinVNC.obj \
     winvnc\buildtime.obj \
     winvnc\TextChat.obj \
     winvnc\vncDesktopSW.obj \
     winvnc\vncEncoderCursor.obj \
     winvnc\vncEncodeZRLE.obj \
     winvnc\vncListDlg.obj \
     winvnc\rfbUpdateTracker.obj \
#     winvnc\vncLogonntml.obj \
#     winvnc\vncLogonntlm2.obj \
#     winvnc\vncMasterPasswd.obj \
#     winvnc\vncPropPath.obj \
     omnithread\omnithread.obj \
     ..\DSMPlugin\DSMPlugin.obj \
     winvnc\vncOSVersion.obj \
     winvnc\videodriver.obj \
     winvnc\vncmemcpy.obj \
     winvnc\vncEncodeUltra.obj \
     ..\lzo\minilzo.obj \
     winvnc\vncntlm.obj \
     ..\zipunzip32\zipunzip32.obj

LIBS=..\zlib\zlib.lib ..\rdr\rdr.lib ..\libjpeg\libjpeg.lib VNCHooks\VNCHooks.lib

RES=winvnc\winvnc.res

.autodepend
.c.obj:
	$(CC) -c $(CFLAGS) $<
.cpp.obj:
	$(CC) -c $(CFLAGS) $<
.cxx.obj:
	$(CC) -c $(CFLAGS) $< 

.rc.res:
	echo:>afxres.h
	$(RC) -r $<
	del afxres.h

winvnc.exe: $(OBJS) $(LIBS) $(RES)
	$(LD) $(LDFLAGS) c0w32 $(OBJS), $@, , $(LIBS) import32 cw32mt, , $(RES)

..\zlib\zlib.lib:
	cd ..
	cd zlib
	make -fMakefile.bcc32 -l -s
	cd ..
	cd winvnc

..\rdr\rdr.lib:
	cd ..
	cd rdr
	make -fMakefile.bcc32 -l -s
	cd ..
	cd winvnc

..\libjpeg\libjpeg.lib:
	cd ..
	cd libjpeg
	make -fMakefile.bcc32 -l -s
	cd ..
	cd winvnc

VNCHooks\VNCHooks.lib:
	cd VNCHooks
	make -fMakefile.bcc32 -l -s
	cd ..

omnithread\omnithread.obj:
	cd omnithread
	build-bcc32.bat
	cd ..

clean:
	del *.obj winvnc.exe

