#**********************************************************************
# Sample make file for building a console Windows 32-Bit app with a DLL
#**********************************************************************

# Nmake macros for Windows 32-Bit apps
!include <ntwin32.mak>

PROJ=TestDLL
DLL=MinDll

all: $(PROJ).exe $(DLL).dll

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

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

# Update the import (LIB) and export (EXP) librarys
$(DLL).lib: $(DLL).obj $(DLL).def
    lib               \
    -machine:$(CPU)   \
    -def:$(DLL).def   \
    -out:$(DLL).lib

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

# Update the executable file if necessary.
$(PROJ).exe: $(PROJ).obj $(DLL).lib
    $(cvtobj) *.obj
    $(link) $(linkdebug) $(conflags)    \
      -out:$(PROJ).exe                  \
      $(PROJ).obj $(DLL).lib            \
      $(conlibs)
