##############################################################################
#   $Id: makefile 501.0 1995/02/28 18:37:28 RON Exp $
#
#   Copyright (c) 1990-95 Tarma Software Research. All rights reserved.
#
#   Project:	Tarma Library for C++ V5.0
#   Author:	Ron van der Wal
#
#   MAKEFILE for Tarma Library for C++, compiler versions:
#
#   - Borland C++ 3.0 - 4.5 for DOS & Windows
#   - Borland C++ 1.0 - 2.0 for OS/2
#
#   Syntax:
#	MAKE <platform> [-DEBUG|-DCG] [<other options>]
#
#	Platform	<platform>	<other options>
#	--------------------------------------------------------------------
#	MS-DOS (normal) -DDOS		M=(t|s|c|m|l|h) -DSYM
#	MS-DOS (16-ext) -DD16		-DLL -DSYM
#	MS-DOS (32-ext) -DD32		-DLL -DSYM
#	OS/2 2.x	-DOS2		-DPM, -DMT -DSYM
#	Windows 16-bit	-DWIN		M=(t|s|c|m|l|h), -DLL, -DRTLDLL -DSYM
#	Win32S		-DW32S		-DLL, -DRTLDLL -DSYM
#	Windows NT 3.x	-DNT		-DLL, -DRTLDLL -DSYM
#
#   Note: To perform LINT processing, add -DLIN to the command line.
#
#   $Log: makefile $
#   Revision 501.0  1995/02/28 18:37:28  RON
#   Updated for TLX 5.01
#   Revision 1.9  1995/01/31 17:17:50  RON
#   Update for release 012
#   Added partial support for SunPro C++ compiler
#   Revision 1.8  1995/01/18  19:07:33	ron
#   Added support for Windows NT
#
#   Revision 1.7  1995/01/05  16:18:26	ron
#   Reorganized
#
#   Revision 1.6  1994/10/13  12:01:18	ron
#   Moved all file lists to separate file
#   Switched to explicit response files
#   Added initial support for LINT
#   Reorganized several sections
#
#   Revision 1.5  1994/10/10  17:10:29	ron
#   Several updates to library contents
#   Added support for PROJLEVEL environment variable
#
#   Revision 1.4  1994/10/07  17:13:11	ron
#   Many clean-up changes; addition of new files
#
#   Revision 1.3  1994/10/05  18:52:41	ron
#   Reorganized comments & formatting
#   Added new file
#   Added timestamping support
#
#   Revision 1.2  1994/09/28  14:50:07	ron
#   Adapted to changes in directory layout
#   Added new modules
#   Added small test program
#
#   Revision 1.1  1994/09/07  16:34:22	ron
#   Initial revision
#
##############################################################################

.swap		# If applicable (real-mode version of MAKE only)

#-----------------------------------------------------------------------------
#	MAKE parameters
#-----------------------------------------------------------------------------

!if !$d(DOS) && !$d(D16) && !$d(D32) && !$d(OS2) && !$d(WIN) && !$d(W32S) && !$d(NT)

!if $d(__MSDOS__)
DOS	= 1
!elif $d(__OS2__)
OS2	= 1
!else
!error Must specify -DDOS, -DD16, -DD32, -DOS2, -DWIN, -DW32S, or -DNT
!endif

!endif

!ifdef CG
EBUG=1
!endif

#-----------------------------------------------------------------------------
#	TLX version number (used with DLLs)
#-----------------------------------------------------------------------------

TLXVER	= 501			# TLX version number

!ifndef PROJLEVEL
PROJLEVEL = Experimental
!endif

#-----------------------------------------------------------------------------
#	Common options, part 1
#-----------------------------------------------------------------------------

MAKEFILE	= makefile
!ifdef LIN
DEPEND		= lint.dep
!else
DEPEND		= makefile.dep
!endif

MD		= makedep
MDFLAGS 	= /I$(INCLUDE) /X$(EXCLUDE) /O$(DEPEND) /A$(MAKEFILE)

