#
#   Makefile for BOUNCER sample screen-saver application.
#
#   By default, constructs a small-model screen-saver application
#   bouncer.scr and a debug bouncer.exe.  If DEBUG=NO, only the
#   screen-saver is created.  To do this, call NMAKE with the command line:
#
#       nmake DEBUG=NO
#

NAME    =bouncer
CC  =cl -c -W3 -AS -G2sw -Zidp -Od
RC  =rc
OBJ =$(NAME).obj
LIBS    =libw slibcew mmsystem 
LINK    =link /NOD/NOE/MAP

!if "$(DEBUG)" == "NO"
goal: $(NAME).scr copy
!else
goal: $(NAME).scr $(NAME).exe copy
!endif

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

main.obj:   $*.c
    $(CC) -DDEBUG $*.c

$(NAME).scr:    $(OBJ) $(NAME).def $(NAME).res
    $(LINK) @<<
    $(OBJ),
    $(NAME).scr,
    $(NAME).map,
    $(LIBS) scrnsave,
    $(NAME).def
<<
    $(RC) $(NAME).res $(NAME).scr

$(NAME).exe:    $(OBJ) main.obj $(NAME).def $(NAME).res
    $(LINK)/CO/LI @<<
    $(OBJ) main.obj,
    $(NAME).exe,
    $(NAME).map,
    $(LIBS),
    $(NAME).def
<<
    $(RC) $(NAME).res $(NAME).exe
!IF "$(DEBUG)" != "NO"
    cvpack -p $(NAME).exe
    mapsym $(NAME).map
!ENDIF

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

copy:
!ifdef windir
    copy $(NAME).scr $(windir)
!endif

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