##### Module Macro #####
APP1	= singacd
APP2    = timeacd
APP3    = playacd
APP4    = singawav
SRC1	= $(APP1).c time.c mci.c file.c
SRC2	= $(APP2).c time.c mci.c file.c
SRC3	= $(APP3).c mci.c
SRC4	= $(APP4).c mci.c time.c file.c
OBJS	=

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

##### Library Macro #####
!if $(C7)
LIBS	= libw slibcew commdlg mmsystem oldnames
!else
LIBS	= libw slibcew commdlg mmsystem
!endif
MOD	= -AS

##### Include Macro #####
INCL1	= $(APP1).h common.h
INCL2	= $(APP2).h common.h
INCL3	= $(APP3).h common.h
INCL4	= $(APP4).h common.h

##### Resource Macro #####
RCFILE1 = $(APP1).ico $(APP1).rc
RCFILE2 = $(APP2).ico $(APP2).rc
RCFILE3 = $(APP3).ico $(APP3).rc
RCFILE4 = $(APP4).ico $(APP4).rc

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

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

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

##### Tool Macros #####
ASM	= masm -Mx $(MOPT) $(DDEF) $(DEF)
CC	= cl -nologo -c $(MOD) -G2sw -Zp -W3 $(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: $(APP1).exe $(APP2).exe $(APP3).exe $(APP4).exe

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

$(APP2).exe: $(SRC2:.c=.obj) $(APP2).def $(APP2).res
    $(LINK) @<<
    $(SRC2:.c=.obj) $(OBJS),
    $(APP2).exe,
    $(APP2).map,
    $(LIBS),
    $(APP2).def
<<
    $(RC) -T $(APP2).res
!if $(DEBUG)
!if !$(C7)
    cvpack -p $(APP2).exe
!endif
    mapsym $(APP2).map
!endif

$(APP3).exe: $(SRC3:.c=.obj) $(APP3).def $(APP3).res
    $(LINK) @<<
    $(SRC3:.c=.obj) $(OBJS),
    $(APP3).exe,
    $(APP3).map,
    $(LIBS),
    $(APP3).def
<<
    $(RC) -T $(APP3).res
!if $(DEBUG)
!if !$(C7)
    cvpack -p $(APP3).exe
!endif
    mapsym $(APP3).map
!endif

$(APP4).exe: $(SRC4:.c=.obj) $(APP4).def $(APP4).res
    $(LINK) @<<
    $(SRC4:.c=.obj) $(OBJS),
    $(APP4).exe,
    $(APP4).map,
    $(LIBS),
    $(APP4).def
<<
    $(RC) -T $(APP4).res
!if $(DEBUG)
!if !$(C7)
    cvpack -p $(APP4).exe
!endif
    mapsym $(APP4).map
!endif

##### Dependents #####
$(SRC1:.c=.obj): $(INCL1)
$(SRC2:.c=.obj): $(INCL2)
$(SRC3:.c=.obj): $(INCL3)
$(SRC4:.c=.obj): $(INCL4)
$(APP1).res: $(RCFILE1) $(INCL1)
$(APP2).res: $(RCFILE2) $(INCL2)
$(APP3).res: $(RCFILE3) $(INCL3)
$(APP4).res: $(RCFILE4) $(INCL4)

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