#* ----------------------------------------------------------- *#
#*  makefile -- setfocus MAKE file                             *#
#* ----------------------------------------------------------- *#
#*                                                             *#
#*  To add an object-code file to project:                     *#
#*    1. Add .OBJ filename to LDEPENDS macro                   *#
#*    2. Add same .OBJ filename to object-code file list       *#
#*    3. Optionally add explicit dependency for file           *#
#*                                                             *#
#*  To add a library file to project:                          *#
#*    1. Add .LIB filename to library file list                *#
#*                                                             *#
#*  To add or modify a compiler option:                        *#
#*    1. Edit compiler configuration file section              *#
#*                                                             *#
#*  To add or modify a linker option:                          *#
#*    1. Edit linker configuration file section                *#
#*                                                             *#
#* ----------------------------------------------------------- *#
#*     Copyright (c) 1993 by Tom Swan. All rights reserved.    *#
#* ----------------------------------------------------------- *#

# ---------------------------------------------------------------
#  Various macros
# ---------------------------------------------------------------
# CC           Compiler filename (bcc)
# LINK         Linker filename (tlink)
# CFG          Compiler configuration file (turboc.cfg)
# LCFG         Linker configuration file (tlink.cfg)
# LISTOBJ      File containing object-code filenames
# LISTLIB      File containing library filenames
# LIBPATH      Path(s) to library (.lib) files
# INCPATH      Path(s) to include (.h) files
# RCPATH       Path(s) to include (.h) files for RC.EXE

CC = bcc
LINK = tlink
CFG = turboc.cfg
LCFG = tlink.cfg
LISTOBJ = obj.lst
LISTLIB = lib.lst
LIBPATH = C:\borlandc\owl\lib;C:\borlandc\classlib\lib;C:\borlandc\lib
INCPATH = C:\borlandc\owl\include;C:\borlandc\classlib\include;C:\borlandc\include
RCPATH = C:\borlandc\include

# ---------------------------------------------------------------
#  Linker dependencies 
# ---------------------------------------------------------------

LDEPENDS = $(LISTOBJ) $(LISTLIB) $(LCFG)\
 setfocus.res\
 setfocus.obj\
 setfocus.def

# ---------------------------------------------------------------
#  Implicit dependency rules
# ---------------------------------------------------------------

.c.obj:
  $(CC) -c {$< }

.cpp.obj:
  $(CC) -c {$< }

# ---------------------------------------------------------------
#  Explicit dependencies and rules
# ---------------------------------------------------------------

setfocus.exe: $(LDEPENDS)
  $(LINK) @$(LISTOBJ),setfocus.exe,setfocus.map,@$(LISTLIB),setfocus.def
  RC setfocus.res setfocus.exe

setfocus.obj: $(CFG) setfocus.cpp

setfocus.res: $(CFG) setfocus.rc
  RC -r -i$(RCPATH) -fo setfocus.res setfocus.rc

# ---------------------------------------------------------------
#  Create object-code file list for linker
#  Insert .OBJ filenames between "|" delimiters
# ---------------------------------------------------------------

$(LISTOBJ): makefile
  copy &&|
c0wl.obj+
setfocus.obj
| $(LISTOBJ)

# ---------------------------------------------------------------
#  Create library file list for linker
#  Insert .LIB filenames between "|" delimiters
# ---------------------------------------------------------------

$(LISTLIB): makefile
  copy &&|
tclassl.lib+
owlwl.lib+
mathwl.lib+
import.lib+
cwl.lib
| $(LISTLIB)

# ---------------------------------------------------------------
#  Create linker configuration file
#  Insert linker options between "|" delimiters
# ---------------------------------------------------------------

$(LCFG): makefile
  copy &&|
/v
/c
/P-
/Twe
/L$(LIBPATH) 
| $(LCFG)

# ---------------------------------------------------------------
#  Create compiler configuration file
#  Insert compiler options between "|" delimiters
# ---------------------------------------------------------------

$(CFG): makefile
  copy &&|
-R
-ml
-2
-v
-W
-vi-
-H=setfocus.sym
-w
-I$(INCPATH)
-L$(LIBPATH)
-DSTRICT;WIN31
| $(CFG)

# ---------------------------------------------------------------
#  Delete backups, obj, exe, and miscellaneous files
#  Enter MAKE CLEAN to use
# ---------------------------------------------------------------

clean:
  del *.bak
  del *.obj
  del *.exe
  del *.map
  del *.sym
  del *.cfg
  del *.~*
  del *.lst
  del *.rws
  del *.err
  del *.res
