#
# Makefile to build the RTTarget-32 demo "reads"
#

!ifndef RTTARGET
RTTARGET_Not_Defined:
   @echo .
   @echo You must define environment variable RTTARGET to compile this example.
   @echo Run batch file VARSVC.BAT in RTTarget-32's installation directory first.
!endif


# Define some environment variables so the compiler and linker
# find everything

INCLUDE = $(RTTARGET)\include;$(HEAPI_DIR);$(INCLUDE)
LIB     = $(RTTARGET)\libmsvc;$(LIB)


# Set linker options to ensure the correct libraries are linked
# and that a relocation table is generated

LNKOPT  = -link /nodefaultlib:kernel32.lib /include:_malloc /include:_EnterCriticalSection@4 /include:_RTFileSystemList /fixed:no


apireset: apireset.rtb

apireset.rtb: apireset.exe monitor.rtb apireset.cfg demopc.cfg
   rtloc -DBOOT apireset demopc.cfg apireset.cfg

apireset.exe: apireset.c
   cl /MT /Fm /Zi -D_RTOS32=1 -oapireset.exe \
      apireset.c \
      ..\rtosdrv.lib \
      rtfiles.lib \
      rtfsk32.lib \
      rtk32.lib \
      drvrt32.lib \
      rtt32.lib \
      rttheap.lib \
      $(LNKOPT)

monitor.rtb: monitor.cfg demopc.cfg
   rtloc -DBOOT Monitor demopc.cfg Monitor.cfg

clean:
      del *.ilk *.map *.lib *.loc *.pdb *.tds *.exp *.obj *.exe

