# Nmake macros for building Windows 32-Bit apps

!include <ntwin32.mak>

all: demo.exe tty.dll

# Update the object files if necessary

demo.obj: demo.c
    $(cc) $(cflags) $(cvarsdll) $(cdebug) demo.c

tty.obj: tty.c
    $(cc) $(cflags) $(cvarsdll) $(cdebug) tty.c

# Update the resources if necessary

demo.res: demo.rc demo.h
    $(rc) $(rcvars) -r demo.rc

# Update the import library

tty.lib: tty.obj tty.def
    $(implib) -machine:$(CPU)     \
    -def:tty.def	    \
    tty.obj	 	    \
    -out:tty.lib

# Update the dynamic link library

tty.dll: tty.obj tty.def
    $(link) $(linkdebug) $(dlllflags)     \
    -base:0x1C000000  \
    -out:tty.dll   \
    tty.exp tty.obj $(guilibsdll)


# Update the executable file if necessary.
# If so, add the resource back in.

demo.exe: demo.obj tty.lib demo.res demo.def
    $(link) $(linkdebug) $(guiflags) -out:demo.exe demo.obj tty.lib demo.res $(guilibsdll)
