
!INCLUDE    <standard.mak>

TARGETS : SYMBOLS drvinfo.exe

#   Define the following (case-dependent!) symbols as null macros on the
#   NMAKE command line:
#
#   NOIOSYS	to skip undocumented reference to IO.SYS drive tables and
#		force use of int 13h trap;
#
#   DOSAPI	to use int 21h functions rather than inspect internal
#		structures;
#
#   NODRVMAP	to see the effect of ignoring logical drive mapping.
#
#   The choice of symbols used for a make is remembered so that object
#   modules can be deleted selectively next time the executable is rebuilt.
#   The information is prepared in the from of macro definitions and written
#   to a file called SYMBOLS.LST for use as a response file to NMAKE.  The
#   project should therefore be built with a command line like
#
#	NMAKE NOIOSYS= NODRVMAP= @symbols.lst
#
#   If the macros in SYMBOLS.LST have not been loaded, then all object
#   modules are deleted to force complete recompilation.

OLD = OLD_SYMBOLS=
!IFDEF NOIOSYS
OLD = $(OLD) NOIOSYS_OLD=
!ENDIF
!IFDEF DOSAPI
OLD = $(OLD) DOSAPI_OLD=
!ENDIF
!IFDEF NODRVMAP
OLD = $(OLD) NODRVMAP_OLD=
!ENDIF

SYMBOLS :
  @rem >nul <<symbols.lst
$(OLD)
<<KEEP
!IF defined(OLD_SYMBOLS)
!IF defined(NOIOSYS) ^^ defined(NOIOSYS_OLD)
  del biosdrv.obj
!ENDIF
!IF defined(DOSAPI) ^^ defined(DOSAPI_OLD)
  del doslevel.obj
!ENDIF
!IF defined(NODRVMAP) ^^ defined(NODRVMAP_OLD)
  del main.obj
!ENDIF
!ELSE
  del *.obj
!ENDIF

biosdrv.obj : biosdrv.c
!IFDEF NOIOSYS
  $(COMPILE) /D _NO_IOSYS_ biosdrv.c
!ENDIF

doslevel.obj : doslevel.c
!IFDEF DOSAPI
  $(COMPILE) /D _USE_DOS_API_ doslevel.c
!ENDIF

!IFNDEF NODRVMAP
drvmap.obj : drvmap.c
!ENDIF

drvinfo.obj : drvinfo.c

main.obj : main.c
!IFDEF NODRVMAP
  $(COMPILE) /D _NO_DRIVE_MAP_ main.c
!ENDIF

OBJECTS = biosdrv.obj doslevel.obj drvinfo.obj main.obj
!IFNDEF NODRVMAP
OBJECTS = $(OBJECTS) drvmap.obj
!ENDIF

#   BREAK.OBJ is in the library directory and is assumed to be current.

drvinfo.exe : $(OBJECTS)
  $(LINK) break+$(OBJECTS),drvinfo;

