
#   ************************************************************************
#   *	     makefile for the Keep C resident programming libraries	   *
#   ************************************************************************

#   This makefile produces essential libraries and object modules for the
#   Keep C scheme of resident programming in C.

!INCLUDE	<standard.mak>

LIBDIR = ..\..\..\lib

#   ========================================================================

TARGETS : keepsegs.obj crtkeepc.lib

#   KEEPC.OBJ - source supplied to allow extension of the segmentation
#   model.  If used, it must be the first module to be linked.

keepsegs.obj : keepsegs.asm {$(INCLUDE)}keepsegs.inc

#   CRTKEEPC.LIB - the Keep C interface with the C run-time.  This should be
#   placed first in the list of modules to be linked, with the one exception
#   noted above.

KEEPC_INCLUDES = keepinit.inc {$(INCLUDE)}keepsegs.inc

!IFNDEF SEGDEBUG
SEGDEBUG = ON
!ENDIF
!IF "$(SEGDEBUG)" == "ON"
SEGDEBUG_OBJ = segdebug.obj
SEGDEBUG_DEF = /D SEGDEBUG
!ENDIF

keepinit.obj : keepinit.asm $(KEEPC_INCLUDES)

progname.obj : progname.asm $(KEEPC_INCLUDES)

!IF "$(SEGDEBUG)" == "ON"
segdebug.obj : segdebug.asm $(KEEPC_INCLUDES)
!ENDIF

swaprefs.obj : swaprefs.asm $(KEEPC_INCLUDES)
  $(ASSEMBLE) $(SEGDEBUG_DEF) swaprefs.asm

swapsegs.obj : swapsegs.asm $(KEEPC_INCLUDES)

crtkeepc.lib : keepinit.obj progname.obj $(SEGDEBUG_OBJ) swaprefs.obj \
	       swapsegs.obj
  !$(LIBRARIAN) crtkeepc.lib -+$?;
  del crtkeepc.bak
  copy crtkeepc.lib $(LIBDIR)

#   ************************************************************************

