##### Module Macros ####
SRCS    = util.c sample.c 
OBJS    = 

##### C7 Macro #####
C7  = 1

##### Library Macros #####
LIBS    = libw slibcew oms.lib commdlg
INCLS   = sample.h

##### Resource Macro #####
RCFILES = sample.rc

##### DEBUG Macro Defined ####
DEBUG   = 1

##### Build Option Macros #####
!if $(DEBUG)
DDEF    = -DDEBUG
CLOPT   = -Zpid -Od -D_DEBUG
MOPT    = -Zpi
LOPT    = /CO /LI /MAP
!else
DDEF    =
CLOPT   = -Os
LOPT    =
!endif

##### General Macros #####
DEF =

##### Tool Macros #####
ASM = masm -Mx $(MOPT) $(DDEF) $(DEF)
CC  = cl -nologo -c -G2sw -Zp -W3 -AS $(CLOPT) $(DDEF) $(DEF)
LINK    = link /NOD /NOE $(LOPT)
RC  = rc $(DDEF) $(DEF)
HC  = hc

##### Inference Rules #####
.c.obj:
    $(CC) $*.c

.asm.obj:
    $(ASM) $*.asm

.rc.res:
    $(RC) -r $*.rc

##### Main (default) Target #####
goal: sample.exe

##### Dependents For Goal and Command Line #####
sample.exe: $(SRCS:.c=.obj) sample.def sample.res
    $(LINK) @<<
    $(SRCS:.c=.obj) $(OBJS),
    sample.exe,
    sample.map,
    $(LIBS),
    sample.def
<<
    $(RC) -T sample.res
!if $(DEBUG)
!if !$(C7)
    cvpack -p sample.exe
!endif
    mapsym sample.map
!endif

##### Dependents #####
$(SRCS:.c=.obj):  $(INCLS)
sample.res: $(RCFILES)

##### Clean Directory #####
clean:
    -del *.obj
    -del *.res
    -del *.exe
    -del *.map
    -del *.sym