!if $d(DOS)
#----------------------------------------------------------------------------
#    DOS options
#
#    Library = TLXDm[d]
#----------------------------------------------------------------------------

AS		= TASM
CC		= BCC
LINK		= TLINK
LIBR		= TLIB
LINT		= c:\bin\lint\lint

!ifndef M
M		= l
!endif

POSTFIX 	= d$(M)
AFLAGS		= /mx
CFLAGS		= -c -d -O1 -w -D_TLXBUILD -m$(M) -DPROJLEVEL=$(PROJLEVEL)
LFLAGS		= /c /yx
BFLAGS		= /C
LINTF		= -zero -ic:\bin\lint std.lnt -i$(INCLUDE) +v -m$(M)

!ifdef EBUG	#-----	Debugging version

POSTFIX 	= $(POSTFIX)d
AFLAGS		= $(AFLAGS) /zi
CFLAGS		= $(CFLAGS) -N -D_TLXDBG
LFLAGS		= $(LFLAGS) /m
BFLAGS		= $(BFLAGS) /P128
LINTF		= $(LINTF) -D_TLXDBG

!ifdef SYM	# Include symbolic debug info
CFLAGS		= $(CFLAGS) -v
LFLAGS		= $(LFLAGS) /v
!endif

!ifdef CG	# Include CodeGuard info
!error CodeGuard not supported under DOS
!endif

!else		#-----	Distribution version

AFLAGS		= $(AFLAGS)
CFLAGS		= $(CFLAGS) -G- -D_NO_LINK_CHECK
LFLAGS		= $(LFLAGS) /x
BFLAGS		= $(BFLAGS) /P32 /0
LINTF		= $(LINTF)

!endif	# EBUG

!ifdef LL
!error DLLs not supported under DOS
!endif

STARTUP 	= C0$(M)
RUNTIME 	= EMU MATH$(M) C$(M)

!elif $d(D32)
#----------------------------------------------------------------------------
#    DOS 32-bit options
#
#    Library = TLXDX[d][i]
#----------------------------------------------------------------------------

# Under DOS-32, compilation for static and dynamic libraries differs, and
# we have separate output directories and configuration files for the .OBJ
# files of each variant.

AS		= TASM
CC		= BCC32
LINK		= TLINK32
LIBR		= TLIB
LINT		= c:\bin\lint\lint

POSTFIX 	= dx
AFLAGS		= /mx
CFLAGS		= -3 -c -d -O1 -w -D_TLXBUILD -DPROJLEVEL=$(PROJLEVEL)
LFLAGS		= /c
BFLAGS		= /C

!ifdef RTLDLL
CFLAGS		= $(CFLAGS) -D_RTLDLL
POSTFIX 	= $(POSTFIX)r
!endif

!ifdef EBUG	#-----	Debugging version

POSTFIX 	= $(POSTFIX)d
AFLAGS		= $(AFLAGS) /zi
CFLAGS		= $(CFLAGS) -N -D_TLXDBG
LFLAGS		= $(LFLAGS) /m
BFLAGS		= $(BFLAGS) /P128

!ifdef SYM	# Include symbolic debug info
CFLAGS		= $(CFLAGS) -v
LFLAGS		= $(LFLAGS) /v
!endif

!ifdef CG	# Include CodeGuard info
!error CodeGuard not supported under DOS-386
!endif

!else		#-----	Distribution version

AFLAGS		= $(AFLAGS)
CFLAGS		= $(CFLAGS) -G- -D_NO_LINK_CHECK
LFLAGS		= $(LFLAGS) /x
BFLAGS		= $(BFLAGS) /P32 /0

!endif	# EBUG

!ifdef LL	#-----	DLL version

POSTFIX 	= $(POSTFIX)i
CFLAGS		= $(CFLAGS) -WXD -D_TLXDLL
LFLAGS		= $(LFLAGS) /Tpd
STARTUP 	= C0D32

!else		#-----	Static version

CFLAGS		= $(CFLAGS) -WX
LFLAGS		= $(LFLAGS) /Tpe /ax
STARTUP 	= C0X32

