# This is a part of the Microsoft OLE 2.0 sample library.
# Copyright (C) 1993 Microsoft Corporation
# All rights reserved.
#

DEBUG=1
LANG=USA
APPNAME=dataview
GOAL: $(APPNAME).dll

SRCS=$(APPNAME).cpp libmain.cpp dvrun.cpp stockdlg.cpp \
		dvcache.cpp dvstock.cpp stockutl.cpp

INCS=$(APPNAME).h resource.h stockdlg.h stockutl.h

OBJS=$(SRCS:cpp=obj)

#############################################################################

#
# Set the resource directories.  These are the directories where we pull our
# resources from.  You may need to change these to point to the proper location
# of the OLE2UI resources, or just copy all the .DLG and .BMP files into your
# project's directory.
#

OLE2UI_DIR=..\..\ole2ui

!if "$(RES_DIRS)"==""
RES_DIRS=$(OLE2UI_DIR)\RES\STATIC;$(OLE2UI_DIR)\RES\$(LANG)
!endif

G_LIBS=ole2 compobj storage libw shell

G_CPPFLAGS=/ALw /GD /GEd /W3 /Zp /G2
D_CPPFLAGS=/Zi /Od /f /D_DEBUG
R_CPPFLAGS=/O1 /Gs
G_LINKFLAGS=/NOD /ONERROR:NOEXE /NOE /BATCH
D_LINKFLAGS=/COD
R_LINKFLAGS=/FAR /PACKC

# use static version of OLE2UI library
D_LIBS=ldllcew ..\..\lib\loleuidd
R_LIBS=ldllcew ..\..\lib\loleuid

!if "$(DEBUG)"=="0"
CPPFLAGS=$(G_CPPFLAGS) $(R_CPPFLAGS)
LINKFLAGS=$(G_LINKFLAGS) $(R_LINKFLAGS)
LIBS=$(R_LIBS) $(G_LIBS)
!else
CPPFLAGS=$(G_CPPFLAGS) $(D_CPPFLAGS)
LINKFLAGS=$(G_LINKFLAGS) $(D_LINKFLAGS)
LIBS=$(D_LIBS) $(G_LIBS)
!endif #//DEBUG

#############################################################################

$(APPNAME).dll: $(OBJS) $(APPNAME).def stockrc.res
	link $(LINKFLAGS)  @<<
$(OBJS: = +^
),
$(APPNAME).dll,
$(APPNAME),
$(LIBS: = +^
),
$(APPNAME);
<<
	rc /k /t stockrc.res $(APPNAME).dll

.cpp.obj:
	$(CPP) @<<
$(CPPFLAGS) /c $<
<<

stockrc.res: resource.h stockdlg.h
	rc /r /I$(RES_DIRS) stockrc.rc

clean:
	if exist $(APPNAME).dll erase $(APPNAME).dll
	if exist $(APPNAME).lib erase $(APPNAME).lib
	if exist *.pch erase *.pch
	if exist *.obj erase *.obj
	if exist *.sbr erase *.sbr
	if exist *.pdb erase *.pdb
	if exist *.map erase *.map
	if exist *.res erase *.res
	if exist *.aps erase *.aps
	if exist *.bsc erase *.bsc
	if exist *.wsp erase *.wsp
	if exist *.vcw erase *.vcw
