#===========================================================================;
#
#  MPLAY -- Media Player Applicaiton
#
#############################################################################
#
#   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
#   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
#   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
#   PURPOSE.
#
#   Copyright (c) 1992, 1993  Microsoft Corporation.  All Rights Reserved.
#
#############################################################################
#
#   to make a NON-DEBUG build, type the following line:
#       nmake DEBUG=NO
#   just typing 'nmake' will build a DEBUG build
#
#   You can also set the environment variable DEBUG to NO
#
#===========================================================================;

NAME = mplay
OBJ  = mplay.obj
LIBS = libw slibcew vfw

!if "$(DEBUG)" == "NO"
DEF     =
CLOPT   =
MASMOPT =
LINKOPT =
!else
DEF     = -DDEBUG
CLOPT   = -Zid
MASMOPT = -Zi
LINKOPT = /CO/LI
!endif


CC  = cl -c -W3 -AS -Zp -G2sw -Oxas $(DEF) $(CLOPT) -DWIN31
ASM = masm -Mx $(MASMOPT)
LINK= link /NOE/NOD/LI/MAP/AL:16/ONERROR:NOEXE $(LINKOPT)
RC  = rc 


.c.obj:
	$(CC) $*.c

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



##################### Goal ######################

goal: $(NAME).exe

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

$(NAME).exe: $(OBJ) $(NAME).res $(NAME).def makefile
        $(LINK) $(OBJ), $(NAME), $(NAME),$(LIBS), $(NAME).def
        $(RC) -31 $(NAME).res
        -mapsym $(NAME).map

$(NAME).res: $(NAME).rc $(NAME).ico
        $(RC) -r $(NAME).rc



##################### Clean #####################

clean:
        del $(NAME).exe
        del *.res
        del *.obj
        del *.map
        del *.sym
        del *.pdb


###################  Copy  ######################

copy:
	copy $(NAME).exe ..\..\bin
	copy $(NAME).sym ..\..\bin


################### Depend ######################

depend:
	mv makefile makefile.old
	sed "/^# START Dependencies/,/^# END Dependencies/D" makefile.old > makefile
	del makefile.old
	echo # START Dependencies >> makefile
	includes -l *.c *.asm >> makefile
	echo # END Dependencies >> makefile

