####
#makefile - makefile for dspcalc2.exe
#
#       Copyright (C) 1992, Microsoft Corporation
#
#Purpose:
#  Builds the OLE 2.0 sample IDispatch server, dspcalc2.exe.
#
#
#  Usage: NMAKE                 ; build with defaults
#     or: NMAKE option          ; build with the given option(s)
#     or: NMAKE clean           ; erase all compiled files
#
# option: DEBUG=[0|1]           ; DEBUG=1 is the default
#
#Notes:
#  This makefile assumes that the PATH, INCLUDE and LIB environment
#  variables are setup properly.
#
##############################################################################


# defaults
#
!if "$(DEBUG)" == ""
DEBUG = 1
!endif


# build variables
#
CC = cl

CFLAGS = -W3 -AM -GA -GEs
LINKFLAGS = /NOD /NOI /BATCH /ONERROR:NOEXE

!if "$(DEBUG)" == "1"
CFLAGS = $(CFLAGS) -Od -Zi -D_DEBUG $(CL)
LINKFLAGS = $(LINKFLAGS) /COD
!else
CFLAGS = $(CFLAGS) -Ox $(CL)
LINKFLAGS = $(LINKFLAGS) /FAR /PACKC
!endif

LIBS = libw mlibcew ole2 compobj typelib ole2disp

OBJS = \
	main.obj        \
	dspcalc2.obj    \
	clsid.obj


# targets
#
goal : setflags dspcalc2.exe

setflags :
	set CL=$(CFLAGS)

clean :
	-erase *.obj
	-erase dspcalc2.exe
	-erase dspcalc2.map
	-erase dspcalc2.res
	-erase dspcalc2.tlb
	-erase calactype.h


dspcalc2.exe : $(OBJS) dspcalc2.def dspcalc2.res
	link $(LINKFLAGS) @<<
$(OBJS),
$@,,
$(LIBS),
dspcalc2.def
<<
	rc -k -t dspcalc2.res $@

dspcalc2.res : dspcalc2.rc dspcalc2.ico
	rc -r -fo$@ dspcalc2.rc


# dependencies
#                
calctype.h : calctype.odl        
	del calctype.h
	wx /w mktyplib /nocpp /h calctype.h /o calctype.log /tlb dspcalc2.tlb calctype.odl
	
main.obj : main.cpp dspcalc2.h calctype.h
	$(CC) -c main.cpp

dspcalc2.obj : dspcalc2.cpp dspcalc2.h calctype.h
	$(CC) -c dspcalc2.cpp

clsid.obj : clsid.c clsid.h
	$(CC) -c clsid.c
