# ----------------------------------------------------------------------------
#                               sstt lib makefile
# ----------------------------------------------------------------------------

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

TCPP    = 1
BCPP    = 0

all          :demo.exe  \
             idemo.exe  \
             ldemo.exe  \
             edemo.exe  \
             vdemo.exe

#  ---------------------------------------------------------------------------
#  Turbo C ++ Macros to establish the memory model, debug, and libraries
#  ---------------------------------------------------------------------------
!if $(TCPP) == 1
COMPILER     = tcc
STARTUP      = \tcpp\lib\c0s
LIBS         = \tcpp\lib\cs
LINKDEBUG    = /m /v
COMPILEDEBUG = -y
!endif

#  ---------------------------------------------------------------------------
#  Borland C++ Macros to establish the memory model, debug, and libraries
#  ---------------------------------------------------------------------------
!if $(BCPP) == 1
COMPILER     = bcc
STARTUP      = \bcpp\lib\c0s
LIBS         = \bcpp\lib\cs
LINKDEBUG    = /m /v
COMPILEDEBUG = -y
!endif


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

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

$(LIBNAME)   :sstedit.obj               \
              sstfield.obj              \
              sstwin.obj                \
              ssthelp.obj               \
              sstmenu.obj               \
              sstvid.obj                \
              sstmouse.obj              \
              sststr.obj                \
              sstmisc.obj
      del $(LIBNAME)
      tlib $(LIBNAME) @sstt.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)

#  ---------------------------------------------------------------------------

test.obj     :test.c

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