!endif	# LL

!ifdef RTLDLL
RUNTIME 	= crtldll IMPORT32
!else
RUNTIME 	= CW32 DPMI32
!endif
XLIBS		=

!elif $d(OS2)
#----------------------------------------------------------------------------
#    OS/2 options
#
#    Library = TLX2[d][i]
#----------------------------------------------------------------------------

# Under OS/2, compilation for static and dynamic libraries is identical;
# only the linking step differs. Therefore, .OBJ files for both static and
# dynamic libraries share the same directory and configuration file.

AS		= TASM
CC		= BCC
LINK		= TLINK
LIBR		= TLIB
LINT		= c:\bin\lint\lint2

POSTFIX 	= 2
AFLAGS		= /mx
CFLAGS		= -3 -c -d -O1 -w -D_TLXBUILD -DPROJLEVEL=$(PROJLEVEL)
LFLAGS		= /c
BFLAGS		= /C
LINTF		= -zero -ic:\bin\lint co-bcos2.lnt -i$(INCLUDE) +v \
		  -D_TLXBUILD -DPROJLEVEL=$(PROJLEVEL)

!ifdef EBUG	#-----	Debugging version

POSTFIX 	= $(POSTFIX)d
AFLAGS		= $(AFLAGS) /zi
CFLAGS		= $(CFLAGS) -N -D_TLXDBG
LFLAGS		= $(LFLAGS) /m
BFLAGS		= $(BFLAGS) /P64
LINTF		= $(LINTF) -D_TLXDBG

!ifdef SYM	# Include symbolic debug info
CFLAGS		= $(CFLAGS) -v
LFLAGS		= $(LFLAGS) /v
!endif

!ifdef CG	# Include CodeGuard info
!error CodeGuard not supported under OS/2
!endif

!else		#-----	Distribution version

AFLAGS		= $(AFLAGS)
CFLAGS		= $(CFLAGS) -G- -D_NO_LINK_CHECK
LFLAGS		= $(LFLAGS) /x
BFLAGS		= $(BFLAGS) /P32 /0
LINTF		= $(LINTF)

!endif	# EBUG

!ifdef LL	#-----	DLL version

POSTFIX 	= $(POSTFIX)i
CFLAGS		= $(CFLAGS) -D_TLXDLL
LFLAGS		= $(LFLAGS) /Tod
LINTF		= $(LINTF)
STARTUP 	= C02D

!else		#-----	Static version

LFLAGS		= $(LFLAGS) /Toe
LINTF		= $(LINTF)
STARTUP 	= C02

!endif	# LL

RUNTIME 	= C2 OS2

!elif $d(WIN)
#----------------------------------------------------------------------------
#    Windows 16-bit options
#
#    Library = TLXWm[d][i]
#----------------------------------------------------------------------------

# Under Windows, compilation for static and dynamic libraries differs, and
# we have separate output directories and configuration files for the .OBJ
# files of each variant.

AS		= TASM
CC		= BCC
LINK		= TLINK
LIBR		= TLIB
LINT		= c:\bin\lint\lint

!ifndef M
M		= l
!endif

POSTFIX 	= w$(M)
AFLAGS		= /mx
CFLAGS		= -2 -c -d -O1 -w -D_TLXBUILD -m$(M) -DPROJLEVEL=$(PROJLEVEL)
LFLAGS		= /c /C /yx
BFLAGS		= /C

!ifdef RTLDLL
CFLAGS		= $(CFLAGS) -D_RTLDLL
POSTFIX 	= $(POSTFIX)r
!endif

!ifdef EBUG	#-----	Debugging version

AFLAGS		= $(AFLAGS) /zi
CFLAGS		= $(CFLAGS) -N -D_TLXDBG
LFLAGS		= $(LFLAGS) /m
BFLAGS		= $(BFLAGS) /P128

!ifdef SYM	# Include symbolic debug info
CFLAGS		= $(CFLAGS) -v
LFLAGS		= $(LFLAGS) /v
!endif

