all: stw5.dll demo.exe

# Replace /MT with /MTd to use the _CrtCheckMemory() type of debug functions, also link with the /DEBUG switch - then recompile all 'c' files
# wd4748: supporess /GS can not provide protection when optimization is disabled
# wd4996: deprecated funcion use
# Removed /Zp, global packing using Zp may not work, particularly on x64, because event the windows structure included using the .h files get packed, thus causing problem with unpacked structure sizes used by gdi32 and user32 dlls
STC_SWITCHES=-c /Zi /MT /W3 /wd4996 /wd4748 /O1 /DWIN64 /DINC_OLE2 /DSSEVAL

demo.res: demo.rc demo.h demo_dlg.dlg demo_dlg.h
    rc -r demo.rc $(CAPTURE)

demo.obj: demo.c demo.h spell.h
    cl $(STC_SWITCHES) demo.c $(CAPTURE)

demo.exe: demo.obj demo.def demo.res
    link DEMO.OBJ /OUT:DEMO.EXE /MAP:DEMO.MAP /DEF:DEMO.DEF -MACHINE:X64 USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB STW5.LIB DEMO.RES

spell.obj: spell.c spell.h
    CL $(STC_SWITCHES) spell.c $(CAPTURE)

spell.res: spell.rc spelldlg.dlg spelldlg.h
    rc -r spell.rc $(CAPTURE)

STW5.dll: spell.obj spell.res
    link SPELL.OBJ -OUT:STW5.DLL -DEF:SPELL.DEF -SUBSYSTEM:windows -DLL -ENTRY:_DllMainCRTStartup -MAP:SPELL.MAP -IMPLIB:STW5.LIB -MACHINE:X64 USER32.LIB GDI32.LIB WINSPOOL.LIB COMDLG32.LIB ADVAPI32.LIB SPELL.RES

