#
#  MAKEFILE for the sample
#

#  The ISHANDLE DLL part of the makefile

all: ISHANDLE.DLL handle.exe

# ---- Compiler & Linker options ----
DLL_compile = -c -Asnw -Gsw -f-  -Os -Zpe
DLL_link    = /NOD /NOE /MAP

Ishandle.obj: Ishandle.c Ishandle.h
     cl $(DLL_compile) Ishandle.c

Ishandle.dll:: IsHandle.obj Ishandle.def
     link $(DLL_link) Ishandle libentry, IsHandle.dll, IsHandle/map/li, sdllcew libw toolhelp, IsHandle.def
     rc IsHandle.dll
     mapsym ishandle.map

#
#   The app part of the makefile
#

# ---- Compiler & Linker options ----
APP_compile = -c -AM -Gsw -Zpe -W3 -f- -Fs -Os $(DEFINES)
APP_link = /align:16 /NOD /NOE /m
APP_libs = libw mlibcew

# ---- List of object files ----
objfiles=handle.obj mainwnd.obj

# ---- Actual build dependencies ----
handle.res: handle.rc
    rc -r handle.rc

handle.obj: handle.c handle.h
    cl $(APP_compile) handle.c

mainwnd.obj: mainwnd.c handle.h 
    cl $(APP_compile) mainwnd.c

handle.exe:: $(objfiles) makefile handle.def handle.res
    link $(APP_link) $(objfiles), HANDLE, HANDLE/map/li, $(APP_libs), HANDLE.def
    rc handle.res
    mapsym handle.map
    
handle.exe:: handle.res
    rc handle.res