!ifdef CG	# Include CodeGuard info
!if $M != l
!error CodeGuard only supported with Large memory model
!endif
POSTFIX 	= $(POSTFIX)g
CFLAGS		= $(CFLAGS) -vGd -vGt
!else
POSTFIX 	= $(POSTFIX)d
!endif

!else		#-----	Distribution version

AFLAGS		= $(AFLAGS)
CFLAGS		= $(CFLAGS) -G- -D_NO_LINK_CHECK
LFLAGS		= $(LFLAGS) /x
BFLAGS		= $(BFLAGS) /P32 /0

!endif	# EBUG

!ifdef LL	#-----	DLL version

POSTFIX 	= $(POSTFIX)i
CFLAGS		= $(CFLAGS) -WDE -D_TLXDLL
LFLAGS		= $(LFLAGS) /Twd
STARTUP 	= C0D$(M)

!else		#-----	Static version

CFLAGS		= $(CFLAGS) -WE
LFLAGS		= $(LFLAGS) /Twe
STARTUP 	= C0W$(M)

!endif	# LL

!ifdef CG
RUNTIME		= cg16
!endif

!ifdef RTLDLL
RUNTIME 	= $(RUNTIME) crtldll IMPORT
!else
RUNTIME 	= $(RUNTIME) MATHW$(M) CW$(M) IMPORT
!endif
XLIBS		=

!elif $d(W32S)
#----------------------------------------------------------------------------
#    Win32S options
#
#    Library = TLXWX[d][i]
#----------------------------------------------------------------------------

# Under Windows, compilation for static and dynamic libraries differs, and
# we have separate output directories and configuration files for the .OBJ
# files of each variant.

AS		= TASM
CC		= BCC32
LINK		= TLINK32
LIBR		= TLIB
LINT		= c:\bin\lint\lint

POSTFIX 	= wx
AFLAGS		= /mx
CFLAGS		= -3 -c -d -O1 -w -D_TLXBUILD -DPROJLEVEL=$(PROJLEVEL)
LFLAGS		= /c
BFLAGS		= /C

!ifdef RTLDLL
CFLAGS		= $(CFLAGS) -D_RTLDLL
POSTFIX 	= $(POSTFIX)r
!endif

!ifdef EBUG	#-----	Debugging version

AFLAGS		= $(AFLAGS) /zi
CFLAGS		= $(CFLAGS) -N -D_TLXDBG
LFLAGS		= $(LFLAGS) /m
BFLAGS		= $(BFLAGS) /P128

!ifdef SYM	# Include symbolic debug info
CFLAGS		= $(CFLAGS) -v
LFLAGS		= $(LFLAGS) /v
!endif

!ifdef CG	# Include CodeGuard info
CFLAGS		= $(CFLAGS) -vGd -vGt
POSTFIX 	= $(POSTFIX)g
!else
POSTFIX 	= $(POSTFIX)d
!endif

!else		#-----	Distribution version

AFLAGS		= $(AFLAGS)
CFLAGS		= $(CFLAGS) -G- -D_NO_LINK_CHECK
LFLAGS		= $(LFLAGS) /x
BFLAGS		= $(BFLAGS) /P32 /0

!endif	# EBUG

!ifdef LL	#-----	DLL version

POSTFIX 	= $(POSTFIX)i
CFLAGS		= $(CFLAGS) -tWDE -D_TLXDLL
LFLAGS		= $(LFLAGS) /Tpd
STARTUP 	= C0D32

!else		#-----	Static version

CFLAGS		= $(CFLAGS) -tW
LFLAGS		= $(LFLAGS) /Tpe
STARTUP 	= C0W32

!endif	# LL

!ifdef RTLDLL
RUNTIME 	= crtldll IMPORT32
!else
RUNTIME 	= CW32 IMPORT32
!endif
XLIBS		=

!elif $d(NT)
#----------------------------------------------------------------------------
#    Windows NT 32-bit options
#
#    Library = TLXN[d][i]
#----------------------------------------------------------------------------

