#
#  MAKEFILE for building the
#  Share DLL and its Test program
#

#
#   Set targets and dependencies
#

all: test.exe share.dll
test.exe: test.obj share.lib
share.lib: share.obj share.def
share.dll: share.obj share.exp

#
#  Define macros for command line options 
#  and library modules
#

!IFDEF NODEBUG
CFLAGS = -c -Os -W3 -D_X86_=1 -DWIN32 -D_MT -D_DLL
LFLAGS =
!ELSE
CFLAGS = -c -Od -W4 -Zi -D_X86_=1 -DWIN32 -D_MT -D_DLL
LFLAGS = -debug:full -debugtype:cv
!ENDIF
SUBSYS = -subsystem:console
LIBS = crtdll.lib kernel32.lib user32.lib

#
#  Define compiling rules
#

.c.obj:
   cl386 $(CFLAGS) $*.c

.obj.lib:
   lib32 -machine:$(CPU) $*.obj -out:$*.lib -def:$*.def

.obj.exe:
   link32 $(LFLAGS) $(SUBSYS) -out:$*.exe $*.obj \
   $(LIBS) share.lib

.obj.dll:
   link32 $(LFLAGS) -DLL -entry:_DllMainCRTStartup@12 \
      -out:$*.dll $*.obj $*.exp $(LIBS)
