#
# MAKEFILE
# Links Assistant Object version 1.00
#
# 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 -GEd -Aw
LINK    = /al:16/ONERROR:NOEXE/CO
DEFS    = -DSTRICT -D_WINDLL -DDEBUG
!else
CFLAGS  = -c -nologo -Oat -AS -Zpe -G2s -W3 -GA -GEd -Aw
LINK    = /al:16/ONERROR:NOEXE
DEFS    = -DSTRICT -D_WINDLL
!endif

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

TARGET  = lnkassis

goal:   $(TARGET).dll

clean:
    del *.obj
    del *.res
    del *.dll

LIBS    = libw sdllcew compobj ole2 bookui
INCLS   = $(TARGET).h dllassis.h
OBJS    = $(TARGET).obj dllassis.obj
RCFILES =


#####

.cpp.obj:
    echo +++++++++
    echo Compiling $*.cpp
    cl $(CFLAGS) $(DEFS) $*.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).dll : $(OBJS) $(TARGET).res $(TARGET).def
    echo ++++++++++
    echo Linking $@
    echo libentry.obj +                          > $(TARGET).lrf
    echo $(OBJS)                                >> $(TARGET).lrf

    echo $(TARGET).dll $(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 $(TARGET).dll
    del $(TARGET).lrf


##### Dependencies #####

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