# Under Windows, compilation for static and dynamic libraries differs, and
# we have separate output directories and configuration files for the .OBJ
# files of each variant.

AS		= TASM
CC		= BCC32
LINK		= TLINK32
LIBR		= TLIB
LINT		= c:\bin\lint\lint

POSTFIX 	= n
AFLAGS		= /mx
CFLAGS		= -3 -c -d -O1 -w -D_TLXBUILD -DPROJLEVEL=$(PROJLEVEL)
LFLAGS		= /c /ap		# Console version for now
BFLAGS		= /C

!ifdef RTLDLL
CFLAGS		= $(CFLAGS) -D_RTLDLL
POSTFIX 	= $(POSTFIX)r
!endif

!ifdef EBUG	#-----	Debugging version

AFLAGS		= $(AFLAGS) /zi
CFLAGS		= $(CFLAGS) -N -D_TLXDBG
LFLAGS		= $(LFLAGS) /m
BFLAGS		= $(BFLAGS) /P128

!ifdef SYM	# Include symbolic debug info
CFLAGS		= $(CFLAGS) -v
LFLAGS		= $(LFLAGS) /v
!endif

!ifdef CG	# Include CodeGuard info
CFLAGS		= $(CFLAGS) -vGd -vGt
POSTFIX 	= $(POSTFIX)g
!else
POSTFIX 	= $(POSTFIX)d
!endif

!else		#-----	Distribution version

AFLAGS		= $(AFLAGS)
CFLAGS		= $(CFLAGS) -G- -D_NO_LINK_CHECK
LFLAGS		= $(LFLAGS) /x
BFLAGS		= $(BFLAGS) /P32 /0

!endif	# EBUG

!ifdef LL	#-----	DLL version

POSTFIX 	= $(POSTFIX)i
CFLAGS		= $(CFLAGS) -tWCDE -D_TLXDLL	  # Console version for now
LFLAGS		= $(LFLAGS) /Tpd
STARTUP 	= C0D32

!else		#-----	Static version

CFLAGS		= $(CFLAGS) -tWC	# Console version for now
LFLAGS		= $(LFLAGS) /Tpe
STARTUP 	= C0X32 		# Console version

!endif	# LL

!ifdef CG
RUNTIME		= cg32
!endif

!ifdef RTLDLL
RUNTIME 	= $(RUNTIME) crtldll IMPORT32
!else
RUNTIME 	= $(RUNTIME) CW32 IMPORT32
!endif
XLIBS		=

!else
!error Unsupported platform; contact Tarma Software Research
!endif

#-----------------------------------------------------------------------------
#	Common options, part 2
#-----------------------------------------------------------------------------

.PATH.asm	= ..
.PATH.c 	= ..
.PATH.cpp	= ..
##.PATH.h 	= ..\..
.PATH.obj	= $(POSTFIX)
.PATH.lin	= $(POSTFIX)
.PATH.dll	= .
.PATH.lib	= .

!ifndef INCLUDE
!error You must set the INCLUDE environment variable
!endif
EXCLUDE		= \bc45\include
##INCLUDE 	= $(.PATH.h);$(INCLUDE)
INCLUDE 	= \Dev;$(INCLUDE)

!ifndef LIB
!error You must set the LIB environment variable
!endif
LIB		= $(.PATH.lib);$(LIB)

BASENAME	= tlx$(POSTFIX)
CCONFIG 	= $(BASENAME).cfg
DEFFILE 	= $(BASENAME).def
LIBRSP		= $(BASENAME).rsp
LINTRSP 	= $(BASENAME).lnt
TEST		= $(BASENAME).exe
DLLTARGET	= $(BASENAME).dll

!ifdef LIN
TARGET		= $(BASENAME).ln
!else
TARGET		= $(BASENAME).lib
!endif

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

.suffixes:
.suffixes: .CPP .C .ASM

.asm.obj:
	$(AS) $(AFLAGS) $<

