# ----------------------------------------------------------------------------
#                               sst lib makefile
# ----------------------------------------------------------------------------

#  ---------------------------------------------------------------------------
#  Establish memory model and library file name
#  ---------------------------------------------------------------------------
MODEL        = s
LIBNAME      = sst$(MODEL).lib

# ----------------------------------------------------------------------------
# Compiler selection, set slected one to 1 and all else to 0
# ----------------------------------------------------------------------------
TCPP    = 0
BCPP    = 1

all         :demo.exe    \
             idemo.exe   \
             ldemo.exe   \
             edemo.exe   \
             vdemo.exe   \
             mdemo.exe   \
             mscdemo.exe \
             wdemo.exe   \
             sdemo.exe

#  ---------------------------------------------------------------------------
#  Turbo C ++ Macros to establish the memory model, debug, and libraries
#  ---------------------------------------------------------------------------
!if $(TCPP) == 1
COMPILER     = tcc

!if $(MODEL) == s
STARTUP      = \tc\lib\c0s
LIBS         = \tc\lib\cs
!endif
!if $(MODEL) == l
STARTUP      = \tc\lib\c0l
LIBS         = \tc\lib\cl
!endif

LINKDEBUG    = /x /d
COMPILEDEBUG = -N -O -Z -G -M-
!endif

#  ---------------------------------------------------------------------------
#  Borland C++ Macros to establish the memory model, debug, and libraries
#  ---------------------------------------------------------------------------
!if $(BCPP) == 1
COMPILER     = bcc

!if $(MODEL) == s
STARTUP      = \bc\lib\c0s
LIBS         = \bc\lib\cs
!endif
!if $(MODEL) == l
STARTUP      = \bc\lib\c0l
LIBS         = \bc\lib\cl
!endif

LINKDEBUG    = /m /v
COMPILEDEBUG = -y
!endif


#  ---------------------------------------------------------------------------
#  Library
#  ---------------------------------------------------------------------------

$(LIBNAME)   :sstedt.obj              \
              sstfld.obj              \
              sstwin.obj              \
              sstsel.obj              \
              ssthlp.obj              \
              sstmnu.obj              \
              sstvid.obj              \
              sstmou.obj              \
              sststr.obj              \
              sstfos.obj
      del $(LIBNAME)
      tlib $(LIBNAME) @sst.bld


#  ---------------------------------------------------------------------------
#  An implicit rule to build .EXE files
#  ---------------------------------------------------------------------------

.obj.exe:
    tlink $(LINKDEBUG) $(STARTUP) $*, $*,,$(LIBS)

#  ---------------------------------------------------------------------------
#  An implicit rule to build .OBJ files
#  ---------------------------------------------------------------------------

.c.obj:
    $(COMPILER) $(COMPILEDEBUG) -c -m$(MODEL) $*.c

#  ---------------------------------------------------------------------------
demo.obj     :demo.c

demo.exe     :demo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) demo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
idemo.obj    :idemo.c

idemo.exe    :idemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) idemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
ldemo.obj    :ldemo.c

ldemo.exe    :ldemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) ldemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
edemo.obj    :edemo.c

edemo.exe    :edemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) edemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
vdemo.obj    :vdemo.c

vdemo.exe    :vdemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) vdemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
wdemo.obj    :wdemo.c

wdemo.exe    :wdemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) wdemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
mscdemo.obj    :mscdemo.c

mscdemo.exe    :mscdemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) mscdemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
mdemo.obj    :mdemo.c

mdemo.exe    :mdemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) mdemo,$*,,$(LIBS) $(LIBNAME)

#  ---------------------------------------------------------------------------
sdemo.obj    :sdemo.c

sdemo.exe    :sdemo.obj  $(LIBNAME)
                tlink $(LINKDEBUG) $(STARTUP) sdemo,$*,,$(LIBS) $(LIBNAME)



