#****************************************************************************
#      File:  MAKEFILE                                                    
#                                                                         
#   Purpose:  Builds the sample Control Panel Extension
#             To build a non debug version, type nmk at command line
#             To build a debug version, type nmk DEBUG=YES at the command line                                               
#                                                                         
# Development Team:
#
#       Greg Keyser
#
# Written by Microsoft Product Support Services, Windows Developer Support
# Copyright (c) 1992 Microsoft Corporation. All rights reserved.
#****************************************************************************

NAME = coolcolr
OBJ1 = coolcolr.obj appdlg.obj error.obj
OBJ  = $(OBJ1)
LIBS = libw sdllcew commdlg

!if "$(DEBUG)" == "YES"
DEF     = -DDEBUG
CLOPT   = -Zi -Od
MASMOPT = -Zi
LINKOPT = /CO
!else
DEF     =
CLOPT   = -Oas
MASMOPT =
LINKOPT =
!endif

CC      = cl -c -nologo -W3 -AS -G2sw -Zp $(DEF) $(CLOPT)
ASM     = masm -Mx -t -D?QUIET $(DEF) $(MASMOPT)
LINK    = link /NOPACKC/NOD/NOE/LI/MAP/ALIGN:16 $(LINKOPT)

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

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

goal: $(NAME).cpl copy

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

$(NAME).cpl: $(OBJ) libinit.obj coolcolr.def $(NAME).res
    $(LINK) @<<
    libinit.obj +
    $(OBJ1),
    $(NAME).cpl,
    $(NAME).map,
    $(LIBS),
    coolcolr.def
<<
    rc -v $(DEF) $(NAME).res $(NAME).cpl
!if "$(DEBUG)" == "YES"
    -cvpack -p $(NAME).cpl
    mapsym $(NAME).map
!endif

$(NAME).res: coolcolr.rc
    rc $(DEF) -r -V -fo $(NAME).res coolcolr.rc

libinit.obj: libinit.asm
    $(ASM) -DSEGNAME=_INIT -DWEPSEG=_WEP $*;

############## copy ###############

copy:
    copy $(NAME).cpl d:\win31\system
!if "$(DEBUG)" == "YES"
    copy $(NAME).sym d:\win31\system
!endif
    @echo ***** finished making $(NAME) *****

###################################
# START Dependencies 

appdlg.obj: appdlg.c global.h

coolcolr.obj: coolcolr.c global.h

error.obj: error.c global.h

libinit.obj: libinit.asm

# END Dependencies 