.c.obj:
	$(CC) +$(CCONFIG) $<

.cpp.obj:
	$(CC) +$(CCONFIG) $<

.c.lin:
	$(LINT) $(LINTRSP) -os($@) $<

.cpp.lin:
	$(LINT) $(LINTRSP) -os($@) $<

#-----------------------------------------------------------------------------
#	Target files
#-----------------------------------------------------------------------------

!ifdef LIN
OBJ		= lin
!else
OBJ		= obj
!endif

FILELIST	= ..\filelist.mak
!include $(FILELIST)

OBJECTS 	= $(FILES:+PFX\=)
LIBFILES	= $(FILES:PFX=$(.PATH.obj))
DLLFILES	= $(FILES:+PFX=$(.PATH.obj))

#-----------------------------------------------------------------------------
#	Default target checks if output directory exists, then builds
#	compiler configuration file and target library
#-----------------------------------------------------------------------------

!ifdef LIN
all:	start $(TARGET)
!else
all:	start $(CCONFIG) timestamp timestmp.obj $(TARGET) $(TEST)
!endif

start:
	@-if not exist $(.PATH.obj)\*.* md $(.PATH.obj)

timestamp:
	-touch $(.PATH.cpp)\timestmp.cpp

#-----------------------------------------------------------------------------
#	Library file target
#-----------------------------------------------------------------------------

!ifdef LL	#-------- DLL target

$(TARGET): $(DLLTARGET)
	implib $(.PATH.lib)\$(TARGET) $(.PATH.dll)\$(DLLTARGET)

$(DLLTARGET): $(OBJECTS) libmain.obj $(XLIBS)
	@-del $(.PATH.dll)\$(DLLTARGET) >nul
	$(LINK) @$(LIBRSP)

$(LIBRSP): $(MAKEFILE) $(FILELIST)
	copy &&|
$(LFLAGS) /L$(LIB) $(STARTUP) +
$(DLLFILES)
$(.PATH.dll)\$(DLLTARGET)

$(XLIBS) $(RUNTIME)
$(DEFFILE)
| $(LIBRSP)

!else		#-------- Static library target

!ifdef LIN
$(TARGET): $(OBJECTS) $(LINTRSP)

$(LINTRSP): $(MAKEFILE)
	copy &&|
$(LINTF)
| $(LINTRSP)
!else
$(TARGET): $(OBJECTS) $(LIBRSP)
	@-del $(.PATH.lib)\$(TARGET) >nul
	$(LIBR) @$(LIBRSP)

$(LIBRSP): $(MAKEFILE) $(FILELIST)
	copy &&|
$(.PATH.lib)\$(TARGET) $(BFLAGS) &
$(LIBFILES)
| $(LIBRSP)
!endif

!endif

#-----------------------------------------------------------------------------
#	Test program target
#-----------------------------------------------------------------------------

!ifdef DOS

$(TEST): $(TARGET) maintest.obj
	$(LINK) @&&|
$(LFLAGS) /L$(LIB)	+
$(STARTUP)		+
$(.PATH.obj)\maintest.obj
$(TEST)

$(TARGET) $(RUNTIME)
|
	-$(TEST)

!else

$(TEST): $(TARGET) maintest.obj $(DEFFILE)
	$(LINK) @&&|
$(LFLAGS) /L$(LIB)	+
$(STARTUP)		+
$(.PATH.obj)\maintest.obj
$(TEST)

$(TARGET) $(RUNTIME)
$(DEFFILE)
|
	-$(TEST)

!endif

#-----------------------------------------------------------------------------
#	Compiler configuration file
#-----------------------------------------------------------------------------

$(CCONFIG): $(MAKEFILE)
	copy &&|
$(CFLAGS)
-I$(INCLUDE)
-n$(.PATH.obj)
| $(CCONFIG)

#-----------------------------------------------------------------------------
#	Linker definition file
#-----------------------------------------------------------------------------

!if $d(DOS)		#-----	DOS version

$(DEFFILE): $(MAKEFILE)
	copy &&|
