#
# EXAMPLE MAKEFILE FOR EMSTEST TESTER/EXAMPLE PROGRAM FOR EMSIF
# TURBO C, TURBO C++
# 12/01/91
#
#   This is an example makefile for Turbo 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 Turbo C 2.0 (MAKE version
# 2.0). As supplied, it is set up for Turbo C 2.0. It is also set up to use
# the inline-assembly versions of the functions in TESTUTIL.C.
#
#   The "-DNO_FFUNC" option on the "CFLAGS" line below is necessary because
# Borland compilers before BC++ 2.0 did not have the functions _fmemcmp() and
# _fmemset(); defining this symbol causes EMSTEST to use internal replacements
# for these functions. These compilers also require an external assembler
# (generally TASM, although Turbo C 1.5 and before used MASM) 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. If you do not have the required assembler
# or do not wish to use the in-line assembly code, simply remove "-DINLINE_ASM"
# from the line that begins "CFLAGS", and remove "-B" from the line that
# begins "CFLAGS2".
#
#   Before using this makefile, make sure that the Borland MAKE utility and
# the appropriate command-line compiler and linker are in your path. The four
# source files (EMSTEST.C, EMSTEST2.C, EMSTEST3.C, and TESTUTIL.C), the header
# files (EMSTEST.H, TESTUTIL.H, and EMSIF.H), the appropriate library or
# libraries (EMSIF*.LIB), and STACK.OBJ (if making the tiny-model example)
# should all be in the current directory. Make sure that the line beginning
# "LIBS" below contains the path to the standard objects and libraries (for
# example, if the standard libraries are in c:\tc\lib, then the line should
# read "LIBS = c:\tc\lib").
#
#   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	= tcc
CFLAGS	= -c -d -DINLINE_ASM -DNO_FFUNC
CFLAGS2 = -B

LINK	= tlink
LF	= /c /x

LIBS	= c:\tc\lib


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 testutil.h
        $(CC) $(CFLAGS) -mt -DTINYPASS1 -o$< emstest.c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ttstutil.obj:	testutil.c testutil.h
        $(CC) $(CFLAGS) $(CFLAGS2) -mt -o$< testutil.c

ststutil.obj:	testutil.c testutil.h
        $(CC) $(CFLAGS) $(CFLAGS2) -ms -o$< testutil.c

mtstutil.obj:	testutil.c testutil.h
        $(CC) $(CFLAGS) $(CFLAGS2) -mm -o$< testutil.c

ctstutil.obj:	testutil.c testutil.h
        $(CC) $(CFLAGS) $(CFLAGS2) -mc -o$< testutil.c

ltstutil.obj:	testutil.c testutil.h
        $(CC) $(CFLAGS) $(CFLAGS2) -ml -o$< testutil.c

htstutil.obj:	testutil.c testutil.h
        $(CC) $(CFLAGS) $(CFLAGS2) -mh -o$< testutil.c


emstesta:	emstesta.obj ttstutil.obj stack.obj emsifs.lib
	$(LINK) $(LF) $(LIBS)\c0t emstesta ttstutil stack, emstesta, , \
		$(LIBS)\cs emsifs

emstestb:	emstestb.obj temstst2.obj ttstutil.obj stack.obj emsifs.lib
	$(LINK) $(LF) $(LIBS)\c0t emstestb temstst2 ttstutil stack, emstestb, , \
		$(LIBS)\cs emsifs

emstestc:	emstestc.obj temstst3.obj ttstutil.obj stack.obj emsifs.lib
	$(LINK) $(LF) $(LIBS)\c0t emstestc temstst3 ttstutil stack, emstestc, , \
		$(LIBS)\cs emsifs

semstest:	semstest.obj semstst2.obj semstst3.obj ststutil.obj emsifs.lib
	$(LINK) $(LF) $(LIBS)\c0s semstest semstst2 semstst3 ststutil, semstest, , \
		$(LIBS)\cs emsifs

memstest:	memstest.obj memstst2.obj memstst3.obj mtstutil.obj emsifm.lib
	$(LINK) $(LF) $(LIBS)\c0m memstest memstst2 memstst3 mtstutil, memstest, , \
		$(LIBS)\cm emsifm

cemstest:	cemstest.obj cemstst2.obj cemstst3.obj ctstutil.obj emsifc.lib
	$(LINK) $(LF) $(LIBS)\c0c cemstest cemstst2 cemstst3 ctstutil, cemstest, , \
		$(LIBS)\cc emsifc

lemstest:	lemstest.obj lemstst2.obj lemstst3.obj ltstutil.obj emsifl.lib
	$(LINK) $(LF) $(LIBS)\c0l lemstest lemstst2 lemstst3 ltstutil, lemstest, , \
		$(LIBS)\cl emsifl

hemstest:	hemstest.obj hemstst2.obj hemstst3.obj htstutil.obj emsifh.lib
	$(LINK) $(LF) $(LIBS)\c0h hemstest hemstst2 hemstst3 htstutil, hemstest, , \
		$(LIBS)\ch emsifh

