#
# EXAMPLE MAKEFILE FOR EMSTEST TESTER/EXAMPLE PROGRAM FOR EMSLIB
# BORLAND COMPILERS
# 10/13/91
#
#   This is an example makefile for Turbo/Borland C[++], to make the EMSTEST
# tester/example program in any of the six supported memory models. It is
# compatible with the MAKE utility provided with the compiler. As supplied,
# it is set up for Borland C++. To reconfigure for earlier compilers, simply
# change "bcc" to "tcc" on the line that begins with "CC", and add "-DNO_FFUNC"
# to the line that begins "CFLAGS". This last is necessary because earlier
# Borland compilers did not have the functions _fmemcmp() and _fmemset();
# defining this symbol causes EMSTEST to use internal replacements for these
# functions. Also, earlier compilers required an external assembler (MASM or
# TASM) to support in-line assembly code. If you have the required assembler
# and wish to use the in-line assembly code (it improves execution speed
# significantly), you do not need to make any changes. However, compilation
# will be faster if you add "-B" to the line that begins with "CFLAGS2". If
# you do not have the required assembler or do not with to use the in-line
# assembly code, simply remove "-DINLINE_ASM" from the line that begins
# "CFLAGS".
#
#   Before using this makefile, make sure that the Borland MAKE utility and
# the appropriate command-line compiler and linker are in your path. The three
# source files (EMSTEST.C, EMSTEST2.C, and EMSTEST3.C), the header files
# (EMSTEST.H and EMSLIB.H), the appropriate library or libraries (EMSLIB*.LIB),
# and STACK.OBJ (if making the tiny-model example) should all be in the
# current directory. TLINK is assumed to know where the standard objects
# and libraries are (this is an installation/configuration option when
# installing Borland compilers).
#
#   To use the makefile, type "make -fexmaketc target", where 'target' is
# one or more of tiny, small, medium, compact, large, or huge, separated by
# spaces. For example, "make -fexmaketc tiny" would make the tiny-model
# example and "make -fexmaketc small large" would make the small- and large-
# model examples. "make -fexmaketc" will make the test programs for all
# memory models.
#

CC	= bcc
CFLAGS	= -c -d -DINLINE_ASM
CFLAGS2	=

LINK	= tlink
LF	= /x



all:		tiny small medium compact large huge

tiny:		emstesta emstestb emstestc

small:		semstest

medium:		memstest

compact:	cemstest

large:		lemstest

huge:		hemstest


emstesta.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -mt -DTINYPASS1 -o$< emstest.c

emstestb.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -mt -DTINYPASS2 -o$< emstest.c

emstestc.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -mt -DTINYPASS3 -o$< emstest.c

semstest.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -ms -o$< emstest.c

memstest.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -mm -o$< emstest.c

cemstest.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -mc -o$< emstest.c

lemstest.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -ml -o$< emstest.c

hemstest.obj:	emstest.c emstest.h
	$(CC) $(CFLAGS) $(CFLAGS2) -mh -o$< emstest.c

temstst2.obj:	emstest2.c emstest.h
	$(CC) $(CFLAGS) -mt -o$< emstest2.c

semstst2.obj:	emstest2.c emstest.h
	$(CC) $(CFLAGS) -ms -o$< emstest2.c

memstst2.obj:	emstest2.c emstest.h
	$(CC) $(CFLAGS) -mm -o$< emstest2.c

cemstst2.obj:	emstest2.c emstest.h
	$(CC) $(CFLAGS) -mc -o$< emstest2.c

lemstst2.obj:	emstest2.c emstest.h
	$(CC) $(CFLAGS) -ml -o$< emstest2.c

hemstst2.obj:	emstest2.c emstest.h
	$(CC) $(CFLAGS) -mh -o$< emstest2.c

temstst3.obj:	emstest3.c emstest.h
	$(CC) $(CFLAGS) -mt -o$< emstest3.c

semstst3.obj:	emstest3.c emstest.h
	$(CC) $(CFLAGS) -ms -o$< emstest3.c

memstst3.obj:	emstest3.c emstest.h
	$(CC) $(CFLAGS) -mm -o$< emstest3.c

cemstst3.obj:	emstest3.c emstest.h
	$(CC) $(CFLAGS) -mc -o$< emstest3.c

lemstst3.obj:	emstest3.c emstest.h
	$(CC) $(CFLAGS) -ml -o$< emstest3.c

hemstst3.obj:	emstest3.c emstest.h
	$(CC) $(CFLAGS) -mh -o$< emstest3.c


emstesta:	emstesta.obj stack.obj emslibs.lib
	$(LINK) $(LF) c0t emstesta stack, emstesta, , cs emslibs

emstestb:	emstestb.obj temstst2.obj stack.obj emslibs.lib
	$(LINK) $(LF) c0t emstestb temstst2 stack, emstestb, , cs emslibs

emstestc:	emstestc.obj temstst3.obj stack.obj emslibs.lib
	$(LINK) $(LF) c0t emstestc temstst3 stack, emstestc, , cs emslibs

semstest:	semstest.obj semstst2.obj semstst3.obj emslibs.lib
	$(LINK) $(LF) c0s semstest semstst2 semstst3, semstest, , cs emslibs

memstest:	memstest.obj memstst2.obj memstst3.obj emslibm.lib
	$(LINK) $(LF) c0m memstest memstst2 memstst3, memstest, , cm emslibm

cemstest:	cemstest.obj cemstst2.obj cemstst3.obj emslibc.lib
	$(LINK) $(LF) c0c cemstest cemstst2 cemstst3, cemstest, , cc emslibc

lemstest:	lemstest.obj lemstst2.obj lemstst3.obj emslibl.lib
	$(LINK) $(LF) c0l lemstest lemstst2 lemstst3, lemstest, , cl emslibl

hemstest:	hemstest.obj hemstst2.obj hemstst3.obj emslibh.lib
	$(LINK) $(LF) c0h hemstest hemstst2 hemstst3, hemstest, , ch emslibh