; Linker definition file for $(TEST)
;
; Copyright (c) 1995 Tarma Software Research. All rights reserved.
| $(DEFFILE)

!elif $d(D32)		#-----	DOS-32 version

$(DEFFILE): $(MAKEFILE)
	copy &&|
; Linker definition file for $(TEST)
;
; Copyright (c) 1995 Tarma Software Research. All rights reserved.

EXETYPE 	WINDOWS

CODE	PRELOAD
DATA	PRELOAD MULTIPLE

HEAPSIZE	4096
STACKSIZE	8192
| $(DEFFILE)

!elif $d(OS2)		#-----	OS/2 version

$(DEFFILE): $(MAKEFILE)
	copy &&|
; Linker definition file for $(TEST)
;
; Copyright (c) 1995 Tarma Software Research. All rights reserved.

EXETYPE 	OS2

CODE	PRELOAD EXECUTEREAD
DATA	PRELOAD MULTIPLE

HEAPSIZE	4096
STACKSIZE	8192
| $(DEFFILE)

!elif $d(WIN)		#-----	Windows version

$(DEFFILE): $(MAKEFILE)
	copy &&|
; Linker definition file for $(TEST)
;
; Copyright (c) 1995 Tarma Software Research. All rights reserved.

EXETYPE 	WINDOWS

CODE	PRELOAD MOVEABLE DISCARDABLE
DATA	PRELOAD MOVEABLE MULTIPLE

HEAPSIZE	4096
STACKSIZE	8192
| $(DEFFILE)

!elif $d(W32S)		#-----	Win32S version

$(DEFFILE): $(MAKEFILE)
	copy &&|
; Linker definition file for $(TEST)
;
; Copyright (c) 1995 Tarma Software Research. All rights reserved.

EXETYPE 	WINDOWS

CODE	PRELOAD
DATA	PRELOAD MULTIPLE

HEAPSIZE	4096
STACKSIZE	8192
| $(DEFFILE)

!elif $d(NT)		#-----	Windows NT version

$(DEFFILE): $(MAKEFILE)
	copy &&|
; Linker definition file for $(TEST)
;
; Copyright (c) 1995 Tarma Software Research. All rights reserved.

EXETYPE 	WINDOWS

CODE	PRELOAD
DATA	PRELOAD MULTIPLE

HEAPSIZE	4096
STACKSIZE	8192
| $(DEFFILE)

!else
!error Unknown platform; contact Tarma Software Research
!endif

#-----------------------------------------------------------------------------
#	Tracing DLL & import library targets
#-----------------------------------------------------------------------------

!if $d(WIN)

tlxtrace: tlxtrace.lib

tlxtrace.lib: tlxtr$(TLXVER).dll
	IMPLIB $(.PATH.lib)\tlxtr$(TLXVER).lib $(.PATH.dll)\tlxtr$(TLXVER).dll

tlxtr$(TLXVER).dll: tracelib.def tracelib.cpp
	$(CC) -v -c -WDE -d -G- -I$(INCLUDE) -m$(M) -O1 -w -D_TRACEBUILD \
		-D_NO_LINK_CHECK $(.PATH.cpp)\tracelib.cpp
	$(LINK) /v /c /yx /L$(LIB) /Twd C0D$(M).OBJ tracelib.obj, \
	     $(.PATH.dll)\tlxtr$(TLXVER).dll,,CW$(M).LIB MATHW$(M).LIB \
	     IMPORT.LIB, tracelib.def

!endif

#-----------------------------------------------------------------------------
#	Explicit rules
#-----------------------------------------------------------------------------

clean:
	del /s *.bak *.map *.sym *.obj

depend:
	$(MD) $(MDFLAGS) /E$(OBJ) $(.PATH.cpp)\*.cpp

version:
	ci /q /u *.c *.cpp *.h $(MAKEFILE)

#-----------------------------------------------------------------------------
#	File dependencies
#-----------------------------------------------------------------------------

!include $(DEPEND)
