#  ************************************************************************
#
#                       Microsoft Developer Support
#            Copyright (c) 1992, 1993 Microsoft Corporation
#
#  ************************************************************************
#  MAKEFILE  : MdiPad32
#  PURPOSE   : A Small Win32/Win16 Sample MDI Application Template Makefile
#  COMMENTS  :
#
#  ************************************************************************

# Nmake macros for building Win32 applications
!include <ntwin32.mak>

# macro defines
PROJ=MdiPad
DLL=ToolBar

# target list
all: $(PROJ).exe $(DLL).dll

# Update the resource if necessary
$(PROJ).res: $(PROJ).rc $(PROJ).dlg $(PROJ).h
    $(rc) $(rcvars) -r -fo $(PROJ).res $(PROJ).rc
    $(cvtres) -$(CPU) $(PROJ).res -o $(PROJ).rbj

# Update the object file if necessary
$(PROJ).obj: $(PROJ).c $(PROJ).h
    $(cc) $(cdebug) $(cflags) $(cvars) $(PROJ).c

$(DLL).obj: $(DLL).c $(DLL).h
    $(cc) $(cdebug) $(cflags) $(cvars) $(DLL).c

# Update the import library
$(DLL).lib: $(DLL).obj $(DLL).def
    $(implib) -machine:$(CPU) \
    -def:$(DLL).def           \
    -out:$(DLL).lib

# Update the dynamic link library
$(DLL).dll: $(DLL).obj $(DLL).def
    $(link) $(ldebug) $(guilflags)  \
    -base:0x1C000000                \
    -dll                            \
    -entry:DllEntryPoint$(DLLENTRY) \
    -out:$(DLL).dll                 \
    $(DLL).exp $(DLL).obj           \
    $(guilibs)

# Update the executable file if necessary, and if so, add the resource back in.
$(PROJ).exe: $(PROJ).obj $(PROJ).res $(PROJ).def $(DLL).lib
    $(link) $(ldebug) $(guilflags)\
    -out:$(PROJ).exe\
    $(PROJ).obj $(DLL).lib $(PROJ).rbj\
    $(guilibs)
