# Makefile : Builds the streamer.exe and owin.dll
#
# Usage:     NMAKE option 
#
# option:    DEBUG=[0|1]  (DEBUG not defined is equivalent to DEBUG=1)
DEBUG=1 

CPPFLAGS=  /AL /W3 /Zp /GA /GEs /G2 /Gt65500 /Gx
CPPdll = /ALw /W3 /Zp /GD /G2 
LINKFLAGS=/NOD /ONERROR:NOEXE

!if "$(DEBUG)"=="1"
CPPFLAGS=/D_DEBUG $(CPPFLAGS) /Od /Zi /f
CPPdll=/D_DEBUG $(CPPdll) /Od /Zi /f
LINKFLAGS=$(LINKFLAGS) /COD
LIBS=lafxcwd libw llibcew 
LIBSdll=lafxdwd libw ldllcew commdlg
!else
CPPFLAGS=$(CPPFLAGS) /Oselg /Gs
CPPdll=$(CPPdll) /Oselg /Gs
LINKFLAGS=$(LINKFLAGS)  
LIBS=lafxcw libw llibcew 
LIBSdll=lafxdw libw ldllcew
!endif

streamer.exe:     streamer.obj streamer.def streamer.res wstream.obj owin.lib
	link $(LINKFLAGS) streamer wstream, streamer, NUL, $(LIBS) owin,streamer.def;
	rc -K /t streamer.res

wstream.obj: wstream.h wio.h

streamer.res:  resource.h streamer.ico streamer.dlg

streamer.obj:  streamer.h resource.h wstream.h


# DLL Stuff


owin.lib: owin.dll
	implib /NOL owin.lib owin.dll

owin.dll: owin.obj owindll.obj owinwrap.obj inputdlg.obj owin.def owin.res
	link $(LINKFLAGS) owin owindll owinwrap inputdlg, owin.dll, NUL, $(LIBSdll),owin.def;
	rc /t  owin.res owin.dll

owin.obj: owin.cpp owin.h inputdlg.h
	cl $(CPPdll) /c owin.cpp

owindll.obj: owindll.cpp
	cl $(CPPdll) /c owindll.cpp

owinwrap.obj: owinwrap.cpp wio.h owin.h
	cl $(CPPdll) /c owinwrap.cpp

inputdlg.obj: inputdlg.cpp inputdlg.h
	cl $(CPPdll) /c inputdlg.cpp


