#
# MAKEFILE
# Interfaces in C++ example
#
# Copyright (c)1993 Microsoft Corporation, All Rights Reserved
#
# Kraig Brockschmidt, Software Design Engineer
# Microsoft Systems Developer Relations
#
# Internet  :  kraigb@microsoft.com
# Compuserve:  >INTERNET:kraigb@microsoft.com
#

#Add '#' to the next line for 'noisy' operation
!CMDSWITCHES +s

#
#Compiler flags
#Use "SET RETAIL=1" from MS-DOS to compile non-debug version.
#
!ifndef RETAIL
CFLAGS  = -c -nologo -Od -AS -Zipe -G2s -W3 -GA -GEs
DEFS    = -DSTRICT -DDEBUG
LINK    = /al:16/ONERROR:NOEXE/li/CO
!else
CFLAGS  = -c -nologo -Oas -AS -Zpe -G2s -W3 -GA -GEs
LINK    = /al:16/ONERROR:NOEXE/li
DEFS    = -DSTRICT
!endif


.SUFFIXES: .h .obj .exe .cpp .res .rc

TARGET  = enum

goal:   $(TARGET).exe

clean:
    del *.obj
    del *.res
    del *.exe


LIBS    = libw slibcew
INCLS   = $(TARGET).h
OBJS    = $(TARGET).obj ienum.obj
RCFILES = $(TARGET).ico


#####

.cpp.obj:
    echo ++++++++++
    echo Compiling $*.cpp
    cl $(CFLAGS) $(DEFS) $(CPPDEF) $*.cpp

.rc.res:
    echo +++++++++
    echo Compiling Resources
    rc -r $(DEFS) $*.rc


#This rule builds a linker response file on the fly depending on debug flags
$(TARGET).exe : $(OBJS) $(TARGET).res $(TARGET).def
    echo ++++++++++
    echo Linking $@
    echo $(OBJS)                                 > $(TARGET).lrf

    echo $(TARGET) $(LINK)                      >> $(TARGET).lrf
    echo nul/li                                 >> $(TARGET).lrf
    echo $(LIBS)/NOD/NOE                        >> $(TARGET).lrf
    echo $(TARGET).def                          >> $(TARGET).lrf

    link @$(TARGET).lrf
    rc -v $(TARGET).res
    del $(TARGET).lrf



##### Dependencies #####

$(TARGET).obj : $(TARGET).cpp $(INCLS)
ienum.obj     : ienum.cpp
$(TARGET).res : $(TARGET).rc  $(INCLS) $(RCFILES)
